Skip to content

Commit 42c1379

Browse files
authored
Append customer prometheus scrape configs (#1847)
Co-authored-by: Akansha Agarwal <agarakan@users.noreply.github.com>
1 parent 76b02e4 commit 42c1379

7 files changed

Lines changed: 720 additions & 28 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[agent]
2+
collection_jitter = "0s"
3+
debug = false
4+
flush_interval = "1s"
5+
flush_jitter = "0s"
6+
hostname = ""
7+
interval = "60s"
8+
logfile = "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log"
9+
logtarget = "lumberjack"
10+
metric_batch_size = 1000
11+
metric_buffer_limit = 10000
12+
omit_hostname = false
13+
precision = ""
14+
quiet = false
15+
round_interval = false
16+
17+
[outputs]
18+
19+
[[outputs.cloudwatch]]
20+
21+
[[outputs.cloudwatchlogs]]
22+
endpoint_override = "https://fake_endpoint"
23+
force_flush_interval = "5s"
24+
log_stream_name = "i-UNKNOWN"
25+
mode = "EC2"
26+
region = "us-west-2"
27+
region_type = "ACJ"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"agent": {
3+
"region": "us-west-2"
4+
},
5+
"metrics": {
6+
"metrics_destinations": {
7+
"cloudwatch": {},
8+
"amp": {
9+
"workspace_id": "ws-12345"
10+
}
11+
},
12+
"metrics_collected": {
13+
"prometheus": {
14+
"prometheus_config_path": "{prometheusFileName}"
15+
}
16+
}
17+
},
18+
"logs": {
19+
"metrics_collected": {
20+
"prometheus": {
21+
"prometheus_config_path": "{prometheusFileName}",
22+
"ecs_service_discovery": {
23+
"sd_result_file": "/tmp/cwagent_ecs_auto_sd.yaml",
24+
"docker_label": {},
25+
"task_definition_list": [
26+
{
27+
"sd_task_definition_arn_pattern": ".*:task-definition/nginx.*:[0-9]+",
28+
"metrics_path": "/metrics",
29+
"metrics_ports": "9113"
30+
}
31+
]
32+
},
33+
"emf_processor": {
34+
"metric_declaration_dedup": true,
35+
"metric_namespace": "ECS/ContainerInsights/Prometheus",
36+
"metric_unit": {},
37+
"metric_declaration": [
38+
{
39+
"source_labels": ["Service"],
40+
"label_matcher": "nginx.*",
41+
"dimensions": [["Service"]],
42+
"metric_selectors": ["^nginx_request_count$"]
43+
}
44+
]
45+
},
46+
"log_group_name": "/aws/ecs/containerinsights/TestCluster/prometheus"
47+
}
48+
},
49+
"force_flush_interval": 5,
50+
"endpoint_override": "https://fake_endpoint"
51+
}
52+
}

0 commit comments

Comments
 (0)