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

keep_matching_keys function not working with metric context #35956

Closed
Shindek77 opened this issue Oct 23, 2024 · 4 comments
Closed

keep_matching_keys function not working with metric context #35956

Shindek77 opened this issue Oct 23, 2024 · 4 comments
Labels

Comments

@Shindek77
Copy link

Component(s)

No response

Describe the issue you're reporting

Hello Community,
is keep_matching_keys ottl function doest not work for metric context as i am using it but it is not working properly. Gives error on otel as processors::transform/test: unable to parse OTTL statement "keep_matching_keys(attributes,"^(url|http|service|cloud|event).")": undefined function "keep_matching_keys" . Please help me on this

transform/test:
  metric_statements:
  - context: metric
    statements:
    - keep_matching_keys(attributes, "^(url|http|service|cloud|event).")
    - keep_matching_keys(resource.attributes, "^(url|http|service|cloud|event).*").
@Shindek77 Shindek77 added the needs triage New item requiring triage label Oct 23, 2024
@evan-bradley evan-bradley added pkg/ottl processor/transform Transform processor and removed needs triage New item requiring triage labels Oct 23, 2024
Copy link
Contributor

Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself.

Copy link
Contributor

Pinging code owners for processor/transform: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@evan-bradley
Copy link
Contributor

Hi @Shindek77, which version of the Collector are you using?

@TylerHelmuth
Copy link
Member

context: metric uses ottlmetric which doesnt provide access to attributes since metrics do not have attributes, their datapoints do.

Likely you want to use context: datapoint.

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

No branches or pull requests

3 participants