Skip to content

Commit

Permalink
Document wildcards in attributes.select (#996)
Browse files Browse the repository at this point in the history
* Document wildcards in attributes.select

* Edits

---------

Co-authored-by: Sean Packham <[email protected]>
  • Loading branch information
mariomac and grafsean authored Jul 9, 2024
1 parent 31390b2 commit c1564df
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/sources/configure/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,30 @@ attributes:
exclude: ["k8s.pod.*"]
```

Additionally, you can use "`*`" wildcards as metric names to add and exclude attributes for
groups of metrics having the same name. For example:

```yaml
attributes:
select:
http_*:
include: ["*"]
exclude: ["http_path", "http_route"]
http_client_*:
# override http_* exclusion
include: ["http_path"]
http_server_*:
# override http_* exclusion
include: ["http_route"]
```

In the previous example, all the metrics with a name starting with `http_` (or `http.`) would include all
the possible attributes but `http_path` and `http_route` (or `http.path`/`http.route`).
The `http_client_*` and `http_server_*` sections would override the base configuration, enabling the
`http_path` attribute for the HTTP client metrics and `http_route` for the HTTP server metrics.

When a metric name matches multiple definitions using wildcards, exact matches have higher precedence than wild card matches.

### Instance ID decoration

The metrics and the traces are decorated with a unique instance ID string, identifying
Expand Down

0 comments on commit c1564df

Please sign in to comment.