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

[metricstransform] Add resource attribute to label support #2568

Closed
seanhoughton opened this issue Mar 6, 2021 · 8 comments
Closed

[metricstransform] Add resource attribute to label support #2568

seanhoughton opened this issue Mar 6, 2021 · 8 comments

Comments

@seanhoughton
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Resource attributes are not applied as labels to metrics (at least not for the prometheus or stackdriver exporters). Examples include node name, username, pod name, k8s namespace, and other common resource attributes which users may wish to differentiate in metrics analysis tools.

Describe the solution you'd like

I would like to be able to use the value of a resource attribute as the source value of an add_label action.

Describe alternatives you've considered

The only alternative I can think of is to alter the instrumentation in the application and explicitly add the label values to each usage of the metrics instruments. This is slow and intrusive. Being able to quickly manage cardinality in the collector without changing the instrumented application is a very valuable feature.

Additional context

I think this is related to another feature request in the opentelemetry-collector project but the prototype solution there is more liberal copy of all resource attributes and only applies to the prometheus exporter open-telemetry/opentelemetry-collector#2412 .

kisieland referenced this issue in kisieland/opentelemetry-collector-contrib Mar 16, 2021
* Bump github.com/jaegertracing/jaeger from 1.21.0 to 1.22.0

Bumps [github.com/jaegertracing/jaeger](https://github.com/jaegertracing/jaeger) from 1.21.0 to 1.22.0.
- [Release notes](https://github.com/jaegertracing/jaeger/releases)
- [Changelog](https://github.com/jaegertracing/jaeger/blob/master/CHANGELOG.md)
- [Commits](jaegertracing/jaeger@v1.21.0...v1.22.0)

Signed-off-by: dependabot[bot] <[email protected]>

* make gotidy

Signed-off-by: Bogdan Drutu <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bogdan Drutu <[email protected]>
@pmalek-sumo
Copy link
Contributor

I'd love to see this type of feature as well.

Some of the features of metricstransformprocessor can be achieved with resourceprocessor (granted the attributes are at resource level like described in this issue) but without the metric name matching capability (unless it's there but I wasn't able to find it) which might produce unwanted effects (amending metrics that were not supposed to be changed):

processors:
  resource:
    attributes:
    - key: X-Host
      from_attribute: host
      action: insert

resource_to_telemetry_conversion (as stated here: #2630 (comment)) doesn't really solve this problem because it's an exporterhelper not a processorhelper so it doesn't allow further data manipulation of said data which is just about to be exported not processed by further processors in the pipeline.

If #2630 got rejected because it "can be already done with resource_to_telemetry_conversion", perhaps we should propose a similar helper for the processors?

@alolita alolita added the processor/metricstransform Metrics Transform processor label Sep 30, 2021
ljmsc referenced this issue in ljmsc/opentelemetry-collector-contrib Feb 21, 2022
…otlptrace (#2568)

* Bump google.golang.org/grpc in /exporters/otlp/otlptrace

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.44.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.43.0...v1.44.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Auto-fix go.sum changes in dependent modules

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: MrAlias <[email protected]>
@singku
Copy link
Contributor

singku commented Jul 25, 2022

@dmitryax Any chance we can review this issue and related PR again?

@dmitryax
Copy link
Member

@singku, this processor will be eventually replaced by transform processor. So we would like to avoid any new features to metricstransform processor. Please take a look at transform processor to see if it already does what you want.

@ItsLastDay
Copy link
Contributor

@dmitryax Does that mean that if I want some feature (for example, this particular issue "resource attribute to label support") to be implemented in metricstransform processor, I'll need to propose that feature to transform processor instead? In other words, is it true that I'll commit the same code, but into another folder? :)

@dmitryax
Copy link
Member

dmitryax commented Aug 2, 2022

Does that mean that if I want some feature (for example, this particular issue "resource attribute to label support") to be implemented in metricstransform processor, I'll need to propose that feature to transform processor instead?

Yes, correct.

In other words, is it true that I'll commit the same code, but into another folder? :)

It's not the same code. They are completely different codebases providing similar functionality using different configuration approaches.

@singku
Copy link
Contributor

singku commented Aug 25, 2022

Transformprocess support operation like:

 set(attributes["the name the new attribute"], resource.attributes["the name of the resource attribute you want to copy"]). 

I believe this meet our needs.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Nov 10, 2022
@github-actions
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2023
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

6 participants