Skip to content

Commit

Permalink
[exporter/prometheus] add with_resource_as_constant_labels
Browse files Browse the repository at this point in the history
This add support for the following from the spec:

> A Prometheus Exporter MAY offer configuration to add
> resource attributes as metric attributes. By default,
> it MUST NOT add any resource attributes as metric
> attributes. The configuration SHOULD allow the user
> to select which resource attributes to copy (e.g.
> include / exclude or regular expression based). Copied
> Resource attributes MUST NOT be excluded from target_info.

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed Jan 15, 2024
1 parent 6213808 commit 2841eb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ meter_provider:
without_units: false
without_type_suffix: false
without_scope_info: false
# Configure Prometheus Exporter to add resource attributes as metrics attributes.
with_resource_as_constant_labels: "service\\.[.]*"
# Configure a periodic metric reader.
- periodic:
# Configure delay interval (in milliseconds) between start of two consecutive exports.
Expand Down
3 changes: 3 additions & 0 deletions schema/meter_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
},
"without_scope_info": {
"type": "boolean"
},
"with_resource_as_constant_labels": {
"type": "string"
}
}
},
Expand Down

0 comments on commit 2841eb8

Please sign in to comment.