-
Notifications
You must be signed in to change notification settings - Fork 497
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 view to Npgsql duration metrics #641
Comments
This isn't an Aspire specific issue. Why isn't this being handled in OpenTelemetry? The instrument declares that it's units are seconds. This should just work without every instrument consumer needing to make a custom view. |
Here's the instrument creation: https://github.com/npgsql/npgsql/blob/5c106023a1a192a2fab0726fc7df9ca51e39cb22/src/Npgsql/MetricsReporter.cs#L62-L66 CommandDuration
= Meter.CreateHistogram<double>(
"db.client.commands.duration",
unit: "s",
description: "The duration of database commands, in seconds."); |
Three decisions have put us in this situation:
A fix is hard coded for known .NET built-in counters in OTEL. Automatically changing all histograms with a unit of seconds might not be what someone wants. The temporary solution for 3rd parties in .NET 8 is to add custom views. |
So maybe Npgsql should be updated to |
I think DB conventions just hasn't been updated yet for seconds. They're focusing on stabilizing HTTP. |
Reopening to backport to preview1. |
FWIW I implemented seconds for command duration because of the explicit OTel conventions around this, as @JamesNK wrote above:
|
Fixed with #660. |
Histogram buckets aren't well configured in OpenTelemetry. The minimum bucket is 5. That's fine if you're measuring in milliseconds, not so good when you're measuring in seconds. There is special hardcoding for known .NET histograms, but 3rd party histograms aren't helped.
Need to add views to PostgresSQL component.
Example:
The text was updated successfully, but these errors were encountered: