
- Define rules (statements) in processor configurations.
- The Collector evaluates those statements per telemetry item.
- Statements can set attributes, replace values, extract patterns, or drop items.
- Works across all signal types: traces, metrics, and logs.

- Remove or mask sensitive data (PII) before export.
- Add, rename, or normalize attributes for schema consistency.
- Filter out noisy or irrelevant telemetry to reduce volume.
- Extract or combine fields to simplify downstream analysis.


- Input span (before):
- Transform processor (OTTL) statements:
- Resulting span (after):
severity attribute derived from http.status_code.
Example 2 — Extract values and parse user agent
- Input span:
- Transform processor (extract user ID and device type):
- Resulting span (after):
- Input span:
- Transform processor (hash sensitive fields using a hashing function):
- Resulting span (after — sample hashed values shown):
- Input traces payload:
- Filter processor rule (drop fast or non-prod spans):
env == "prod".
- Resulting traces (after):
- Statements live inside transform/filter configurations (e.g., under
trace_statements). set()specifies the target attribute or field to change.whereis a guard — run the statement only when the condition is true.- If the
wherecondition is false, the statement is skipped for that telemetry item.

error_mode: ignore during exploration to avoid dropping data due to rule mistakes. Switch to error_mode: propagate when you require strict enforcement that prevents any erroneous transformation from being applied.
Simple processor snippets
- Transform processor for logs (ignore minor errors):
- Filter processor example to drop spans from
service1:
Start small: add one simple OTTL statement and test it. Use
error_mode: ignore while iterating, then switch to stricter error handling once your rules are stable. Always validate your Collector configuration before deploying.- OpenTelemetry Collector: https://opentelemetry.io/docs/collector/
- OTTL overview and syntax (Collector docs): https://opentelemetry.io/docs/collector/configuration/processor/transform/