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] Fix spanmetrics for child spans #36718

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

shivanthzen
Copy link
Contributor

@shivanthzen shivanthzen commented Dec 9, 2024

Description

Currently, metric start timestamps are associated with the parent span (resource level). This means that all child spans, even those that occur asynchronously or infrequently, inherit the same start timestamp. This can lead to inaccurate data.

This merge request proposes moving the start timestamp (and last seen timestamp) from the parent span level to the individual child span (metric) level. This will ensure that each metric has its own accurate start and last seen timestamps, regardless of its relationship to other spans.

Link to tracking issue

Fixes #35994

Testing

Documentation

@shivanthzen shivanthzen changed the title Fix spanmetrics [connector/spanmetrics] Fix spanmetrics Dec 9, 2024
@shivanthzen shivanthzen changed the title [connector/spanmetrics] Fix spanmetrics [connector/spanmetrics] Fix spanmetrics for child spans Dec 9, 2024
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 24, 2024
@shivanthzen
Copy link
Contributor Author

not stale

@portertech
Copy link
Contributor

@shivanthzen are you able to look at the failing tests? For example:

FAIL: TestTimestampsForUninterruptedStream/AGGREGATION_TEMPORALITY_CUMULATIVE

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

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

not stale

@github-actions github-actions bot removed the Stale label Feb 4, 2025
Apparently, for delta temporality, all the metrics collected are reset
to empty state after consuming one round of data. Hence storing the
lastseentimestamp within the metric doesn't work. This PR moves
lastseentimestamp  out of metric into a map (as it was stored
previously)
of
@shivanthzen shivanthzen marked this pull request as ready for review February 6, 2025 09:37
@shivanthzen shivanthzen requested a review from a team as a code owner February 6, 2025 09:37
@shivanthzen shivanthzen requested a review from codeboten February 6, 2025 09:37
@shivanthzen
Copy link
Contributor Author

@portertech Sorry about the delay. Please take another look.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Feb 21, 2025
Copy link
Contributor

github-actions bot commented Mar 7, 2025

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Mar 7, 2025
@atoulme atoulme reopened this Mar 8, 2025
@atoulme atoulme removed the Stale label Mar 8, 2025
@atoulme
Copy link
Contributor

atoulme commented Mar 8, 2025

@portertech please review

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

Successfully merging this pull request may close these issues.

[connector/spanmetrics] Incorrect starttimestamps for subspans.
4 participants