Skip to content

Commit

Permalink
fix examples filter and transform processors
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Jan 10, 2025
1 parent 672dfe7 commit ded82d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ information.

### Drop spans which contain a certain span attribute

This example sets the attribute `test` to `pass` if the attribute `test` does not exist.
This example drops the signals that have the attribute `container.name` set to the value `app_container_1`.

```alloy
otelcol.processor.filter "default" {
error_mode = "ignore"
traces {
span = [
"attributes[\"container.name\"] == \"app_container_1\"",
`attributes["container.name"] == "app_container_1"`,
]
}
Expand All @@ -231,8 +231,8 @@ otelcol.processor.filter "default" {
metrics {
metric = [
"name == \"my.metric\" and resource.attributes[\"my_label\"] == \"abc123\"",
"type == METRIC_DATA_TYPE_HISTOGRAM",
`name == "my.metric" and resource.attributes["my_label"] == "abc123"`,
`type == METRIC_DATA_TYPE_HISTOGRAM`,
]
}
Expand All @@ -257,14 +257,14 @@ otelcol.processor.filter "default" {
traces {
span = [
"attributes[\"http.request.method\"] == nil",
`attributes["http.request.method"] == nil`,
]
}
logs {
log_record = [
"IsMatch(body, \".*password.*\")",
"severity_number < SEVERITY_NUMBER_WARN",
`IsMatch(body, ".*password.*")`,
`severity_number < SEVERITY_NUMBER_WARN`,
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ otelcol.processor.transform "default" {
context = "resource"
statements = [
// The Concat function combines any number of strings, separated by a delimiter.
`set(attributes["test"], Concat([attributes["foo"], attributes["bar"]], " "))`,
`set(attributes["test"], Concat([attributes["service.name"], attributes["service.version"]], " "))`,
]
}
Expand Down

0 comments on commit ded82d4

Please sign in to comment.