Skip to content

[DOC] Add doc for TraceQL metrics math - #7190

Merged
knylander-grafana merged 2 commits into
grafana:mainfrom
knylander-grafana:6866-docs-traceql-math
Jun 1, 2026
Merged

[DOC] Add doc for TraceQL metrics math#7190
knylander-grafana merged 2 commits into
grafana:mainfrom
knylander-grafana:6866-docs-traceql-math

Conversation

@knylander-grafana

Copy link
Copy Markdown
Contributor

What this PR does:

Updates the functions.md and metrics-queries/_index.md with information about TraceQL metrics artithematic (introduced in #6866 ).

Which issue(s) this PR fixes:
Fixes #

Checklist

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Documentation-only PR adding user-facing documentation for the TraceQL metrics arithmetic feature introduced in #6866. Updates the metrics functions reference with a new "Arithmetic expressions" section (syntax, operators, examples, group-by behavior, post-expression operations, NaN handling, and limitations), and adds a short intro paragraph in the metrics-queries index pointing at the new functionality.

Changes:

  • Add a new "Arithmetic expressions" section to functions.md describing supported operators, examples, group-by, post-expression operations, and limitations.
  • Add a row for arithmetic expressions in the post-pipeline functions table.
  • Add a short blurb in _index.md introducing the feature with an example.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/sources/tempo/metrics-from-traces/metrics-queries/functions.md New "Arithmetic expressions" section and a row in the post-pipeline functions table.
docs/sources/tempo/metrics-from-traces/metrics-queries/_index.md Adds a brief paragraph and example introducing arithmetic between metrics queries.
Comment thread docs/sources/tempo/metrics-from-traces/metrics-queries/functions.md Outdated
Comment thread docs/sources/tempo/metrics-from-traces/metrics-queries/functions.md Outdated
### Limitations

- Each sub-query must be enclosed in parentheses. Bare expressions like `{} | rate() + {} | rate()` aren't valid.
- Scalar operands aren't supported. Expressions like `1000 * ({} | rate())` aren't valid.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will be supported in #7199 ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah! Will TraceQL math be backported to 3.0 or are we going to save it for a 3.1 release?

If backported to 3.0, then I'll do a separate PR for the doc for 7199 then just in case these should be shipped or be available separately.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, I don't think it will be backported

@knylander-grafana
knylander-grafana merged commit 58cf61d into grafana:main Jun 1, 2026
29 checks passed
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

3 participants