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

Add docs for ddtags in OTel logs #24500

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Changes from all commits
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
12 changes: 12 additions & 0 deletions content/en/opentelemetry/integrations/log_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ filelog:

{{< /tabs >}}

### Custom tags
In order to add custom Datadog tags to logs, set the `ddtags` attribute on the logs. For example, this can be done with the [transform processor][3]:
```yaml
processors:
transform:
log_statements:
- context: log
statements:
- set(attributes["ddtags"], "first_custom:tag, second_custom:tag")
Copy link
Contributor

Choose a reason for hiding this comment

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

Just making sure that this is correct and that each custom tag shouldn't be in its own set of quotation marks

Copy link
Member

Choose a reason for hiding this comment

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

Yes those are comma-separated

```

## Data collected

Logs from the configured files.
Expand Down Expand Up @@ -141,3 +152,4 @@ Flags: 0

[1]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/filelogreceiver
[2]: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/datadogexporter/examples/logs.yaml
[3]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor
Loading