-
Notifications
You must be signed in to change notification settings - Fork 214
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
The parameter logs.metrics_collected.prometheus.emf_processor.metric_declaration.metric_selectors without any function #1544
Comments
The metric selectors get used in the EMF exporter as a way to filter the metrics and metrics that don't match any of the patterns should get dropped. As an example, amazon-cloudwatch-agent/translator/tocwconfig/sampleConfig/prometheus_config_linux.json Lines 55 to 82 in 5e3b831
amazon-cloudwatch-agent/translator/tocwconfig/sampleConfig/prometheus_config_linux.yaml Lines 16 to 55 in 5e3b831
Can you provide a more complete configuration? |
Thank you for the answer. Yes, of course, here is it:
The metric spring_data_repository_invocations_seconds_max is only one I want to have in cloud watch. But I see all of them of my application. |
Describe the bug
I whant to use the parameter
logs.metrics_collected.prometheus.emf_processor.metric_declaration.metric_selectors
in order to send only metrics I whant to AWS Cloud Watch, as described in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-Setup-configure.html:_metric_declaration— are sections that specify the array of logs with embedded metric format to be generated. There are metric_declaration sections for each Prometheus source that the CloudWatch agent imports from by default. These sections each include the following fields:
label_matcher is a regular expression that checks the value of the labels listed in source_labels. The metrics that match are enabled for inclusion in the embedded metric format sent to CloudWatch.
If you have multiple labels specified in source_labels, we recommend that you do not use ^ or $ characters in the regular expression for label_matcher.
source_labels specifies the value of the labels that are checked by the label_matcher line.
label_separator specifies the separator to be used in the label_matcher line if multiple source_labels are specified. The default is ;. You can see this default used in the label_matcher line in the following example.
metric_selectors is a regular expression that specifies the metrics to be collected and sent to CloudWatch.
dimensions is the list of labels to be used as CloudWatch dimensions for each selected metric._
====================================================================================
But no matter how i set
metric_selectors
, it doesn't have any effect: all scrapped metrics are sent to Cloud Watch.Steps to reproduce
Set metric_selectors to any existing metric name
What did you expect to see?
Only this metric in Cloud Watch
What did you see instead?
All metrics which prometheus had scrapped from my application
What version did you use?
1.300051.0b992
What config did you use?
Environment
OS: Ubuntu
Additional context
I've researched in the code of cw agent here on github and i didn't find any usage of the variable MetricSeclector, which is set by the parameter
metric_selctor
.My cloud watch agent runs inside of a EKS-Cluster in the same AWS-Account as Cloud Watch.
The text was updated successfully, but these errors were encountered: