microsoft / microsoft/semantic-kernel
.Net: Difference in duration values between OpenTelemetry metrics and traces
@dmytrostruk is already working on this.
Since Mar 14, 2025.
- Dominant language
- C#
- Stars
- 28.6k
- Forks
- 4.8k
- Avg merge
- 14h 13m
- Merged PRs (30d)
- 18
Description
Hello,
I instrumented my service as mentioned at the documentation Observability in Semantic Kernel to emit metrics and traces.
When I checked the metrics and traces, I saw that 'semantic_kernel_function_invocation_duration_seconds_sum' metric was sometimes different from what came in trace.
For example, the duration of one of my kernel functions appears as 12.85 ms in the trace, but while in the Prometheus, it seems 0.00310 sec. Similarly, the one which appears as 28.04ms in the trace seems 0.00729 in the metrics. But, there is no problem with those which appear in seconds in the trace like 1.49 sec. I also see this as 1.49 sec in the metric.
What could be the reason for this difference?
Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.