You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PrometheusRemoteWriter] Add support of MetadataKeys in remote write outbound requests (#48767)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Adds the support of IncludeMetadataKeys in the prometehus remote write
queue.
When set, the listed client metadata keys are read from the request
context and forwarded as HTTP headers
Related to
#33137 (comment)
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
With this feature we preserver the metadata from the prometheus exporter
to outer http requests.
The metadata can be useful information to be used to handle this egress
traffic.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added TestIncludeMetadataKeys and
TestIncludeMetadataKeysAbsentWhenNotConfigured in
opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter/exporter_test.go
<!--Describe the documentation added.-->
#### Documentation
Updated README.md file
---------
Signed-off-by: Andreas Gkizas <andreas.gkizas@elastic.co>
Co-authored-by: David Ashpole <dashpole@google.com>
Copy file name to clipboardExpand all lines: exporter/prometheusremotewriteexporter/README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,9 @@ The following settings can be optionally configured:
52
52
-`add_metric_suffixes`: If set to false, type and unit suffixes will not be added to metrics. Default: true. **Deprecated**: Use `translation_strategy` instead.
53
53
-`translation_strategy`: Controls how OTLP metric and attribute names are translated into Prometheus metric and label names. Options are: `UnderscoreEscapingWithSuffixes` (default), `UnderscoreEscapingWithoutSuffixes`, `NoUTF8EscapingWithSuffixes`, and `NoTranslation`. When set, this takes precedence over `add_metric_suffixes`.
54
54
-`send_metadata`: If set to true, prometheus metadata will be generated and sent. Default: false. This option is ignored when using PRW 2.0, which always includes metadata.
55
+
-`include_metadata_keys`: list of client metadata keys whose values are forwarded as HTTP headers on every outbound remote write request.
56
+
-**Note**: Keys that collide with headers required by the remote write protocol (`Content-Encoding`, `Content-Type`, `User-Agent`, `X-Prometheus-Remote-Write-Version`) are rejected: configuration validation fails (case-insensitive) if any such key is listed.
57
+
-**Note**: When WAL is enabled, then this setting has no effect. The WAL persists only the raw protobuf bytes of each write request; the originating `client.Info` context is not serialized to disk so initial metadata are lost.
55
58
-`remote_write_queue`: fine tuning for queueing and sending of the outgoing remote writes.
56
59
-`enabled`: enable the sending queue (default: `true`)
57
60
-`queue_size`: number of OTLP metrics that can be queued. Ignored if `enabled` is `false` (default: `10000`)
0 commit comments