DataDog / serilog-sinks-datadog-logs

Serilog Sink that sends log events to Datadog https://www.datadoghq.com/
Apache License 2.0
60 stars 41 forks source link

Provide a way to set the `version` property #108

Closed andrewlock closed 10 months ago

andrewlock commented 10 months ago

As far as I can tell, there's currently no way to set the version property on logs, in the same way you can set the service or source. Attempting to set it through the tags configuration doesn't work, because these all get combined and added as ddtags:

https://github.com/DataDog/serilog-sinks-datadog-logs/blob/9757cf910386f4f45a8f3ca459ee5db34fa3e2f8/src/Serilog.Sinks.Datadog.Logs/Sinks/Datadog/DatadogLogRenderer.cs#L32C36-L32C36

Customers should be able to optionally specify the version tag as part of configuration, here:

https://github.com/DataDog/serilog-sinks-datadog-logs/blob/master/src/Serilog.Sinks.Datadog.Logs/Configuration/Extensions/Microsoft.Extensions.Configuration/LoggerConfigurationDatadogLogsExtensions.cs#L46-L51

andrewlock commented 10 months ago

Actually, testing shows this does work:

tags: new string[] {"foo:bar", "apple:orange", "version:1.2.3"}

image

which suggests it's a configuration issue.

Thanks, and sorry for the noise!