otel-ottl
Skill125 starsChanged 4 months agoApache-2.0View on GitHub
OpenTelemetry Transformation Language (OTTL) expert for writing and debugging telemetry transformations in the OpenTelemetry Collector. Use when authoring or reviewing `transform`, `filter`, `tail_sampling` processor configs or `routing` connector configs, debugging OTTL syntax or semantics, transforming traces, metrics, logs, or profiles, or converting data-processing requirements into OTTL statements.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- dash0hq/agent-skillstheir own version, first seen Nov 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- dash0hq/agent-skills★ 99same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- otel-browserSkill
- otel-collector-builderSkill
- otel-collectorSkill
- otel-declarative-configSkill
- otel-dotnetSkill
- otel-goSkill
- otel-javaSkill
- otel-jsSkill
- otel-profilesSkill
- otel-pythonSkill
- otel-rubySkill
- otel-sdk-versionsSkill
- otel-semantic-conventionsSkill
- otel-span-events-to-logs-migrationSkill
- otel-telemetry-emissionsSkill
- otel-telemetrygenSkill
- otel-upgradeSkill
- otel-weaverSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 91
Use Decode(value, "base64").
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenTelemetry Transformation Language (OTTL)
OTTL transforms or selects telemetry inside Collector components. This skill is pinned to collector-contrib v0.163.0. Function, path, default, and feature-gate availability varies by release; when the user's version differs, verify against the matching upstream tag.
Dated OTTL feature-gate status for v0.162.0 and v0.163.0 is in references/functions.md.
Workflow
- Choose the component.
transformrewrites,filterdrops,tail_samplingdecides whether to retain traces, androutingsends telemetry to pipelines. A component controls its available contexts and functions. - Choose the lowest usable context. Lower contexts can read their parents (for example, a span
can read
resource.attributes), but parents cannot read children. Usedatapointfor point attributes instead of traversingmetric.data_points. - Verify every emitted function, then write the statement. Confirm each function's exact
identifier and signature in references/functions.md. If an identifier
is absent, treat it as unsupported instead of deriving or substituting a plausible name. An
editor such as
setordelete_keymutates data and may have awherecondition. Converters such asParseJSONandIsMatchreturn values; they do not mutate. - Set error behavior deliberately.
ignorelogs statement errors and continues;silentcontinues without logging;propagatereturns the error and can cause the component to drop the payload. Transform and filter default toignore; the transform default-error gate was removed in v0.162.0, so naming it in--feature-gatesfails startup (history: theotel-collectorskill's transform quirks), and the filter gate is stable and cannot be disabled. Routing also defaults toignorewhile its beta default-error feature gate is enabled. For routing,ignoresends an errored payload todefault_pipelines; configure that fallback or the payload is dropped. - Verify end to end. Validate the exact Collector version (since v0.163,
validatealso parses routing connector conditions), then send known telemetry and inspect file-exporter output. Use the telemetrygen recipe.
set(span.attributes["env"], "prod") where resource.attributes["env"] == nilLoad only what the task needs
- Contexts — exact paths, hierarchy, enums, and request metadata.
- Functions — editor/converter signatures and release availability.
- Quick reference — component YAML, recipes, escaping, troubleshooting, and safe skeletons.
For a single path or function, read only the relevant section instead of loading the full catalogs.
Safety and correctness gates
- Guard optional or polymorphic input before conversion:
where x != nil,IsString(x), or the appropriate type check. - For JSON-object-only work, guard both the type and shape before calling
ParseJSON, for exampleIsString(log.body) and IsMatch(log.body.string, "(?s)^\\s*\\{.*\\}\\s*$"). The RE2(?s)flag admits pretty-printed objects containing newlines. CheckingIsMapafter parsing does not prevent arrays or scalar JSON from being parsed. - On a version-pinned request, confirm every chosen path and function against that release tag;
do not assume a function listed for this skill's v0.163 anchor exists in an older release.
For v0.156 JSON-object parsing,
ParseJSON,IsString, andIsMatchare available without the v0.157 alpha lambda feature gate. - Request metadata is read-only and may contain credentials. Copy only explicitly allowlisted,
non-sensitive keys. OTLP metadata routing requires
include_metadata: trueon the receiver. HTTP/client header spelling may retain its form (otelcol.client.metadata["X-Tenant"][0]); gRPC metadata keys are lowercase (otelcol.grpc.metadata["x-tenant"][0]). - The routing
requestcontext is deprecated as of v0.156; useotelcol.client.metadataorotelcol.grpc.metadata. - Log-record-specific rewrites of shared resource or scope data require
flatten_data: trueand the alphatransform.flatten.logsgate. This copies and regroups data; do not enable it accidentally. - Since v0.161,
set(target, nil)is no longer a no-op: theottl.set.allowNilgate became beta in v0.161 and stable (cannot be disabled) in v0.162. A nil value empties a map, slice, orpcommon.Valuetarget (an attribute key is created with an empty value) and errors on scalar targets. Use awhere source != nilguard when the destination must remain unchanged for missing input. - Hashing an identifier does not necessarily anonymize it. Apply the organization's data-handling policy before retaining deterministic hashes of personal data.
Frequent syntax traps
- In Collector YAML, write an OTTL replacement backreference
${1}as$${1}. A replacement such as$1REDACTEDis literal and silently fails to substitute the capture. - Go RE2 rejects large counted repetitions such as
(.{1024}).*; useSubstringwith a nil/type guard andLen, ortruncate_allfor a map. - Current span-event paths use
spanevent.*, notspan_event.*. Cache paths are context-qualified, such asspan.cache["parsed"]. - Quote any OTTL statement containing a map literal when YAML includes a space after
:, for example'set(log.attributes["a"], {"foo": "bar"})'; otherwise YAML parses:as a mapping. - Since v0.159, polymorphic
pcommon.Valuepaths compare by their underlying type; maps and slices support only equality and inequality, while primitive values also support ordering. - Use
Decode(value, "base64");Base64Decodewas removed in v0.161. - Regex escapes inside OTTL strings are doubled (
\\d,\\s,\\.).
Upstream sources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

