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

Add the ability to drop all datapoints except a specific one. #33074

Closed
ceastman-r7 opened this issue May 15, 2024 · 5 comments
Closed

Add the ability to drop all datapoints except a specific one. #33074

ceastman-r7 opened this issue May 15, 2024 · 5 comments

Comments

@ceastman-r7
Copy link

Component(s)

processor/metricstransform

Is your feature request related to a problem? Please describe.

I am trying to drop all datapoints except where destination_service_name == BlackHoleCluster

the label destination_service_name can have an infinite amount of values, I just need to only retain the datapoints where it equals BlackHoleCluster``

Describe the solution you'd like

from this example: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricstransformprocessor#delete-by-label-value

something like:

# deletes all data points with the label value 'idle' of the label 'state'
include: system.cpu.usage
action: update
operations:
  - action: delete_label_value
    label: destination_service_name
    label_not_value: BlackHoleCluster

Describe alternatives you've considered

No response

Additional context

No response

@ceastman-r7 ceastman-r7 added enhancement New feature or request needs triage New item requiring triage labels May 15, 2024
@github-actions github-actions bot added the processor/metricstransform Metrics Transform processor label May 15, 2024
Copy link
Contributor

Pinging code owners:

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

@strawgate
Copy link
Contributor

FYI I believe the metrics/logs/etc transform processors are being replaced with the OTTL-based "transform processor"

Have you considered trying the filterprocessor with the context set to datapoint?
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor

processors:
  filter/ottl:
    error_mode: ignore
    metrics:
      datapoint:
          - 'attributes["destination_service_name"] != "blackhole"'

@crobert-1 crobert-1 added processor/filter Filter processor waiting for author and removed enhancement New feature or request processor/metricstransform Metrics Transform processor needs triage New item requiring triage labels May 29, 2024
Copy link
Contributor

Pinging code owners for processor/filter: @TylerHelmuth @boostchicken. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@TylerHelmuth
Copy link
Member

@strawgate is correct. Closing this since an answer has been provided.

@ceastman-r7
Copy link
Author

Thank you, I will try that.

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

4 participants