-
Notifications
You must be signed in to change notification settings - Fork 6
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
logs: incorrect service.name
transformation
#356
Comments
This should be fixed in open-telemetry/opentelemetry-collector-contrib#34420. |
Thank you. I'll give it a test when the beta is live then. |
Sounds good, you can either wait until the beta is live or you can enable the |
When the
service.name
attribute is set as a resource attribute or as an attribute on the log, the Datadog user interface shows a JSON object instead of the name of the service.This issue actually spawns a larger discussion about how the
transform
function is meant to work. Specifically, thetransform
function retrieves the value forservice
, among others, from either resource attributes or attributes on the log. It then uses thatservice
value to set theService
field on thedatadogV2.HTTPLogItem
. Since values can be set from both resource attributes or attributes on the log, it's not clear which method operators should be using in their code. Perhaps this should be broken out into a separate issue for further discussion. Either way, I'm bringing it up here because it was a bit confusing when reading the code.opentelemetry-mapping-go/pkg/otlp/logs/transform.go
Lines 78 to 80 in 6e80d7e
Here's the
transform
processor I used to set theservice.name
attribute on the log.Notice how this appears incorrectly as a JSON object in the Datadog user interface. With this incorrect behavior I cannot use
service:sudomateo
to filter logs.The text was updated successfully, but these errors were encountered: