-
Notifications
You must be signed in to change notification settings - Fork 230
Adding cloudwatch as destination for prometheus #1742
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?
Conversation
338c803
to
fc7f40a
Compare
if conf.IsSet(LogsKey) { | ||
destinations = append(destinations, common.CloudWatchLogsKey) | ||
} | ||
if conf.IsSet(MetricsKey) { | ||
if conf.IsSet(prometheusremotewrite.AMPSectionKey) { | ||
destinations = append(destinations, common.AMPKey) | ||
} | ||
|
||
if !conf.IsSet(common.ConfigKey(common.MetricsKey, common.MetricsDestinationsKey)) || conf.IsSet(common.ConfigKey(common.MetricsKey, common.MetricsDestinationsKey, common.CloudWatchKey)) { | ||
destinations = append(destinations, common.CloudWatchKey) | ||
} | ||
|
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.
There's a function in common
that will get the destinations for you. It's currently used in the jmx
pipeline.
destinations := common.GetMetricsDestinations(conf) |
// otel_prometheus - cloudwatch | ||
// telegraf_prometheus - cloudwatch logs | ||
// telegraf_prometheus - cloudwatch |
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.
nit: Makes it seem like the telegraf prometheus plugin can send to CW/PMD and CWL/PLE when that is not the case.
06facb7
to
31c9339
Compare
31c9339
to
f339746
Compare
933e2d9
to
7196713
Compare
aef2b67
to
e341736
Compare
e341736
to
92af811
Compare
@@ -33,7 +34,7 @@ func TestTranslators(t *testing.T) { | |||
}, | |||
}, | |||
want: []pipeline.ID{ | |||
pipeline.MustNewIDWithName("metrics", "prometheus/amp"), |
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.
Is the intention to default to CloudWatch (PMD) if no destinations are set? If so, I think this should be prometheus/cloudwatch
, right?
log.Println(testCase.want) | ||
log.Println(got) |
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.
left over debug logs?
Description of the issue
Currently Prometheus does not support Cloudwatch as a destination, users can only use Cloudwatch Logs or AMP in order to get Prometheus metrics. This pr adds the ability to have Cloudwatch be a destination for Prometheus metrics.
Description of changes
Adding Cloudwatch destination for Prometheus metrics.
Verified metrics pop up on cloudwatch:

Test setup:
agent config:
Prometheus yaml:
Prometheus metrics file:
Starting prometheus server:
sudo python3 -m http.server 8101 --directory /home/ec2-user/prometheus &> /dev/null &