otel-ottllisted
Install: claude install-skill dash0hq/agent-skills
# OpenTelemetry Transformation Language (OTTL)
## Components that use OTTL
OTTL is not limited to the transform and filter processors.
Processors (transform, filter, attributes, span, tailsampling, cumulativetodelta, logdedup, lookup), connectors (routing, count, sum, signaltometrics), and the hostmetrics receiver all accept OTTL expressions.
See [components](./rules/components.md) for the full list with use cases.
## OTTL syntax
### Path expressions
Navigate telemetry data using dot notation:
```
span.name
span.attributes["http.method"]
resource.attributes["service.name"]
```
**Contexts** (first path segment): `resource`, `scope`, `span`, `spanevent`, `metric`, `datapoint`, `log`.
### Enumerations
Use int64 constants for enumeration fields:
```
span.status.code == STATUS_CODE_ERROR
span.kind == SPAN_KIND_SERVER
```
### Operators
Assignment: `=` — Comparison: `==`, `!=`, `>`, `<`, `>=`, `<=` — Logical: `and`, `or`, `not`
### Functions
**Converters** (uppercase, return values):
```
ToUpperCase(span.attributes["http.request.method"])
Substring(log.body.string, 0, 1024)
Concat(["prefix", span.attributes["request.id"]], "-")
IsMatch(metric.name, "^k8s\\..*$")
```
**Editors** (lowercase, modify data in-place):
```
set(span.attributes["region"], "us-east-1")
delete_key(resource.attributes, "internal.key")
limit(log.attributes, 10, [])
```
See [function-reference](./rules/function-reference.md) for the full list of editors and converters.
### Conditional statement