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

Prefix service graph extra dimensions #2335

Merged
merged 10 commits into from
Jun 1, 2023

Conversation

domasx2
Copy link
Contributor

@domasx2 domasx2 commented Apr 13, 2023

What this PR does:
In the service graph processor, when adding custom dimensions to metrics, values can be overridden if parent and children span have the same attribute but with different values. The attributes of the last span to be processed are the ones selected for the metrics. This results in inconsistent behaviour, and does not match what otel collector service graph connector does.

One use case is to add service.namespace dimension, in case you want services to be identified by both name and namespace. You have to have a label for both client and server.

This PR prefixes values coming from client span with client_ and values coming from server span with server_.

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

Checklist

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

@CLAassistant
Copy link

CLAassistant commented Apr 13, 2023

CLA assistant check
All committers have signed the CLA.

@domasx2 domasx2 added this to the v2.1 milestone Apr 13, 2023
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.

This PR will impact cloud customers and cannot be merged until we understand and communicate that. It is a breaking change to metrics as well as a bump in metrics cardinality.

@Jxlam-pdx
Copy link

@cyrille-leclerc @gouthamve can you drive understanding and communicating the impact with teams involved? It's a breaking change and potentially have cost implication with Cardinality increase. Thanks!

@domasx2
Copy link
Contributor Author

domasx2 commented Apr 19, 2023

@joe-elliott thanks, that makes sense. Any thoughts on introducing this in a non breaking way? For example, adding syntax to be explicit about desired behaviour, like client:service.namespace to generate client_service_namespace taken only from client span. Or a config opt-in flag.

@domasx2
Copy link
Contributor Author

domasx2 commented Apr 19, 2023

@knylander-grafana
Copy link
Contributor

If this is a breaking change, how will this change impact how our customers use things? What will they need to change or update to correct for this breaking change?

@cyrille-leclerc
Copy link
Contributor

cyrille-leclerc commented Apr 20, 2023

@joe-elliott @Jxlam-pdx point taken. Sorry for the delay, @gouthamve is busy at KubeCon this week.
Our team will clarify the change, document it, and evaluate the impact on the cardinality.

@zalegrala
Copy link
Contributor

Have we started the review on current customers? Is there any update to that end?

@domasx2 domasx2 force-pushed the prefix-service-graph-extra-dimensions branch from 39ffefa to 263565a Compare May 16, 2023 08:07
@domasx2
Copy link
Contributor Author

domasx2 commented May 16, 2023

As per discussion in #1860, made this opt-in via enable_client_server_prefix configuration option

@domasx2 domasx2 requested a review from joe-elliott May 16, 2023 08:47
@ie-pham
Copy link
Contributor

ie-pham commented May 17, 2023

If we are intending on adding enable_client_server_prefix as a per tenant config, this needs to also be in the overrides section. You can follow what I did for enable_target_info in my PR 😅 but it would just be labeled

you should touch at least these files:
modules/generator/config.go
modules/generator/overrides.go
modules/generator/overrides_test.go
modules/overrides/limits.go
modules/overrides/overrides.go

@domasx2
Copy link
Contributor Author

domasx2 commented May 18, 2023

@ie-pham thanks! I did so, but now am completely stumped as to why CI is failing :( everything works locally and the error+ location in CI doesn't make any sense... Maybe you have a clue? 🙏

@ie-pham
Copy link
Contributor

ie-pham commented May 22, 2023

@ie-pham thanks! I did so, but now am completely stumped as to why CI is failing :( everything works locally and the error+ location in CI doesn't make any sense... Maybe you have a clue? 🙏

@domasx2
I think you need to rebase because someone had refactored that whole section and renamed a few things

  1. add an entry to this section https://github.com/grafana/tempo/blob/main/modules/overrides/interface.go#L54
  2. in overrides/overides.go change o *Overrides => o *overrides

@domasx2 domasx2 force-pushed the prefix-service-graph-extra-dimensions branch 2 times, most recently from f52f47b to ce3ce0d Compare May 23, 2023 07:36
@domasx2
Copy link
Contributor Author

domasx2 commented May 23, 2023

Thanks @ie-pham , resolved :)

@ie-pham
Copy link
Contributor

ie-pham commented May 23, 2023

This LGTM

@domasx2
Copy link
Contributor Author

domasx2 commented May 23, 2023

@joe-elliott can you take a look again? Feature is now opt-in, no longer a breaking change

@domasx2 domasx2 force-pushed the prefix-service-graph-extra-dimensions branch from ce3ce0d to 1ae49dc Compare May 31, 2023 06:56
@domasx2
Copy link
Contributor Author

domasx2 commented May 31, 2023

hold on with merging this for a bit, still some ongoing discussions on app o11y side

@domasx2 domasx2 force-pushed the prefix-service-graph-extra-dimensions branch from 1ae49dc to 8d5a7b4 Compare June 1, 2023 13:27
@domasx2
Copy link
Contributor Author

domasx2 commented Jun 1, 2023

good to merge 👍

@ie-pham ie-pham merged commit 767115d into grafana:main Jun 1, 2023
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.

[Service graph] Add prefix to differentiate client and server attributes
8 participants