OpenTelemetry Bot d680729c09 [chore] Prepare release 0.90.0 (#29543) | vor 1 Jahr | |
---|---|---|
.. | ||
contexts | vor 1 Jahr | |
internal | vor 1 Jahr | |
ottlfuncs | vor 1 Jahr | |
ottltest | vor 1 Jahr | |
CONTRIBUTING.md | vor 2 Jahren | |
LANGUAGE.md | vor 1 Jahr | |
Makefile | vor 2 Jahren | |
README.md | vor 1 Jahr | |
boolean_value.go | vor 1 Jahr | |
boolean_value_test.go | vor 1 Jahr | |
compare.go | vor 1 Jahr | |
compare_test.go | vor 1 Jahr | |
doc.go | vor 1 Jahr | |
expression.go | vor 1 Jahr | |
expression_test.go | vor 1 Jahr | |
factory.go | vor 1 Jahr | |
functions.go | vor 1 Jahr | |
functions_test.go | vor 1 Jahr | |
go.mod | vor 1 Jahr | |
go.sum | vor 1 Jahr | |
grammar.go | vor 1 Jahr | |
lexer_test.go | vor 1 Jahr | |
math.go | vor 1 Jahr | |
math_test.go | vor 1 Jahr | |
metadata.yaml | vor 1 Jahr | |
parser.go | vor 1 Jahr | |
parser_test.go | vor 1 Jahr |
Status | |
---|---|
Stability | alpha: traces, metrics, logs |
Issues | |
Code Owners | @TylerHelmuth, @kentquirk, @bogdandrutu, @evan-bradley |
The OpenTelemetry Transformation Language is a language for transforming open telemetry data based on the OpenTelemetry Collector Processing Exploration.
This package reads in OTTL statements and converts them to invokable functions/booleans based on the OTTL's grammar.
If you're looking to write OTTL statements for a component's configuration check out these resources.
See OTTL Functions for a list of functions available for use in the OTTL statements of most components.
OTTL Contexts define how you access the fields on a piece of telemetry. See the table to find the exact list of available fields:
Telemetry | OTTL Context |
---|---|
Resource |
Resource |
Instrumentation Scope |
Instrumentation Scode |
Span |
Span |
Span Event |
SpanEvent |
Metric |
Metric |
Datapoint |
DataPoint |
Log |
Log |
If you're looking to use OTTL in your component, check out the OTTL grammar.
These examples contain a SQL-like declarative language. Applied statements interact with only one signal, but statements can be declared across multiple signals. Functions used in examples are indicative of what could be useful.
traces:
delete(attributes["http.request.header.authorization"])
metrics:
delete(attributes["http.request.header.authorization"])
logs:
delete(attributes["http.request.header.authorization"])
traces:
keep_keys(attributes, ["http.method", "http.status_code"])
metrics:
keep_keys(attributes, ["http.method", "http.status_code"])
logs:
keep_keys(attributes, ["http.method", "http.status_code"])
traces:
replace_match(attributes["http.target"], "/user/*/list/*", "/user/{userId}/list/{listId}")
traces:
replace_match(name, "GET /user/*/list/*", "GET /user/{userId}/list/{listId}")
traces:
replace_all_matches(attributes, "/user/*/list/*", "/user/{userId}/list/{listId}")
traces:
delete(resource.attributes["process.command_line"])
metrics:
delete(resource.attributes["process.command_line"])
logs:
delete(resource.attributes["process.command_line"])
metrics:
set(attributes["k8s_pod"], resource.attributes["k8s.pod.name"])
traces:
set(attributes["whose_fault"], "theirs") where attributes["http.status"] == 400 or attributes["http.status"] == 404
set(attributes["whose_fault"], "ours") where attributes["http.status"] == 500
logs:
set(span_id, SpanID(0x0000000000000000))
traces:
set(span_id, SpanID(0x0000000000000000))
metrics:
set(metric.name, ConvertCase(metric.name, "snake"))
traces:
set(attributes["test-passed"], true) where attributes["target-attribute"] != nil