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

[DOC] Update metrics query doc with more examples #4128

Conversation

knylander-grafana
Copy link
Contributor

@knylander-grafana knylander-grafana commented Sep 26, 2024

What this PR does:

This doc has a first draft of a use case for using TraceQL metrics queries to investigate an issue. The example provides equivalent PromQL and TraceQL queries.

Updates the TraceQL metrics documentation to add:

  • Create a separate functions page with the functions moved off of the main metrics page
  • Maintain a list of the functions on the main TraceQL metrics page
  • Add a section that describes how RED metrics can be generated in TraceQL metrics vs span metrics from the metrics generator
  • Add examples for PromQL vs TraceQL equivalent queries - how do you contruct a TraceQL query that is equivalent of a PromQL query

Which issue(s) this PR fixes:
Fixes https://github.com/grafana/tempo-squad/issues/413

Checklist

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

@knylander-grafana knylander-grafana added type/docs Improvements or additions to documentation traceql labels Sep 26, 2024
@knylander-grafana knylander-grafana self-assigned this Sep 26, 2024
Copy link
Contributor

@javiermolinar javiermolinar left a comment

Choose a reason for hiding this comment

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

LGTM some nits

docs/sources/tempo/traceql/metrics-queries.md Outdated Show resolved Hide resolved
docs/sources/tempo/traceql/metrics-queries.md Outdated Show resolved Hide resolved
docs/sources/tempo/traceql/metrics-queries.md Show resolved Hide resolved
docs/sources/tempo/traceql/metrics-queries.md Show resolved Hide resolved
@knylander-grafana
Copy link
Contributor Author

LGTM some nits

Thank you for looking at this. You've asked some good questions. I'll work with Heds to get those answers resolved. We're also expanding the doc quite a bit by adding examples for how to create the TraceQL equivalent of PromQL queries too.

@knylander-grafana
Copy link
Contributor Author

@joe-elliott This is the PR where we're expanding TraceQL metrics example queries with TraceQL and PromQL.


For more information on how to use TraceQL metrics to investigate issues, refer to [Solve problems with metrics queries](./solve-problems-metrics-queries).

## Exemplars
Copy link
Member

Choose a reason for hiding this comment

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

are traceql exemplars supported by grafana yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heds and I tried this, and they didn't appear to be. @hedss may be able to give a better answer.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not supported yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we keep this doc update for the Tempo 2.7 release, then there might be enough time for the Grafana support to be in place.

docs/sources/tempo/traceql/metrics-queries/functions.md Outdated Show resolved Hide resolved
docs/sources/tempo/traceql/metrics-queries/functions.md Outdated Show resolved Hide resolved
@knylander-grafana
Copy link
Contributor Author

@joe-elliott Thank you so much for looking at this. @hedss had one major question about this doc: Do you think that the content provides value or should we take the doc in a different direction?

You can use these metrics to get an overview of application performance.
The metrics can be directly correlated to the trace spans that are available for querying.

TraceQL metrics provide functionality that lets you make a variety of requests directly to Tempo instead of requiring the metrics-generator component.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
TraceQL metrics provide functionality that lets you make a variety of requests directly to Tempo instead of requiring the metrics-generator component.
TraceQL metrics allow a user to query metrics from traces directly from Tempo instead of requiring the metrics-generator component.

TraceQL metrics provide functionality that lets you make a variety of requests directly to Tempo instead of requiring the metrics-generator component.

{{< admonition type="note" >}}
TraceQL metrics are constrained to a 24-hour range window, and aren't available as a Grafana Managed Alerts source. For any metrics that require a longer time range, be used as the basis for Alerts or that are required for more than 30 days retention, use the metrics-generator to store these metrics in Mimir and continue to use PromQL for querying.
Copy link
Member

Choose a reason for hiding this comment

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

default may be 24, but this is configuable

Copy link
Contributor

@09jvilla 09jvilla left a comment

Choose a reason for hiding this comment

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

Left many suggestions. Feel free to only keep the useful ones =)

Co-authored-by: Jennifer Villa <[email protected]>
Co-authored-by: Joe Elliott <[email protected]>
@knylander-grafana
Copy link
Contributor Author

Updated the metrics queries configuration per #4200

@knylander-grafana
Copy link
Contributor Author

Okay, having all kinds of weird issues trying to resolve the conflicts.

Zach recreated the PR here: #4248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
traceql type/docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants