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

Metrics generator: make status_message a default dimension #1794

Merged
merged 5 commits into from
Oct 13, 2022

Conversation

stoewer
Copy link
Contributor

@stoewer stoewer commented Oct 12, 2022

What this PR does:

  • The metric label status_message is now generated by default, it is no longer required to add the corresponding dimension to the user defined dimensions. PR Metrics generator: extract status_message field from spans #1786 addressed the same problem of making the status message available as a metric label. However, adding status_message as a default dimension is more consistent with the closely related default dimension status_code.
  • When user defined dimensions corresponds to the same label as one of the default dimensions (e.g. status.code) the label for the user defined dimension is prefixed with double underscore. So far the value of the default dimension was overwritten by the value of the attribute that corresponds with the user defined dimension.

Which issue(s) this PR fixes:
Fixes #1764

Checklist

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

The metric label status_message is generated by default, it is no
longer required to add the corresponding dimension to the user defined
dimensions
When user defined dimensions correspond to the same label as one
of the intrinsic dimensions (e.g. status.code) the label for the
user defined dimension is prefixed with double underscore
@stoewer stoewer marked this pull request as ready for review October 12, 2022 06:01
Copy link
Contributor

@zalegrala zalegrala left a comment

Choose a reason for hiding this comment

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

Nice work, this looks good to me. I'll leave to give some teammates a chance to review who might be more familiar with the specifics of the labels.

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

some minor questions/suggestions. looks good!

can we add some details in the span metrics docs about the list of "special" attributes and how we handle collisions?

something in here:
https://github.com/grafana/tempo/tree/main/docs/tempo/website/metrics-generator

Copy link
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.

Doc update looks good. Thank you for adding the info.

@stoewer stoewer force-pushed the status-message-metric-label branch from 846f02a to e951758 Compare October 13, 2022 01:04
@stoewer
Copy link
Contributor Author

stoewer commented Oct 13, 2022

can we add some details in the span metrics docs about the list of "special" attributes and how we handle collisions?

Good point, I added a paragraph about default labels and collisions with dimensions to the metrics generator docs (span_metrics.md). @knylander-grafana maybe you also want to have a look at it?

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

Looks good! Going to leave for a second in case @knylander-grafana has thoughts on the docs changes.

@joe-elliott joe-elliott merged commit 56c5210 into grafana:main Oct 13, 2022
@stoewer stoewer deleted the status-message-metric-label branch October 13, 2022 21:58
stoewer added a commit to stoewer/tempo that referenced this pull request Dec 19, 2022
stoewer added a commit to stoewer/tempo that referenced this pull request Dec 19, 2022
mapno pushed a commit that referenced this pull request Dec 21, 2022
…default (#1960)

* Add intrinsic dimenstions to spanmetrics config

* Remove deprecated linters from glangci-lint config

The linters deadcode, structcheck, and varcheck are deprecated since
golangci-lint v1.49.0. They are replace by unused which is already enabled
in our config

* Make intrinsic dimensions configurable for spanmetrics

* Disable intrinsic dimension status_message by default

* Add overrides for intrinsic dimension configuration

* Docs for the configuration of intrinsic dimensions

* Add PR to changelog

* Regenerate configuration schema in manifest.md

* Handle dimensions as conflicts when intrinsic dimension is absent

Custom dimensions from span attributs are also treated as conflicts
when the conflicting intrinsic dimension is not actually present. This
prevents those dimensions from being renamed when the intrinsic dimension
configuration changes

* Mark change #1794 as breaking in changelog

* Unit test for intrinsic dimension override

* Fail on invalid intrinsic dimension override keys

* Fix dimension prefix in changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to access status_message standard field from span_metrics
4 participants