Transform
Transforms telemetry by running OpenTelemetry Transformation Language (OTTL) statements against each record. Statements run in order from top to bottom and can set, keep, delete, or rewrite fields on a record's attributes, body, and resource. Optional conditions gate whether the statements run at all on a given record.
Supported Telemetry Types
✓
✓
✓
Choose Telemetry Type picks one signal per processor instance. Add another instance to handle a second signal.
Configuration
Basic Configuration

Statements
Choose Telemetry Type
Telemetry Selector
Yes
Logs
The signal this instance runs on: Logs, Metrics, or Traces (one at a time).
OTTL Statements
Code Blocks
Yes
(empty)
The OTTL statements to execute, one per block. They run in order from top to bottom.
Conditions
Code Blocks
No
(empty)
OTTL conditions that gate the statements. If any condition is true for a record, the statements run on that record. Leave empty to run on every record. Individual statements may still add their own where clauses.
Advanced
Error Mode
Enum: ignore, silent, propagate
No
ignore
How to handle statement errors. ignore logs the error and continues, silent continues without logging, propagate halts processing and returns the error up the pipeline.
Context (Logs)
Enum: log, resource
No
log
The OTTL context the statements execute in for logs. Applies when Choose Telemetry Type is Logs.
Context (Metrics)
Enum: datapoint, metric, resource
No
datapoint
The OTTL context the statements execute in for metrics. Applies when Choose Telemetry Type is Metrics.
Context (Traces)
Enum: span, spanevent, resource
No
span
The OTTL context the statements execute in for traces. Applies when Choose Telemetry Type is Traces.
The UI shows a single Context field whose options depend on the selected telemetry type. The default context (log, datapoint, or span) is the most specific level for that signal. Choose resource to operate on resource-level attributes shared across all records from a source.
Examples
Set, rename, and clean up log attributes
Run several OTTL statements in order on logs, gated by a condition so they only touch records from one service. This example keeps the default log context.
OTTL Statements:
Conditions:
The statements add an environment attribute, copy http.url into http.target only when it exists, drop the original http.url, redact a password pattern in the body, then keep only the named attributes. Because a condition is set, the statements run only on records whose service.name is checkout.

Normalize resource attributes using the resource context
Set the Context advanced parameter to resource to operate on resource-level fields rather than per-record fields. This is the right level for attributes that describe the source rather than an individual log.
OTTL Statements:
With Context set to resource, these statements run once per resource: they stamp a deployment environment, strip an internal DNS suffix from the host name, and drop a noisy pod UID attribute.

Configuration Tips
Statements run top to bottom. Order matters when a later statement reads a field an earlier one sets or deletes.
Use
whereon an individual statement for fine-grained control, and the Conditions field to gate the whole set. Both can be combined.The default context (
log,datapoint,span) addresses per-record fields. Switch Context toresourceonly when you mean to change resource-level attributes shared across records.
Troubleshooting
Statements don't seem to run
Symptoms: telemetry passes through unchanged after the processor.
Solutions:
Check the Conditions field. If a condition is set and never evaluates true, the statements never run. Clear it to run on every record.
Confirm Choose Telemetry Type matches the signal you are sending. A Logs instance does nothing to metrics or traces.
A statement errors and processing stops
Symptoms: records are dropped or the pipeline reports errors after adding the processor.
Solutions:
With Error Mode set to
propagate, any statement error halts processing. Set it toignorewhile you debug so the error is logged but processing continues.Guard field access that may be missing, for example
set(attributes["x"], attributes["y"]) where attributes["y"] != nil, so a nil field does not error.
Resource statements affect more records than expected
Symptoms: a change applied at the resource context shows up on records you didn't intend to modify.
Solutions:
Resource attributes are shared by every record from the same source. If you need per-record changes, use the default context (
log,datapoint, orspan) instead ofresource.
Standalone Processor
Related Resources
Bindplane Resources
These field and OTTL processors pair well with Transform for parsing and reshaping telemetry:
Last updated
Was this helpful?