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

[processor/attributes] log_severity_texts does not filter #11439

Closed
amoscatelli opened this issue Jun 22, 2022 · 2 comments · Fixed by #12198
Closed

[processor/attributes] log_severity_texts does not filter #11439

amoscatelli opened this issue Jun 22, 2022 · 2 comments · Fixed by #12198
Labels
bug Something isn't working priority:p2 Medium processor/attributes Attributes processor

Comments

@amoscatelli
Copy link

Describe the bug
log_severity_texts filter simply doesn't work
tried the example here and doesn't work either :
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/attributesprocessor/testdata/config.yaml

For example :

    attributes:
        include:
            match_type: strict
            log_severity_texts: [ "TRACE" ]
        actions:
            -   key: should_exclude
                action: upsert
                value: true

should_exclude is added to every log instead of traces only.

Steps to reproduce
Use log_severity_texts to filter the attribute processor.

What did you expect to see?
Attribute processor to be filtered.

What did you see instead?
Attribute processor to be applied always.

What version did you use?
otel/opentelemetry-collector-contrib:0.53.0

What config did you use?

receivers:
  otlp:
    protocols:
      http:
        cors:
          allowed_origins: [
            #OMITTED
          ]

processors:
    memory_limiter:
        check_interval: 5s
        limit_mib: 448
        spike_limit_mib: 64
    batch:
        send_batch_size: 48
        send_batch_max_size: 48
        timeout: 15s
    attributes:
        include:
            match_type: strict
            log_severity_texts: [ "TRACE" ]
        actions:
            -   key: should_exclude
                action: upsert
                value: true
    filter:
        logs:
            exclude:
                match_type: strict
                record_attributes:
                    - key: should_exclude
                      value: true

exporters:
    logging:
        loglevel: debug
        sampling_initial: 2
    otlp:
        endpoint: tempo-eu-west-0.grafana.net:443
        headers:
            authorization: Basic #OMITTED
            
    prometheusremotewrite:
        endpoint: https://prometheus-prod-01-eu-west-0.grafana.net/api/prom/push
        headers:
            authorization: Basic #OMITTED
            
    loki:
        endpoint: https://logs-prod-eu-west-0.grafana.net/loki/api/v1/push
        headers:
            authorization: Basic #OMITTED
        format: json
        labels:
            attributes:
                container_name: ""
                source: ""
            resource:
                host.name: "hostname"

extensions:
    health_check:

service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [otlp]
    metrics:
      receivers: [otlp]
      processors: [memory_limiter, batch]
      exporters: [prometheusremotewrite]
    logs:
      receivers: [otlp]
      processors: [attributes, filter]
      exporters: [logging]
@amoscatelli amoscatelli added the bug Something isn't working label Jun 22, 2022
@dmitryax
Copy link
Member

Hey @zeitlinger, I see you added the logs support to the attributes processor. Do you have a chance to take a look at the issue?

@zeitlinger
Copy link
Member

@dmitryax found the issue and submitted a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Medium processor/attributes Attributes processor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants