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

[connector/spanmetrics] Incorrect starttimestamps for subspans. #35994

Open
shivanthzen opened this issue Oct 25, 2024 · 5 comments · May be fixed by #36718
Open

[connector/spanmetrics] Incorrect starttimestamps for subspans. #35994

shivanthzen opened this issue Oct 25, 2024 · 5 comments · May be fixed by #36718
Labels
bug Something isn't working needs triage New item requiring triage

Comments

@shivanthzen
Copy link
Contributor

shivanthzen commented Oct 25, 2024

Component(s)

connector/spanmetrics

What happened?

Description

Currently while generating metrics out of traces, the start timestamp of a metric is currently tied to the root span. When a "new" subspan appears for trace (eg : unhappy path on an api call which results in a new subspan), the time starttimestamp for the new metric for the new subspan is that of the root span(which can be well in the past).

Steps to Reproduce

  1. Setup otelcol with traces and spanmetricsconnector to generate metrics.
  2. Generate periodic traces to the collector with consistent spans for a long duration.
  3. Generate a trace that contains a "new" span for the same parent span.

We store start-timestamp at resource level rawmetrics in the spanconnector. This starttimestamp is used regardless of when the "new" subspan appeared.

Expected Result

The metric generated for the new span has a timestamp of the first occurance of the "new" span.

Actual Result

The metric generated for the new span has the time stamp corresponding start of the periodic trace

Collector version

v0.112.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@shivanthzen shivanthzen added bug Something isn't working needs triage New item requiring triage labels Oct 25, 2024
@shivanthzen shivanthzen changed the title SpanmetricsConnector: Incorrect starttimestamps for subspans. [connector/spanmetrics]: Incorrect starttimestamps for subspans. Oct 25, 2024
@shivanthzen shivanthzen changed the title [connector/spanmetrics]: Incorrect starttimestamps for subspans. [connector/spanmetrics] Incorrect starttimestamps for subspans. Oct 25, 2024
@shivanthzen
Copy link
Contributor Author

cc: @portertech @Frapschen

@shivanthzen
Copy link
Contributor Author

Reopening

@shivanthzen shivanthzen reopened this Oct 29, 2024
shivanthzen added a commit to shivanthzen/opentelemetry-collector-contrib that referenced this issue Nov 4, 2024
… of a metric is currently tied to the root span. When a "new" child span appears for trace (eg : unhappy path on an api call which results in a new subspan or an async process that was triggered much later), the time starttimestamp for the new metric for the new child span is that of the parent span(which can be well in the past).

This MR moves the start timestamp from resource level (root span) to metric level(child span)  . (Doesn't consider delta-temporality as of now).
References: open-telemetry#35994
Upstream Fix: open-telemetry#36019
shivanthzen added a commit to shivanthzen/opentelemetry-collector-contrib that referenced this issue Nov 4, 2024
Currently while generating metrics out of traces, the start timestamp of a metric is currently tied to the root span. When a "new" child span  appears for trace (eg : unhappy path on an api call which results in a new subspan or an async process that was triggered much later), the time starttimestamp for the new metric for the new child span  is that of the parent span(which can be well in the past).
This MR moves the start timestamp from resource level (root span) to metric level(child span)  . (Doesn't consider delta-temporality as of now).
References: open-telemetry#35994
Upstream Fix: open-telemetry#36019
@shivanthzen
Copy link
Contributor Author

shivanthzen commented Nov 4, 2024

Ping @Frapschen @portertech
The POC fix has been validated on production.

Copy link
Contributor

github-actions bot commented Jan 6, 2025

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Jan 6, 2025
@shivanthzen
Copy link
Contributor Author

@open-telemetry/collector-contrib-triagers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage
Projects
None yet
1 participant