How to add attributes using the otel logger #127
-
|
Hey, How can I add attributes when using the Otel logger? If I send them in the body, the attributes are processed twice.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
Hi @thibaultleouay! Thanks for bringing this up. To help diagnose this issue, could you please share:
Looking at the code, I can see that My initial hypothesis is that you might be passing properties nested under an Also, this raises a broader question about whether the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for reporting this! I've investigated the issue and found the root cause. The otelLogger.info({ method: "GET", outcome: "success", ... });It gets sent to OpenTelemetry as: {
"attributes": {
"attributes.method": "GET",
"attributes.outcome": "success"
}
}Then Axiom displays the field path, which results in I've created issue #130 to track fixing this. The solution is to remove the unnecessary |
Beta Was this translation helpful? Give feedback.
-
|
Fixed in a3cb852. The This will be included in the next release (1.4.0). If you want to try it now, you can use the pre-release version 1.4.0-dev.465. Note that this is a breaking change, so if you have any queries or dashboards that rely on the old |
Beta Was this translation helpful? Give feedback.

Fixed in a3cb852. The
attributes.prefix has been removed from the OpenTelemetry sink, so properties are now sent as flat attributes (e.g.,method,outcome) instead ofattributes.method,attributes.outcome.This will be included in the next release (1.4.0). If you want to try it now, you can use the pre-release version 1.4.0-dev.465.
Note that this is a breaking change, so if you have any queries or dashboards that rely on the old
attributes.*key names, you'll need to update them.