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

[compressed spans] Adapt span metrics calculation #5595

Closed
simitt opened this issue Jul 1, 2021 · 2 comments · Fixed by #5896
Closed

[compressed spans] Adapt span metrics calculation #5595

simitt opened this issue Jul 1, 2021 · 2 comments · Fixed by #5896
Assignees
Milestone

Comments

@simitt
Copy link
Contributor

simitt commented Jul 1, 2021

To make the compressed feature (elastic/apm#432) work we need to extend the intake API (#5485) and adapt the calculation of span metrics.

Adapt span metrics calculation

Since this feature is folding a set of spans into one single we need to adapt the calculation of span metrics so that the resulting metric values are still correct.

@axw
Copy link
Member

axw commented Jul 12, 2021

I think this is a simple matter of updating model.Span.RepresentativeCount when decoding "span.composite":

apm-server/model/span.go

Lines 80 to 85 in 06bea7c

// RepresentativeCount holds the approximate number of spans that
// this span represents for aggregation. This will only be set when
// the sampling rate is known.
//
// This may be used for scaling metrics; it is not indexed.
RepresentativeCount float64

i.e. if we set that to 1/sample_rate * composite.count, then the existing span metrics aggregator should do the right thing, IIANM

@axw
Copy link
Member

axw commented Aug 26, 2021

The PR #5896 is on the test plan, removing this as a duplicate

@axw axw removed the test-plan label Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants