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

duration_μs cannot be handled by DataDog #124

Closed
pirvudoru opened this issue Jul 26, 2024 · 6 comments
Closed

duration_μs cannot be handled by DataDog #124

pirvudoru opened this issue Jul 26, 2024 · 6 comments

Comments

@pirvudoru
Copy link

pirvudoru commented Jul 26, 2024

Hello,

Seems that DataDog does not like the "duration_μs" as path anywhere -- cannot remap, cannot create a metric from it. -- From LoggerJSON.Plug

image
image

Can we change it to something else ?

I've just updated from 5.1.3 to latest 6.03

@AndrewDryga
Copy link
Member

I think a good way to solve this would be to sanitize all the metadata key names in DataDog adapter, a PR would be welcome.

@AndrewDryga
Copy link
Member

Hello @bvobart @pirvudoru and @guzishiwo. Sorry for taking so long to reply. I pushed the simplest possible fix to main - replace μs with us. Most destinations do not support unicode so I feel like there is no good reason trying to fight to keep it.

Please give it a try. I will push the release to hex in a few days.

@bvobart
Copy link
Contributor

bvobart commented Aug 27, 2024

Alright that sounds like a good solution for the general case, @AndrewDryga, but for the Elastic formatter, duration_us is still not a valid ECS field, so it would still be best to map that to event.duration. I don't think Elastic and Kibana will crash or error when they encounter duration_us, but they might well ignore it or at least not do anything useful with it. I'll rebase my MR (#129) and reopen it to fix that.

I see DataDog has a similar predefined format for a duration field (they recommend just using duration with the value in nanoseconds), so a similar remap will need to happen for the DataDog formatter. Same for the Google Cloud formatter too, though I'm not sure what field they use.

To be clear, I do think it's good to keep the generic duration field as duration_us because that at least specifies which unit the duration is in. But the product-specific formatters will need to adhere to those products' log specs.

EDIT: see #132

@AndrewDryga
Copy link
Member

@bvobart I'm sorry for missing that out, lets merge your fix.

@AndrewDryga
Copy link
Member

AndrewDryga commented Aug 28, 2024

TODO for myself:

@AndrewDryga
Copy link
Member

The fix will be released in 6.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants