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

[exporter/datadogexporter] Add support for custom log source #35051

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions exporter/datadogexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ To get the service field correctly populated in your logs, you can specify servi
[alpha]:https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[AWS]:https://aws-otel.github.io/docs/partners/datadog

### How to add custom log source

In order to add a custom source to your OTLP logs, set log attribute or resource attribute `datadog.log.source`.
songy23 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unusual to support an attribute both as a log attribute and a resource attribute (I don't know of any examples from semantic conventions at least). Why are we doing it like this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, and ideally this would be read only from resource attributes. It's currently done this way due to how the logs code is structured. The origin is accessible here, and this is where we need to set the source.

At this point, the attributes and resource attributes have been merged and are not distinguishable within AdditionalProperties. See Attributes/ resource attributes.

We have the same issue with status. This is fixable, but requires a refactor of the logs code to allow this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, will create a card to refactor logs path, and in the meantime will remove support for log attributes from docs.

Loading