diff --git a/content/en/opentelemetry/integrations/log_collection.md b/content/en/opentelemetry/integrations/log_collection.md index a80f503d6f244..92077e4fac51f 100644 --- a/content/en/opentelemetry/integrations/log_collection.md +++ b/content/en/opentelemetry/integrations/log_collection.md @@ -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") +``` + ## Data collected Logs from the configured files. @@ -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