-
Notifications
You must be signed in to change notification settings - Fork 393
metrics enrich component #4018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
metrics enrich component #4018
Conversation
docs/sources/reference/components/prometheus/prometheus.enrich.md
Outdated
Show resolved
Hide resolved
The `prometheus.enrich` component enriches metrics with additional labels from service discovery targets. | ||
It matches a label from incoming metrics against a label from discovered targets, and copies specified labels from the matched target to the metric sample. | ||
|
||
## Usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, the Usage section doesn't go into depth with explanations in comments. This section usually just details the high level structure for the component configuration.
docs/sources/reference/components/prometheus/prometheus.enrich.md
Outdated
Show resolved
Hide resolved
docs/sources/reference/components/prometheus/prometheus.enrich.md
Outdated
Show resolved
Hide resolved
docs/sources/reference/components/prometheus/prometheus.enrich.md
Outdated
Show resolved
Hide resolved
Docs look Ok for now. Now it's over to the dev team for a code review. |
Hi, @ArkovKonstantin, thank you for the PR! Have you tried using array.combine_maps? We introduced it to solve similar issues in a more general way. |
Hi, @ptodev Yes, I tried using the Because of this limitation, I decided to propose an implementation of the Below is an examples of how to use the
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM! I just added a few minor comments. I'll speak with other colleagues about the PR today, to give them a heads up, but I'm personally happy with it.
metrics_match_label = "<LABEL>" | ||
|
||
labels_to_copy = ["<LABEL>", ...] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metrics_match_label = "<LABEL>" | |
labels_to_copy = ["<LABEL>", ...] | |
The Usage section is for minimal usage. It only lists mandatory arguments and blocks.
* `prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. | ||
* `prometheus_target_cache_size` (gauge): Total size of targets cache. | ||
|
||
## Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind also adding the prometheus.receive_http
example from this comment please?
{{< docs/shared lookup="stability/experimental.md" source="alloy" version="<ALLOY_VERSION>" >}} | ||
|
||
The `prometheus.enrich` component enriches metrics with additional labels from service discovery targets. | ||
It matches a label from incoming metrics against a label from discovered targets, and copies specified labels from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to mention that if a match doesn't happen, the metrics will be passed through.
|
||
* `prometheus_fanout_latency` (histogram): Write latency for sending to direct and indirect components. | ||
* `prometheus_forwarded_samples_total` (counter): Total number of samples sent to downstream components. | ||
* `prometheus_target_cache_size` (gauge): Total size of targets cache. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `prometheus_target_cache_size` (gauge): Total size of targets cache. | |
* `prometheus_target_cache_size` (gauge): The number of targets in the `targets` list. |
@ArkovKonstantin btw another issue with |
PR Description
This PR contains an implementation of the component
prometheus.enrich
described in this proposalNotes to the Reviewer
The integration test demonstrates the enrichment of metrics collected from the
prom-gen
service using file-based discovery samplePR Checklist