Skip to content

Redaction with blocked_key_patterns doesnt work as expected #42659

@vinzee

Description

@vinzee

Component(s)

processor/redaction

What happened?

Description

I am trying to redact metric attributes in otelcol using the redaction processor. but it did not work as expected.

Steps to Reproduce

# Config 1: multiple explicit regexes
redaction:
  allow_all_keys: true
  blocked_key_patterns:
    - .*password.*
    - .*token.*
# Config 2: single alternation regex
redaction:
  allow_all_keys: true
  blocked_key_patterns:
    - .*(password|token).*

Ingested metrics with attributes:

host: my_host
my_password: exposed
token: abc

Expected Result

host: my_host
my_password: ****
token: ****

Actual Result

host: my_host
my_password: exposed
token: abc

Collector version

0.135.0

Environment information

Environment

OS: 20.04.1-Ubuntu

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
      http:

processors:
  redaction:
    blocked_key_patterns:
      - .*(password|token).*

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [redaction]
      exporters: [debug]

Log output

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions