amazon-cloudwatch-agent
amazon-cloudwatch-agent copied to clipboard
Support Otel Prometheus receiver for AMP as a destination
Description of changes
Support Otel Prometheus receiver with a new pipeline to export to AMP
Related contrib change to add marshaler https://github.com/amazon-contributing/opentelemetry-collector-contrib/pull/239
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Started a python local server with test prom metrics:
prometheus_test_untyped{include="yes",prom_type="untyped"} 1
# TYPE prometheus_test_counter counter
prometheus_test_counter{include="yes",prom_type="counter"} 1
# TYPE prometheus_test_counter_exclude counter
prometheus_test_counter_exclude{include="no",prom_type="counter"} 1
# TYPE prometheus_test_summary summary
prometheus_test_summary_sum{include="yes",prom_type="summary"} 200
prometheus_test_summary_count{include="yes",prom_type="summary"} 50
prometheus_test_summary{include="yes",quantile="0",prom_type="summary"} 0.1
prometheus_test_summary{include="yes",quantile="0.5",prom_type="summary"} 0.25
prometheus_test_summary{include="yes",quantile="1",prom_type="summary"} 0.5
# TYPE prometheus_test_histogram histogram
prometheus_test_histogram_sum{include="yes",prom_type="histogram"} 200
prometheus_test_histogram_count{include="yes",prom_type="histogram"} 75
prometheus_test_histogram{include="yes",le="0",prom_type="histogram"} 1
prometheus_test_histogram{include="yes",le="0.5",prom_type="histogram"} 2
prometheus_test_histogram{include="yes",le="2.5",prom_type="histogram"} 3
prometheus_test_histogram{include="yes",le="5",prom_type="histogram"} 4
prometheus_test_histogram{include="yes",le="+Inf",prom_type="histogram"} 5
Tested the agent on EC2 to verify metrics being pushed to AMP
- agent config:
{
"agent": {
"metric_collection_internal": 10,
"run_as_user": "root",
"debug": true
},
"metrics": {
"metrics_destinations": {
"amp": {
"workspace_id": "[amp_ws_id]"
}
},
"metrics_collected": {
"prometheus": {
"prometheus_config_path": "/home/ec2-user/prometheus.yaml"
}
}
}
}
- prometheus config:
global:
scrape_interval: 60s
scrape_timeout: 10s
scrape_configs:
- job_name: 'prometheus_test_job'
static_configs:
- targets: ['localhost:8000']
labels:
label1: 'test1'
Requirements
Before commit the code, please do the following steps.
- Run
make fmtandmake fmt-sh - Run
make lint
Need to rebase on the target-allocator branch.
Think you need to rebase onto target-allocator again.