Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Attributes key behaviour between otel4s and oteljava #513

Closed
NthPortal opened this issue Feb 19, 2024 · 1 comment · Fixed by #529
Closed

Inconsistent Attributes key behaviour between otel4s and oteljava #513

NthPortal opened this issue Feb 19, 2024 · 1 comment · Fixed by #529
Labels
bug Something isn't working

Comments

@NthPortal
Copy link
Contributor

NthPortal commented Feb 19, 2024

otel4s allows multiple Attributes with the same name but different types in an Attributes collection; oteljava on the other hand does not, and I suspect that they are spec compliant.

@NthPortal NthPortal added the bug Something isn't working label Feb 19, 2024
@iRevive
Copy link
Contributor

iRevive commented Feb 19, 2024

Indeed.

println(
  JAttributes.of(
    JAttributeKey.longKey("key"), Long.box(123L),
    JAttributeKey.doubleKey("key"), Double.box(123.0)
  )
)
// {key=123.0}

The keys, however, are distinguished:

JAttributeKey.longKey("key") == JAttributeKey.longKey("key") // true
JAttributeKey.longKey("key") == JAttributeKey.doubleKey("key") // false

So we should update only Attributes builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants