4.1 Configuration
In this step, we’ll modify agent.yaml to include the attributes and redaction processors. These processors will help ensure that sensitive data within span attributes is properly handled before being logged or exported.
Previously, you may have noticed that some span attributes displayed in the console contained personal and sensitive data. We’ll now configure the necessary processors to filter out and redact this information effectively.
Exercise
Switch to your Agent terminal window and open the agent.yaml file in your editor. We’ll add two processors to enhance the security and privacy of your telemetry data.
1. Add an attributes Processor: The Attributes Processor allows you to modify span attributes (tags) by updating, deleting, or hashing their values. This is particularly useful for obfuscating sensitive information before it is exported.
In this step, we’ll:
- Update the
user.phone_numberattribute to a static value("UNKNOWN NUMBER"). - Hash the
user.emailattribute to ensure the original email is not exposed. - Delete the
user.passwordattribute to remove it entirely from the span.
2. Add a redaction Processor: The Redaction Processor detects and redacts sensitive data in span attributes based on predefined patterns, such as credit card numbers or other personally identifiable information (PII).
In this step:
We set
allow_all_keys: trueto ensure all attributes are processed (if set tofalse, only explicitly allowed keys are retained).We define
blocked_valueswith regular expressions to detect and redact Visa and MasterCard credit card numbers.The
summary: debugoption logs detailed information about the redaction process for debugging purposes.
Update the traces Pipeline: Integrate both processors into the traces pipeline. Make sure that you comment out the redaction processor at first (we will enable it later in a separate exercise). Your configuration should look like this:
Validate the agent configuration using otelbin.io. For reference, the traces: section of your pipelines will look similar to this:
%%{init:{"fontFamily":"monospace"}}%%
graph LR
%% Nodes
REC1( otlp <br>fa:fa-download):::receiver
PRML(memory_limiter<br>fa:fa-microchip):::processor
PRRD(resourcedetection<br>fa:fa-microchip):::processor
PRRS(resource<br>fa:fa-microchip<br>add_mode):::processor
PRUP(attributes<br>fa:fa-microchip<br>update):::processor
EXP1(otlphttp<br>fa:fa-upload):::exporter
EXP2(  debug  <br>fa:fa-upload):::exporter
EXP3(file<br>fa:fa-upload):::exporter
%% Links
subID1:::sub-traces
subgraph " "
subgraph subID1[**Traces**]
direction LR
REC1 --> PRML
PRML --> PRUP
PRUP --> PRRD
PRRD --> PRRS
PRRS --> EXP2
PRRS --> EXP3
PRRS --> EXP1
end
end
classDef receiver,exporter fill:#8b5cf6,stroke:#333,stroke-width:1px,color:#fff;
classDef processor fill:#6366f1,stroke:#333,stroke-width:1px,color:#fff;
classDef con-receive,con-export fill:#45c175,stroke:#333,stroke-width:1px,color:#fff;
classDef sub-traces stroke:#fbbf24,stroke-width:1px, color:#fbbf24,stroke-dasharray: 3 3;