microsoft / microsoft/semantic-kernel

.Net: Difference in duration values between OpenTelemetry metrics and traces

Open
#10,931 2 comments 0 reactions 1 assignee View on GitHub

@dmytrostruk is already working on this.

Since Mar 14, 2025.

.NET bug telemetry
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.