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/redaction] Initial implementation #6495

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
This CODEOWNERS file contains errors

CODEOWNERS errors

  • Unknown owner on line 19: make sure @qiansheng91 exists and has write access to the repository
    …vers @shabicheng @kongluoxing @qiansheng91
  • Unknown owner on line 19: make sure @kongluoxing exists and has write access to the repository
    …contrib-approvers @shabicheng @kongluoxing @qiansheng91
  • Unknown owner on line 19: make sure @shabicheng exists and has write access to the repository
    …y/collector-contrib-approvers @shabicheng @kongluoxing @qiansheng91
  • Unknown owner on line 20: make sure @boostchicken exists and has write access to the repository
    …y/collector-contrib-approvers @boostchicken
  • Unknown owner on line 21: make sure @shaochengwang exists and has write access to the repository
    …r-contrib-approvers @anuraaga @shaochengwang @mxiamxia
  • Unknown owner on line 21: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga @shaochengwang @mxiamxia
  • Unknown owner on line 21: make sure @mxiamxia exists and has write access to the repository
    …vers @anuraaga @shaochengwang @mxiamxia
  • Unknown owner on line 22: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga @MovieStoreGuy
  • Unknown owner on line 23: make sure @Aneurysm9 exists and has write access to the repository
    …r-contrib-approvers @anuraaga @Aneurysm9 @alolita
  • Unknown owner on line 23: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga @Aneurysm9 @alolita
  • Unknown owner on line 24: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga
  • Unknown owner on line 25: make sure @pcwiese exists and has write access to the repository
    …y/collector-contrib-approvers @pcwiese
  • Unknown owner on line 26: make sure @pjanotti exists and has write access to the repository
    …y/collector-contrib-approvers @pjanotti
  • Unknown owner on line 27: make sure @hanjm exists and has write access to the repository
    …y/collector-contrib-approvers @hanjm @dmitryax
  • Unknown owner on line 28: make sure @ofirshmuel exists and has write access to the repository
    …or-contrib-approvers @oded-dd @ofirshmuel
  • Unknown owner on line 28: make sure @oded-dd exists and has write access to the repository
    …y/collector-contrib-approvers @oded-dd @ofirshmuel
  • Unknown owner on line 29: make sure @knusbaum exists and has write access to the repository
    …vers @KSerrania @mx-psi @gbbr @knusbaum
  • Unknown owner on line 29: make sure @gbbr exists and has write access to the repository
    …-approvers @KSerrania @mx-psi @gbbr @knusbaum
  • Unknown owner on line 29: make sure @KSerrania exists and has write access to the repository
    …y/collector-contrib-approvers @KSerrania @mx-psi @gbbr @knusbaum
  • Unknown owner on line 30: make sure @dyladan exists and has write access to the repository
    …y/collector-contrib-approvers @dyladan @arminru
  • Unknown owner on line 31: make sure @axw exists and has write access to the repository
    …y/collector-contrib-approvers @axw @simitt @jalvz
  • Unknown owner on line 31: make sure @simitt exists and has write access to the repository
    …lector-contrib-approvers @axw @simitt @jalvz
  • Unknown owner on line 31: make sure @jalvz exists and has write access to the repository
    …ontrib-approvers @axw @simitt @jalvz
  • Unknown owner on line 32: make sure @urso exists and has write access to the repository
    …y/collector-contrib-approvers @urso @faec @blakerouse
  • Unknown owner on line 32: make sure @faec exists and has write access to the repository
    …ector-contrib-approvers @urso @faec @blakerouse
  • Unknown owner on line 32: make sure @blakerouse exists and has write access to the repository
    …contrib-approvers @urso @faec @blakerouse
  • Unknown owner on line 33: make sure @gramidt exists and has write access to the repository
    …y/collector-contrib-approvers @gramidt
  • Unknown owner on line 34: make sure @pmm-sumo exists and has write access to the repository
    …y/collector-contrib-approvers @pmm-sumo
  • Unknown owner on line 35: make sure @punya exists and has write access to the repository
    … @aabmass @dashpole @jsuereth @punya @tbarker25
  • Unknown owner on line 35: make sure @aabmass exists and has write access to the repository
    …y/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @tbarker25
  • Unknown owner on line 35: make sure @tbarker25 exists and has write access to the repository
    …ss @dashpole @jsuereth @punya @tbarker25
  • Unknown owner on line 36: make sure @alexvanboxel exists and has write access to the repository
    …y/collector-contrib-approvers @alexvanboxel
  • Unknown owner on line 37: make sure @paulosman exists and has write access to the repository
    …y/collector-contrib-approvers @paulosman @lizthegrey @MikeGoldsmith
  • Unknown owner on line 37: make sure @lizthegrey exists and has write access to the repository
    …-contrib-approvers @paulosman @lizthegrey @MikeGoldsmith
  • Unknown owner on line 37: make sure @MikeGoldsmith exists and has write access to the repository
    …rovers @paulosman @lizthegrey @MikeGoldsmith
  • Unknown owner on line 38: make sure @xitric exists and has write access to the repository
    …y/collector-contrib-approvers @xitric
  • Unknown owner on line 39: make sure @jacobmarble exists and has write access to the repository
    …y/collector-contrib-approvers @jacobmarble
  • Unknown owner on line 41: make sure @pavolloffay exists and has write access to the repository
    …contrib-approvers @jpkrohling @pavolloffay
  • Unknown owner on line 42: make sure @pavolloffay exists and has write access to the repository
    …y/collector-contrib-approvers @pavolloffay @MovieStoreGuy
  • Unknown owner on line 44: make sure @jkowall exists and has write access to the repository
    …y/collector-contrib-approvers @jkowall @Doron-Bargo @yotamloe
  • Unknown owner on line 44: make sure @Doron-Bargo exists and has write access to the repository
    …or-contrib-approvers @jkowall @Doron-Bargo @yotamloe
  • Unknown owner on line 44: make sure @yotamloe exists and has write access to the repository
    …provers @jkowall @Doron-Bargo @yotamloe
  • Unknown owner on line 45: make sure @gramidt exists and has write access to the repository
    …y/collector-contrib-approvers @gramidt @jpkrohling
  • Unknown owner on line 46: make sure @nrcventura exists and has write access to the repository
    …pprovers @alanwest @jack-berg @nrcventura
  • Unknown owner on line 46: make sure @alanwest exists and has write access to the repository
    …y/collector-contrib-approvers @alanwest @jack-berg @nrcventura
  • Unknown owner on line 47: make sure @binaryfissiongames exists and has write access to the repository
    …y/collector-contrib-approvers @binaryfissiongames
  • Unknown owner on line 48: make sure @Aneurysm9 exists and has write access to the repository
    …y/collector-contrib-approvers @Aneurysm9
  • Unknown owner on line 49: make sure @Aneurysm9 exists and has write access to the repository
    …y/collector-contrib-approvers @Aneurysm9
  • Unknown owner on line 50: make sure @owais exists and has write access to the repository
    …y/collector-contrib-approvers @owais @dmitryax
  • Unknown owner on line 51: make sure @AbhiPrasad exists and has write access to the repository
    …y/collector-contrib-approvers @AbhiPrasad
  • Unknown owner on line 52: make sure @pmcollins exists and has write access to the repository
    …y/collector-contrib-approvers @pmcollins @dmitryax
  • Unknown owner on line 53: make sure @liqiangz exists and has write access to the repository
    …y/collector-contrib-approvers @liqiangz
  • Unknown owner on line 55: make sure @aabmass exists and has write access to the repository
    …y/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @tbarker25
  • Unknown owner on line 55: make sure @punya exists and has write access to the repository
    … @aabmass @dashpole @jsuereth @punya @tbarker25
  • Unknown owner on line 55: make sure @tbarker25 exists and has write access to the repository
    …ss @dashpole @jsuereth @punya @tbarker25
  • Unknown owner on line 56: make sure @sumo-drosiek exists and has write access to the repository
    …r-contrib-approvers @pmm-sumo @sumo-drosiek
  • Unknown owner on line 56: make sure @pmm-sumo exists and has write access to the repository
    …y/collector-contrib-approvers @pmm-sumo @sumo-drosiek
  • Unknown owner on line 57: make sure @oppegard exists and has write access to the repository
    …y/collector-contrib-approvers @oppegard @thepeterstone @keep94
  • Unknown owner on line 57: make sure @thepeterstone exists and has write access to the repository
    …r-contrib-approvers @oppegard @thepeterstone @keep94
  • Unknown owner on line 57: make sure @keep94 exists and has write access to the repository
    …vers @oppegard @thepeterstone @keep94
  • Unknown owner on line 58: make sure @wgliang exists and has write access to the repository
    …y/collector-contrib-approvers @wgliang @yiyang5055
  • Unknown owner on line 58: make sure @yiyang5055 exists and has write access to the repository
    …or-contrib-approvers @wgliang @yiyang5055
  • Unknown owner on line 59: make sure @pmm-sumo exists and has write access to the repository
    …y/collector-contrib-approvers @pmm-sumo
  • Unknown owner on line 61: make sure @jamesmoessis exists and has write access to the repository
    …y/collector-contrib-approvers @jamesmoessis @MovieStoreGuy
  • Unknown owner on line 62: make sure @Aneurysm9 exists and has write access to the repository
    …r-contrib-approvers @anuraaga @Aneurysm9 @mxiamxia
  • Unknown owner on line 62: make sure @mxiamxia exists and has write access to the repository
    …pprovers @anuraaga @Aneurysm9 @mxiamxia
  • Unknown owner on line 62: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga @Aneurysm9 @mxiamxia
  • Unknown owner on line 63: make sure @svrakitin exists and has write access to the repository
    …contrib-approvers @jpkrohling @svrakitin
  • Unknown owner on line 64: make sure @pavankrish123 exists and has write access to the repository
    …contrib-approvers @jpkrohling @pavankrish123
  • Unknown owner on line 67: make sure @pavankrish123 exists and has write access to the repository
    …y/collector-contrib-approvers @pavankrish123 @jpkrohling
  • Unknown owner on line 68: make sure @rmfitzpatrick exists and has write access to the repository
    …r-contrib-approvers @dmitryax @rmfitzpatrick
  • Unknown owner on line 70: make sure @rmfitzpatrick exists and has write access to the repository
    …y/collector-contrib-approvers @rmfitzpatrick
  • Unknown owner on line 72: make sure @rmfitzpatrick exists and has write access to the repository
    …y/collector-contrib-approvers @rmfitzpatrick @dmitryax
  • Unknown owner on line 74: make sure @erichsueh3 exists and has write access to the repository
    …pprovers @Aneurysm9 @anuraaga @erichsueh3
  • Unknown owner on line 74: make sure @anuraaga exists and has write access to the repository
    …-contrib-approvers @Aneurysm9 @anuraaga @erichsueh3
  • Unknown owner on line 74: make sure @Aneurysm9 exists and has write access to the repository
    …y/collector-contrib-approvers @Aneurysm9 @anuraaga @erichsueh3
  • Unknown owner on line 79: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga @mxiamxia
  • Unknown owner on line 79: make sure @mxiamxia exists and has write access to the repository
    …r-contrib-approvers @anuraaga @mxiamxia
  • Unknown owner on line 80: make sure @mstumpfx exists and has write access to the repository
    …y/collector-contrib-approvers @mstumpfx @rmfitzpatrick
  • Unknown owner on line 80: make sure @rmfitzpatrick exists and has write access to the repository
    …r-contrib-approvers @mstumpfx @rmfitzpatrick
  • Unknown owner on line 82: make sure @pmcollins exists and has write access to the repository
    …y/collector-contrib-approvers @pmcollins @dmitryax
  • Unknown owner on line 85: make sure @pmcollins exists and has write access to the repository
    …y/collector-contrib-approvers @pmcollins @dmitryax
  • Unknown owner on line 91: make sure @boostchicken exists and has write access to the repository
    …y/collector-contrib-approvers @boostchicken @pmm-sumo
  • Unknown owner on line 91: make sure @pmm-sumo exists and has write access to the repository
    …ntrib-approvers @boostchicken @pmm-sumo
  • Unknown owner on line 92: make sure @boostchicken exists and has write access to the repository
    …y/collector-contrib-approvers @boostchicken @pmm-sumo
  • Unknown owner on line 92: make sure @pmm-sumo exists and has write access to the repository
    …ntrib-approvers @boostchicken @pmm-sumo
  • Unknown owner on line 93: make sure @pmm-sumo exists and has write access to the repository
    …y/collector-contrib-approvers @pmm-sumo
  • Unknown owner on line 95: make sure @pmm-sumo exists and has write access to the repository
    …ib-approvers @owais @dmitryax @pmm-sumo
  • Unknown owner on line 95: make sure @owais exists and has write access to the repository
    …y/collector-contrib-approvers @owais @dmitryax @pmm-sumo
  • Unknown owner on line 96: make sure @punya exists and has write access to the repository
    …y/collector-contrib-approvers @punya
  • Unknown owner on line 98: make sure @leonsp-ai exists and has write access to the repository
    …y/collector-contrib-approvers @leonsp-ai @dmitryax @mx-psi
  • Unknown owner on line 99: make sure @jrcamp exists and has write access to the repository
    …y/collector-contrib-approvers @jrcamp @pmm-sumo @anuraaga @dashpole
  • Unknown owner on line 99: make sure @anuraaga exists and has write access to the repository
    …b-approvers @jrcamp @pmm-sumo @anuraaga @dashpole
  • Unknown owner on line 99: make sure @pmm-sumo exists and has write access to the repository
    …tor-contrib-approvers @jrcamp @pmm-sumo @anuraaga @dashpole
  • Unknown owner on line 103: make sure @albertteoh exists and has write access to the repository
    …y/collector-contrib-approvers @albertteoh
  • Unknown owner on line 104: make sure @boostchicken exists and has write access to the repository
    …y/collector-contrib-approvers @boostchicken @pmm-sumo
  • Unknown owner on line 104: make sure @pmm-sumo exists and has write access to the repository
    …ntrib-approvers @boostchicken @pmm-sumo
  • Unknown owner on line 106: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga @bogdandrutu
  • Unknown owner on line 109: make sure @pxaws exists and has write access to the repository
    …-contrib-approvers @Aneurysm9 @pxaws
  • Unknown owner on line 109: make sure @Aneurysm9 exists and has write access to the repository
    …y/collector-contrib-approvers @Aneurysm9 @pxaws
  • Unknown owner on line 110: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga
  • Unknown owner on line 111: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga @Aneurysm9
  • Unknown owner on line 111: make sure @Aneurysm9 exists and has write access to the repository
    …r-contrib-approvers @anuraaga @Aneurysm9
  • Unknown owner on line 112: make sure @anuraaga exists and has write access to the repository
    …y/collector-contrib-approvers @anuraaga
  • Unknown owner on line 113: make sure @pjanotti exists and has write access to the repository
    …y/collector-contrib-approvers @pjanotti
  • Unknown owner on line 114: make sure @agoallikmaa exists and has write access to the repository
    …y/collector-contrib-approvers @agoallikmaa @pellared
  • Unknown owner on line 114: make sure @pellared exists and has write access to the repository
    …ontrib-approvers @agoallikmaa @pellared
  • Unknown owner on line 115: make sure @owais exists and has write access to the repository
    …y/collector-contrib-approvers @owais
  • Unknown owner on line 116: make sure @cpheps exists and has write access to the repository
    …contrib-approvers @djaglowski @cpheps
  • Unknown owner on line 118: make sure @rmfitzpatrick exists and has write access to the repository
    …y/collector-contrib-approvers @rmfitzpatrick
  • Unknown owner on line 119: make sure @davmason exists and has write access to the repository
    …-contrib-approvers @pmcollins @davmason
  • Unknown owner on line 119: make sure @pmcollins exists and has write access to the repository
    …y/collector-contrib-approvers @pmcollins @davmason
  • Unknown owner on line 120: make sure @binaryfissiongames exists and has write access to the repository
    …contrib-approvers @djaglowski @binaryfissiongames
  • Unknown owner on line 123: make sure @alexvanboxel exists and has write access to the repository
    …y/collector-contrib-approvers @alexvanboxel
  • Unknown owner on line 124: make sure @architjugran exists and has write access to the repository
    …dzhal @asukhyy @khospodarysko @architjugran
  • Unknown owner on line 124: make sure @khospodarysko exists and has write access to the repository
    …provers @ydrozhdzhal @asukhyy @khospodarysko @architjugran
  • Unknown owner on line 124: make sure @asukhyy exists and has write access to the repository
    …ontrib-approvers @ydrozhdzhal @asukhyy @khospodarysko @architjugran
  • Unknown owner on line 124: make sure @ydrozhdzhal exists and has write access to the repository
    …y/collector-contrib-approvers @ydrozhdzhal @asukhyy @khospodarysko @architjugran
  • Unknown owner on line 126: make sure @jacobmarble exists and has write access to the repository
    …y/collector-contrib-approvers @jacobmarble
  • Unknown owner on line 128: make sure @rmfitzpatrick exists and has write access to the repository
    …y/collector-contrib-approvers @rmfitzpatrick
  • Unknown owner on line 129: make sure @pmm-sumo exists and has write access to the repository
    …y/collector-contrib-approvers @pmm-sumo
  • Unknown owner on line 133: make sure @pavolloffay exists and has write access to the repository
    …y/collector-contrib-approvers @pavolloffay @MovieStoreGuy
  • Unknown owner on line 134: make sure @pmcollins exists and has write access to the repository
    …y/collector-contrib-approvers @pmcollins @dmitryax
  • Unknown owner on line 136: make sure @schmikei exists and has write access to the repository
    …contrib-approvers @djaglowski @schmikei
  • Unknown owner on line 137: make sure @zenmoto exists and has write access to the repository
    …y/collector-contrib-approvers @zenmoto
  • Unknown owner on line 142: make sure @Aneurysm9 exists and has write access to the repository
    …y/collector-contrib-approvers @Aneurysm9 @dashpole
  • Unknown owner on line 143: make sure @cpheps exists and has write access to the repository
    …contrib-approvers @djaglowski @cpheps
  • Unknown owner on line 144: make sure @jrcamp exists and has write access to the repository
    …y/collector-contrib-approvers @jrcamp
  • Unknown owner on line 145: make sure @pmcollins exists and has write access to the repository
    …y/collector-contrib-approvers @pmcollins @dmitryax
  • Unknown owner on line 146: make sure @owais exists and has write access to the repository
    …y/collector-contrib-approvers @owais
  • Unknown owner on line 147: make sure @pjanotti exists and has write access to the repository
    …y/collector-contrib-approvers @pjanotti @dmitryax
  • Unknown owner on line 148: make sure @JaredTan95 exists and has write access to the repository
    …y/collector-contrib-approvers @JaredTan95
  • Unknown owner on line 149: make sure @keitwb exists and has write access to the repository
    …or-contrib-approvers @atoulme @keitwb
  • Unknown owner on line 154: make sure @pjanotti exists and has write access to the repository
    …y/collector-contrib-approvers @pjanotti
  • Unknown owner on line 156: make sure @pmm-sumo exists and has write access to the repository
    …y/collector-contrib-approvers @pmm-sumo
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ processor/groupbytraceprocessor/ @open-telemetry/collector-c
processor/k8sattributesprocessor/ @open-telemetry/collector-contrib-approvers @owais @dmitryax @pmm-sumo
processor/metricstransformprocessor/ @open-telemetry/collector-contrib-approvers @punya
processor/probabilisticsamplerprocessor/ @open-telemetry/collector-contrib-approvers @jpkrohling
processor/redactionprocessor/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy
processor/redactionprocessor/ @open-telemetry/collector-contrib-approvers @leonsp-ai @dmitryax @mx-psi
processor/resourcedetectionprocessor/ @open-telemetry/collector-contrib-approvers @jrcamp @pmm-sumo @anuraaga @dashpole
processor/resourceprocessor @open-telemetry/collector-contrib-approvers @dmitryax
processor/resourcedetectionprocessor/internal/azure @open-telemetry/collector-contrib-approvers @mx-psi
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -348,6 +348,7 @@
- `mongodbreceiver`: Establish codebase for MongoDB metrics receiver (#6972)
- `couchbasereceiver`: Establish codebase for Couchbase metrics receiver (#7046)
- `dbstorage`: New experimental dbstorage extension (#7061)
- `redactionprocessor`: Remove sensitive data from traces (#6495)

### 🧰 Bug fixes 🧰

52 changes: 42 additions & 10 deletions processor/redactionprocessor/README.md
Original file line number Diff line number Diff line change
@@ -7,41 +7,73 @@ attributes. It also masks span attribute values that match a blocked value
list. Span attributes that aren't on the allowed list are removed before any
value checks are done.

## Use Cases

Typical use-cases:

* Prevent sensitive fields from accidentally leaking into traces
* Ensure compliance with legal, privacy, or security requirements

For example:

* EU General Data Protection Regulation (GDPR) prohibits the transfer of any
personal data like birthdates, addresses, or ip addresses across borders
without explicit consent from the data subject. Popular trace aggregation
services are located in US, not in EU. You can use the redaction processor
to scrub personal data from your data.
* PRC legislation prohibits the transfer of geographic coordinates outside of
the PRC. Popular trace aggregation services are located in US, not in the
PRC. You can use the redaction processor to scrub geographic coordinates
from your data.
* Payment Card Industry (PCI) Data Security Standards prohibit logging certain
things or storing them unencrypted. You can use the redaction processor to
scrub them from your traces.

The above is written by an engineer, not a lawyer. The redaction processor is
intended as one line of defence rather than the only compliance measure in
place.

## Processor Configuration

Please refer to [config.go](./config.go) for the config spec.

Examples:

```yaml
processors:
redaction:
# Flag to allow all span attribute keys. Setting this to true disables the
# allow_all_keys is a flag which when set to true, which can disables the
# allowed_keys list. The list of blocked_values is applied regardless. If
# you just want to block values, set this to true.
allow_all_keys: false
# Allowlist for span attribute keys. The list is designed to fail closed.
# If allowed_keys is empty, no span attributes are allowed and all span
# attributes are removed. To allow all keys, set allow_all_keys to true.
# To allow the span attributes you know are good, add them to the list.
# allowed_keys is a list of span attribute keys that are allowed to pass
# through. The list is designed to fail closed. If allowed_keys is empty,
# no span attributes are allowed and all span attributes are removed. To
# allow all keys, set allow_all_keys to true. To allow the span attributes
# you know are good, add them to the list.
allowed_keys:
- description
- group
- id
- name
# Blocklist for span attribute values
# blocked_values is a list of regular expressions for blocking values of
# allowed span attributes. Values that match are masked
blocked_values:
- "4[0-9]{12}(?:[0-9]{3})?" ## Visa credit card number
- "(5[1-5][0-9]{14})" ## MasterCard number
# summary controls the verbosity level of the diagnostic attributes that
# the processor adds to the spans when it redacts or masks other
# attributes. In some contexts a list of redacted attributes leaks
# information, while it is valuable when integrating and testing a new
# configuration. Possible values:
# - `debug` includes both redacted key counts and names in the summary
# - `info` includes just the redacted key counts in the summary
# - `silent` omits the summary attributes
summary: debug
```

## Configuration

Refer to [config.yaml](./testdata/config.yaml) for detailed examples on using
the processor.
Refer to [config.yaml](./testdata/config.yaml) for how to fit the configuration
into an OpenTelemetry Collector pipeline definition.

Only span attributes included on the list of allowed keys list are retained.
If `allowed_keys` is empty, then no span attributes are allowed. All span
7 changes: 7 additions & 0 deletions processor/redactionprocessor/config.go
Original file line number Diff line number Diff line change
@@ -34,4 +34,11 @@ type Config struct {
// BlockedValues is a list of regular expressions for blocking values of
// allowed span attributes. Values that match are masked
BlockedValues []string `mapstructure:"blocked_values"`

// Summary controls the verbosity level of the diagnostic attributes that
// the processor adds to the spans when it redacts or masks other
// attributes. In some contexts a list of redacted attributes leaks
// information, while it is valuable when integrating and testing a new
// configuration. Possible values are `debug`, `info`, and `silent`.
Summary string `mapstructure:"summary"`
}
17 changes: 17 additions & 0 deletions processor/redactionprocessor/config_test.go
Original file line number Diff line number Diff line change
@@ -15,12 +15,14 @@
package redactionprocessor

import (
"path"
"path/filepath"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config"
"go.opentelemetry.io/collector/service/servicetest"
)

@@ -34,3 +36,18 @@ func TestLoadConfig(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, cfg)
}

func TestLoadConfigEmpty(t *testing.T) {
factories, err := componenttest.NopFactories()
require.NoError(t, err)

factory := NewFactory()
factories.Processors[typeStr] = factory

cfg, err := servicetest.LoadConfigAndValidate(path.Join(".", "testdata", "empty.yaml"), factories)
require.NoError(t, err)
require.NotNil(t, cfg)

p0 := cfg.Processors[config.NewComponentID(typeStr)]
assert.Equal(t, p0, createDefaultConfig())
}
Loading