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

Proposal: FieldConfig for Extract Labels from Name #1030

Open
kylebrandt opened this issue Jul 11, 2024 · 3 comments
Open

Proposal: FieldConfig for Extract Labels from Name #1030

kylebrandt opened this issue Jul 11, 2024 · 3 comments
Labels
area/dataplane Dataplane Project (Data type contract) dataframe enhancement New feature or request

Comments

@kylebrandt
Copy link
Contributor

kylebrandt commented Jul 11, 2024

What would you like to be added:
A property added to FieldConfig, that instructs consumers that they can/should extract dimensions (create labels) from the field name.

Why is this needed:
Some data is like this, in SSE (so it works with alerting and Recorded Queries), we have a hack that does this (somehow?) if the DS Type matches (Currently Graphite, but adding Dynatrace soon.

Adding this as a FieldConfig:

  • allows control of this behavior to belong to the data source which better understands the data
  • Allows DS authors to apply this only to certain responses (more fine grained)
  • Easier to debug since the frame will declare that the data can be treated this way

vNext could include an additional property that guides how to extract dimensions/labels, (e.g. { "delim": ".", "keys": ["metric", "namespace", "pod"] }.

  • (Maybe Frame Meta could work as well if want applied to all numeric fields perhaps, depends on how fine grained we want the control - frame wide or field specific)

Reference: grafana/grafana#90246 (comment)

cc @yuri-tceretian @yesoreyeram @ryantxu

@kylebrandt kylebrandt added enhancement New feature or request dataframe area/dataplane Dataplane Project (Data type contract) labels Jul 11, 2024
@kylebrandt kylebrandt changed the title Proposal: FieldConfig for Extra Labels from Name Proposal: FieldConfig for Extract Labels from Name Jul 11, 2024
@ryantxu
Copy link
Member

ryantxu commented Jul 11, 2024

I think this makes sense.

@yesoreyeram
Copy link
Contributor

I like the idea. But in practice, ds authors don't know the mapping of the fields. Also It will be tiresome for a customer to enter all the field mapping manually. for every metric this will be different even though they may be of same length.

@yesoreyeram
Copy link
Contributor

I appd we are doing something similar where we don't know the mapping but the delimiter. So the label goes like segment_1, segment_2.

https://github.com/grafana/plugins-private/blob/53be67e0d9e4bb3e9b3ec9e458d8d7e5763c68d8/plugins/dlopes7-appdynamics-datasource/pkg/appd/metrics/multi_framer.go#L105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dataplane Dataplane Project (Data type contract) dataframe enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants