Redacting sensitive data in OpenTelemetry pipelines

How to stop personal data, tokens and secrets from reaching telemetry back ends using OpenTelemetry redaction, hashing and tested Collector rules.

On this page

Why redacting sensitive data in OpenTelemetry pipelines comes before the back end

Redaction in the Collector stops personal data, tokens and health details before they are written to storage, so the back end never holds them. A team that discovers a customer email address in a trace span or a bearer token in a log line has already copied that data to every system that receives telemetry, along with any backups and downstream exports those systems make. The cheapest place to remove it is the pipeline, before export.

OpenTelemetry's sensitive data guidance lists PII, credentials, session tokens, financial data, health data and user behavior data as sensitive. It recommends data minimization first, meaning the instrumentation should not capture a value the team does not need. For what remains, the guidance names four tools: the attributes processor, the filter processor, the redaction processor and the transform processor. Each handles a different case, from deleting or hashing a known attribute to dropping whole records, so the first job is an inventory of which attributes, log bodies and span events in your services can carry such data.

OpenTelemetry is an instrumentation and collection framework, not a back end. It generates and moves telemetry, but it does not decide how long data is kept, who can query it or where it is stored. Those decisions belong to the tools receiving the data, so your retention periods, access roles and encryption settings must be confirmed with each back end's owner. Redaction rules in the Collector reduce what those tools must protect, but they do not replace the access and retention controls that apply to the data they still hold.

Choosing between the redaction, attributes, filter and transform processors

This table compares the four Collector processors that handle sensitive data and shows when each one fits. Read it by matching your leak type (whole records, known attribute keys, value patterns or conditional rewrites) to a row, then check the trade-off before you write the rule. Confirm each component's stability in its README before relying on it in production.

ProcessorBest fitTrade-offConfirm before use
Redaction processorRemoving attributes that are not on an allow list, and masking values that match blocked patterns such as card numbers or token formatsAllow lists are strict, so a new attribute is dropped until someone adds it; pattern rules can miss values with unexpected formatsAllow list and blocked value settings, and the component's stability level
Attributes processorHashing, deleting or upserting specific named keys when you know exactly which fields carry personal dataWorks on known keys only, so unexpected or nested fields pass through unless you list themHash function options and which signals each action applies to
Filter processorDropping whole spans, metrics or log records that should never leave the pipeline, such as health checks or debug logs with user dataRemoves the entire record, so you lose the non-sensitive fields and any analysis that depended on themFilter condition syntax and whether the component supports each signal type
Transform processorConditional rewrites using OTTL, such as truncating a field, replacing part of a value or changing an attribute only when another condition holdsMost flexible but the most complex to test; a faulty statement can change data you did not intend to touchOTTL function set, error mode behavior and the component's stability level
Choosing on data minimizationStart with an allow list in the redaction processor so only known-safe attributes reach the back endStrict allow lists need ongoing maintenance as applications add fieldsTeam ownership for updating the allow list after each release
Combining processorsRedaction for broad coverage, attributes for named keys, filter for whole records, transform for conditional logicProcessor order changes results, so each stage can undo or duplicate another stage's workThe order of processors in each pipeline and test output after each change

How to set up redaction rules in a Collector pipeline

This sequence turns a list of sensitive fields into tested redaction rules in the Collector, so personal data, tokens and secrets are removed or masked before they reach any telemetry back end. Each step ends with a check you can repeat after every change.

  1. Inventory sensitive attributes and log bodies

    The security or privacy lead and the service owners list where sensitive data appears: span and metric attributes, resource attributes, log bodies, and URL query strings. Include personal identifiers, session tokens, credentials, and financial or health fields. Record the source service, signal type, and attribute key for each item. The inventory is done when every signal your pipeline receives has an owner and a list of fields that must never leave the network unmasked. Sample real traffic in a non-production environment to find fields that developers did not expect to carry data.

  2. Choose allow lists or blocked patterns per signal

    For each signal, decide whether the pipeline should keep only known-safe attribute keys (an allow list) or remove specific values matched by pattern (blocked values). Allow lists suit services with stable, well-known schemas. Blocked value patterns suit free-text log bodies where the sensitive content cannot be predicted by key. Most teams combine both: a strict allow list for spans and metrics, and value patterns for logs. Write the decision down per signal, with the named owner, so reviewers can trace why each rule exists.

  3. Add redaction and attributes processors in order

    The platform engineer adds the redaction processor and the attributes processor to each pipeline in the Collector configuration, placed before the exporters. Order matters: the redaction step should run after attributes are reshaped or hashed, so that a later processor cannot reintroduce a removed field. Keep the processor list identical across pipelines that share a back end, and store the configuration in version control so every change is reviewed. The step is complete when the configuration validates and the Collector starts without errors on the gateway.

  4. Hash identifiers that must still join

    For identifiers that analysts need to correlate, such as a user or account ID, the engineer uses the attributes processor to replace the raw value with a hash rather than deleting it. Confirm the hashing approach and any salt handling with your security team, because an unsalted hash of a small identifier space can be reversed by guessing. Test that the same input produces the same hashed output across several telemetry batches and across services. Stable hashes keep joins and per-user counts working without storing the original value.

  5. Deploy the rules to a non-production gateway

    The platform team deploys the updated configuration to a non-production gateway that receives sample traffic from representative services. Use a test back end or a debug exporter so that output stays inside a controlled environment. Confirm that the Collector reports no dropped data and that CPU and memory stay within the levels observed before the change. Keep the rollout limited until the sample checks in the next step pass, and keep the previous configuration available for rollback.

  6. Test redaction with synthetic sensitive values

    The security engineer sends synthetic telemetry that contains test values shaped like tokens, card numbers, email addresses, and session identifiers. Inspect the exporter output and confirm that each test value is masked or removed in every signal, including log bodies and attributes added by SDKs. Repeat the test with variations such as the value in a different attribute key, a nested field, or a long log line. Record the results in a test log so auditors and reviewers can see what was checked. Illustrative example: a fake bearer token placed in a log body should appear masked in the exporter output and nowhere else.

  7. Verify hash stability and release to production

    Before production, the engineer checks that hashed identifiers return the same value for the same input across two separate test runs, and that the joined data still answers the queries analysts depend on. The security lead signs off on the test log, and the change is promoted through the normal release path with a documented rollback. After release, sample production output at a fixed interval to confirm that new services have not introduced unlisted fields. The sequence is complete when the sample checks pass in production and the rule inventory matches the deployed configuration.

Where redaction sits between instrumented services and back ends

The flow starts at SDK-instrumented applications, which send traces, metrics and logs to a Collector receiver inside a trust boundary. Inside the Collector, the attributes, filter and redaction processors run before anything is exported. Only the exporter crosses the boundary to the back end, so the key check is that unredacted data never leaves the boundary. Test the rules at the exporter output, not just in the config file.

Redaction runs inside the Collector before any exporter sends data out.

Security risks that redaction rules must cover

Redaction rules fail in predictable places: free text the rules never anticipated, allow lists that grow silently, hashes that can be reversed, and configuration that leaks what it was meant to protect. The cards below cover the risks to review before any pipeline carries production telemetry. Each one points to a check you can run against your own Collector configuration and test data.

Sensitive data in log bodies

Fixed attribute rules only see keys you named in advance. Log bodies, exception messages and free-text span attributes often carry an email address, a session token or a card number inside a sentence, where no key matches. Check whether your application logs raw request payloads, query strings or error messages, and test redaction against real-looking strings in the body field, not only against structured attributes. Treat body content as untrusted until you have sampled it.

Sensitive data guidance

Over-broad allow lists

An allow list keeps only the attributes you approve, which is safer than a block list, but only if the approved set stays small. Teams often add a field to fix a dashboard and never review it again. Every new attribute an application emits can then pass through unless something blocks it. Review allow-list changes as security changes, and keep a short written reason next to each permitted attribute.

Weak hashing of low-entropy values

Hashing a value such as a phone number, postal code or employee ID does not anonymize it when the input space is small. An attacker can hash every possible value and match the output. Use hashing only where the value is high-entropy or where a keyed hash with a secret the pipeline does not expose is acceptable. For low-entropy fields, drop the attribute or truncate it to a coarser value, and confirm the result with your privacy team.

Secrets inside redaction config

Redaction rules often contain the patterns themselves, and some teams paste literal tokens or internal hostnames into regular expressions while debugging. Committing that file to Git exposes both the rules and anything they were meant to hide. Keep the configuration in a store with access control, pull back-end credentials from environment variables or a secret manager, and scan the repository for literal secrets before each merge.

Gaps after SDK upgrades

Instrumentation libraries add attributes when they update, sometimes with new names that no rule covers. A redaction setup that passed review last quarter can start exporting new fields after a dependency bump, with no error in the pipeline. Pair each SDK or instrumentation upgrade with a rerun of your redaction test set, and compare exported attribute names before and after the change.

How to test redaction rules before they reach production

The point of testing is to prove that a redaction rule removes the value you care about before the exporter sends it, and to prove it on the same Collector configuration you will run in production. Build a staging pipeline that mirrors production receivers, processors and exporters, then feed it synthetic telemetry. Include fake names, email addresses and national ID formats, bearer tokens and API keys with obvious placeholder prefixes, and card-like numbers that pass a length check but belong to no real account (test card numbers published for payment sandboxes are a common choice, but confirm with your payment team that they do not match any live account). Send spans, log records and metric attributes that carry these values in attribute keys, attribute values and free text, because a rule that catches one location can miss another. Use a test exporter, such as a file or debug exporter, as the sink, and write assertions against what that exporter receives: the forbidden patterns must be absent and the allowed fields must still be present.

Treat the test suite as a regression gate. Run it after every change to the redaction processor, the attributes processor, the filter processor or the transform processor, since the order of these processors in a pipeline changes what each one sees. Run it again after every Collector upgrade and every rebuild of a custom distribution, because component defaults and stability levels change between releases, and the OpenTelemetry Collector releases page is the place to check what changed. Store the fixtures and expected results in version control next to the configuration so that a failing assertion blocks the merge.

Fixtures must never contain real customer data, not even a sample copied from a ticket or a production log to make a test more realistic. Generate every value, document where it came from, and restrict who can add new fixtures. Ask your team to confirm how test output is stored, since a staging backend that keeps sink files can become a second copy of the data you are trying to protect. Your quality check should answer one question for each rule: if this value appeared in production tomorrow, which assertion would catch it?

Limits to confirm in your environment before relying on redaction

Redaction rules only protect data they actually reach, in a Collector build that actually contains the processors you configured. Each card below is a limit to confirm in your own environment before you treat a redaction rule as a control.

Processors in your Collector build

Redaction depends on the redaction, attributes, filter and transform processors being compiled into the binary you deploy. Check the component list of your custom distribution against the processors in your configuration, because a rule for a missing processor either fails at startup or is never applied. Confirm the exact fields each processor can match in the Collector version you build, since field names and matching options vary between components. If you build with the Collector Builder, keep the component list under version control so that removing an unused component does not silently remove a redaction step.

Sensitive data guidance

Stability level of each component

Core Collector components carry mixed stability levels, and each component's README states its level. A processor that is still in development may change its configuration keys or matching behavior between releases, which can break a redaction rule without any visible error. Record the stability level of every redaction component you rely on, and decide in advance whether your organization accepts a beta or alpha component in a control path. Review the README again whenever you move to a new release.

OpenTelemetry status page

Attributes that SDKs actually emit

Redaction rules target attribute names, so they only work if your SDK and auto-instrumentation emit the attributes you expect. Some libraries record full URLs with query strings, database statements with literal values, or request headers, and the names differ by language and framework version. Run a test service in each language you use, capture the raw telemetry before the Collector, and list every attribute that contains personal data, credentials or session tokens. Build rules from that list rather than from the names in documentation alone.

Log bodies and free text

Structured attributes are easier to redact than log bodies and exception messages, which often contain user input or a copied token in plain text. Pattern-based value blocking can miss values in free text, and a broad pattern can remove data you need for troubleshooting. Decide which log fields are free text, test whether your value patterns match the formats your applications produce, and confirm that stack traces from your frameworks do not include request payloads.

Performance on high-volume pipelines

Regular expression matching and transform statements run on every span, metric data point or log record that passes through the processor, so cost grows with volume and rule complexity. Load test the pipeline with production-like volume and rule sets, and measure CPU and memory on the gateway tier before rollout. Ask your team to confirm the sizing of the gateway tier after redaction rules are added, because a pipeline that keeps up without redaction may fall behind with it.

Release versions you tested

A redaction rule tested on one Collector release may behave differently on another, so the binary you deploy should be the same version you tested. Pin the Collector version in your build and deployment manifests, and verify the release artifacts you deploy against their published checksums and SBOM files before they reach production. Re-run your redaction test suite whenever the pinned version changes, including patch releases that fix security issues.

Collector releases

Common questions about redacting telemetry data

What does redacting sensitive data from telemetry cost in effort?

Effort depends mostly on how many signals you collect, how many data sources feed them, and how many custom log formats need rules. Each source needs its own inventory of attributes and log fields, each rule needs a decision about keep, hash, mask or drop, and each rule needs a test. Costs fall into two groups. The first is one-time: discovery, rule design, pipeline changes and test cases. The second recurs: reviewing rules when applications add fields, retesting after Collector upgrades, and handling new sensitive fields that appear in production. When requesting a quote, ask for the scope to list sources, signals and log formats separately, the testing approach, and what happens when new fields appear after handover. DeployOpen issues quotes from a written scope rather than a standard price list.

How long does a first redaction rollout take?

The timing is set by how quickly you can find out what sensitive data actually reaches telemetry and how many owners must approve the rules. The main drivers are the number of services already sending data, whether applications log raw request bodies or free-text messages, whether rules must be coordinated with back-end retention settings, and how much test evidence the security team wants before production. Teams that start with a staged rollout, one service or one pipeline at a time, usually find the work easier to review than a single cut-over. Ask any partner for a timeline that separates discovery, rule approval, staging tests and production rollout, and confirm which of those steps depend on your change windows and approval boards.

What do we need from our security and data owners?

The work needs decisions that only your organization can make. Security owners should define which categories count as sensitive for your regulators and contracts, since OpenTelemetry's guidance treats personal data, credentials, session tokens, financial data, health data and user behavior data as sensitive. Data owners should confirm which fields are needed for troubleshooting, which can be hashed so they still correlate, and which must never leave the source. Engineering leads must confirm which applications emit which attributes and log lines. Expect a review step for every rule that drops or changes data, because a rule that removes a needed field can make incidents harder to investigate. Agree on these owners and their sign-off process before the build begins.

Can an internal platform team redact telemetry without a partner?

Yes, a team that already runs the OpenTelemetry Collector can implement redaction itself, provided it has time, the engineering skills to write and test processor configuration, and a clear owner for the rules. The redaction processor, attributes processor, filter processor and transform processor are all configured in the Collector, and OpenTelemetry's security guidance recommends using the redaction processor to remove sensitive attributes. The usual gaps are not the configuration syntax but the discovery of sensitive values in unfamiliar log formats, the test suite that proves each rule works, and the ongoing review when applications change. Many teams split the work: they keep ownership of the rules and use an outside partner for the discovery and testing phases. Decide which parts you will staff before you choose a model.

How is redaction different from dropping telemetry?

Dropping removes a whole record, attribute or log line from the pipeline, so the data is gone and cannot help later analysis. Redaction changes only the sensitive part of the data and keeps the rest. Within redaction, the choices differ too: a blocked value pattern can mask a token while keeping the surrounding log message, an allow list can remove every attribute that is not approved, and hashing with the attributes processor replaces a value with a fixed digest so that the same user can still be counted across events without storing the original identifier. Hashing is not the same as anonymization, so confirm with your data protection owner whether a hashed identifier still counts as personal data under your rules. Choose per field, and record the choice.

How do we prove redaction to auditors without an audit report from DeployOpen?

DeployOpen does not issue audit reports, attestations or certifications. Independent auditors and certification bodies do that work. DeployOpen can prepare the evidence those auditors will ask for: the inventory of sensitive fields, the Collector configuration that applies each rule, version-controlled rule files, automated test results that show a sample of known secrets and personal values is removed before export, and a record of who approved each rule and when. Ask your auditor which evidence format they accept and how often they expect retesting. Keep the test suite running in your delivery pipeline so each configuration change produces a new result.

How do we test that redaction rules actually work?

Test redaction the way you test any control: with known inputs and expected outputs. Build a set of sample spans, metrics and log lines that contain fake but realistic-format values, such as dummy card numbers, sample bearer tokens and placeholder email addresses, then run them through the Collector configuration in a staging pipeline and check what the exporter receives. Include negative cases, so you confirm that needed fields survive. Run the same tests after each Collector upgrade and after each change to application logging. Mark any hypothetical test data clearly and never use real customer values in test fixtures. Store the expected outputs with the configuration so reviewers can see what each rule is meant to do.

Which sensitive data should we check first?

Start with the places where sensitive values are most likely to appear unintentionally. These include HTTP request and response attributes, database query text, authorization headers, exception messages, and free-text log lines written by application code. Next, check the attributes your SDKs and instrumentation libraries add by default, because those are often overlooked. Prioritize credentials and session tokens, since a leaked token can grant access, and then personal data and financial or health data that your regulators treat as sensitive. Use the sensitive data categories in OpenTelemetry's handling guidance as a checklist, and confirm the list with your security and data owners before writing rules.

What DeployOpen delivers for redaction work

Redaction work is delivered as a fixed-scope engagement. Before work starts, DeployOpen and the client agree in writing on the signals in scope (traces, metrics and logs), the sources that send them, and the rules that must hold, such as which attribute keys must be removed, which value patterns must be blocked and which fields must be hashed. The written scope also names the Collector deployment that receives the data, the back ends it exports to, and the people who approve the rule set. Those decisions are the ones that most change the effort, so they should be settled on paper first.

The delivered work is the configuration itself, installed in the client's own infrastructure: the redaction processor and attributes processor settings in each Collector pipeline, the allow and blocked value rules, the hashing steps, and the test cases that prove they work. The client receives the configuration under its own version control, along with test evidence showing which sample sensitive values were removed or hashed, which were kept on purpose, and what the Collector did with unexpected attributes. Evidence is useful to your security and compliance reviewers, though it does not replace an independent assessment.

DeployOpen does not publish prices, and a quote follows from the written scope. Ask each bidder to price the signals, sources, rules, test cases and handover as separate line items, so you can see what is one-time work and what recurs. Data sources and new telemetry fields that appear after go-live usually need new rules, so many clients also agree on a retainer for ongoing rule updates and periodic retesting. Confirm how the retainer handles urgent changes, such as a new credential format that starts appearing in logs.

How DeployOpen scopes and delivers OpenTelemetry redaction

DeployOpen approaches redaction as a written, testable part of your Collector pipeline. We start from the telemetry your services actually emit, agree which fields are sensitive, and then build and verify the processors that remove or hash them before data reaches any back end. Engagements are fixed-scope, with the scope agreed in writing before work starts.

How we scope

  • Inventory the attributes, log bodies and span events your services emit, and mark which contain personal data, credentials, session tokens or health and financial details.
  • Agree in writing which fields are dropped, which are hashed and which are kept, along with the pipelines and back ends each rule applies to.
  • Confirm the Collector version, distribution and components in use, since processor availability and behavior depend on the build you deploy.

How we build

  • Configure allow lists and blocked value patterns in the redaction processor, and use the attributes processor for hashing or deletion where a field must stay correlatable.
  • Apply data minimization first so that unneeded fields are never collected, then layer redaction for what remains.
  • Keep rule configuration in version control, with the processing order documented so each stage's effect on the next is clear to reviewers.

How we hand over

  • Deliver a test suite with sample payloads that include known sensitive values, showing each rule removes or hashes what it should and leaves other data intact.
  • Document each redaction rule, its owner, the pipeline it runs in and the steps to add or change a rule safely.
  • Walk your engineering and compliance teams through the results so they can review the evidence for their own assessments.

How we support

  • Retest redaction rules after Collector upgrades or new services are onboarded, since new attributes can reach the pipeline unexpectedly.
  • Ongoing support, upgrades and continuous testing are available as a retainer, scoped in writing.
  • Confirm with your team how to monitor for sensitive values that slip through, and agree who responds when a rule needs changing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.