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

Implement support for dynamic tags #14

Closed
petethepig opened this issue Feb 7, 2022 · 2 comments
Closed

Implement support for dynamic tags #14

petethepig opened this issue Feb 7, 2022 · 2 comments

Comments

@petethepig
Copy link
Member

petethepig commented Feb 7, 2022

Other integrations have ways to set tags dynamically from the profiled application.

We'd love to be able to support dynamic tags in java for two main use cases:

Use case 1: Supporting Dynamic tags for user-defined scopes

Often users want to tag a region, namespace, pod, container, machine, etc and dynamic tags would allow them to do this.
e.g here's how it's done in go: https://github.com/pyroscope-io/pyroscope/blob/main/examples/golang-push/rideshare/utility/utility.go#L46-L57

And we then support using these tags to compare and calculate diffs between profiles. I.e. here we are showing the diff between the region tags:

  • ride-sharing-app.cpu{region="us-west-1"}
  • ride-sharing-app.cpu{region="eu-west-1"}

Comparing two tags

Screen Shot 2022-04-06 at 5 40 17 PM

Diff between two tags

See here for interactive example
image

Use case 2: Supporting profile_id tag for profiling exemplars

We recently created a otelpyroscope package which is meant to link trace spans from a distributed tracing system (i.e. jaeger) to profiles

How this works is:

  • when a span is created, we begin profiling in that thread and tag that profile with a corresponding profile_id
  • the pyroscope agent then sends that profile to the server where it is stored in an exemplar-specific db (separate from other profiling data)
  • If the profile_id tag value is stored in metadata people can then retrieve this via tracing UI's

i.e. in this image you can embed a profile for this particular span, because it was conveniently tagged as
pyroscope.profile.id = 840f2c4bd6e4a2c4

image

Reference:
OTEL issue about standardizing profile formats: open-telemetry/oteps#139
Async-profiler PR attempting to add (a type) of tag: async-profiler/async-profiler#576

@netamego
Copy link

netamego commented Jun 15, 2022

Hi!!

Could be posible yo use labels/tags and app aggregation without modofing the source code of my app. I don't know if is feadible but would be great we could define tags/labels with an exported variable.

Thanks.

@Rperry2174
Copy link

Hi @netamego I'm going to go ahead and close this issue since this one is complete.

If you dont mind could you create a separate issue around using labels/tags in the way that you'd like (with an example of the use case)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants