Skip to content

feat: TraceQL metrics: average over time#4073

Merged
javiermolinar merged 31 commits intografana:mainfrom
javiermolinar:avg-over-time
Oct 31, 2024
Merged

feat: TraceQL metrics: average over time#4073
javiermolinar merged 31 commits intografana:mainfrom
javiermolinar:avg-over-time

Conversation

@javiermolinar
Copy link
Copy Markdown
Contributor

@javiermolinar javiermolinar commented Sep 12, 2024

What this PR does:
It implements the avg_over_time aggregation function

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Comment thread pkg/traceql/engine_metrics.go Outdated
Comment thread pkg/traceql/engine_metrics.go Outdated
Comment thread pkg/traceql/engine_metrics.go Outdated
@mdisibio
Copy link
Copy Markdown
Contributor

Not sure if I'm reading this right, but it looks like it's computing the average at each level. I was expecting raw mode to return series of sums/counts up the frontend, and then it computes the final average. Without that, it seems to be computing average of averages inside generators and queriers. We can discuss more details like the algorithm, but let's clear the overall approach first.

@javiermolinar javiermolinar marked this pull request as draft September 17, 2024 09:13
@javiermolinar javiermolinar marked this pull request as ready for review October 17, 2024 15:27
Comment thread pkg/traceql/engine_metrics_average.go
Comment thread pkg/traceql/engine_metrics_average.go Outdated
Comment thread docs/sources/tempo/traceql/metrics-queries.md Outdated
Comment thread docs/sources/tempo/traceql/metrics-queries.md Outdated
Copy link
Copy Markdown
Contributor

@knylander-grafana knylander-grafana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding doc! Approving the doc, with two minor suggestions. Please be aware that this PR updates the metrics queries doc: #4128

Copy link
Copy Markdown
Contributor

@mdisibio mdisibio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the last round of changes. This is looking great.

@knylander-grafana knylander-grafana added the type/docs Improvements or additions to documentation label Oct 31, 2024
Copy link
Copy Markdown
Contributor

@knylander-grafana knylander-grafana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the doc changes. Thank you for updating!

Comment thread docs/sources/tempo/traceql/metrics-queries/functions.md Outdated
Comment thread docs/sources/tempo/traceql/metrics-queries/functions.md Outdated
Comment thread docs/sources/tempo/traceql/metrics-queries/functions.md Outdated
Comment thread docs/sources/tempo/traceql/metrics-queries/functions.md Outdated
Comment thread docs/sources/tempo/traceql/metrics-queries/_index.md Outdated
javiermolinar and others added 5 commits October 31, 2024 17:09
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
@javiermolinar javiermolinar merged commit 61fa0a5 into grafana:main Oct 31, 2024
@javiermolinar javiermolinar deleted the avg-over-time branch October 31, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants