-
Notifications
You must be signed in to change notification settings - Fork 3
/
agent.yaml
96 lines (93 loc) · 2.61 KB
/
agent.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
server:
log_level: error
log_format: logfmt
metrics:
global:
scrape_interval: 5s
external_labels:
cluster: test
namespace: monitoring
remote_write:
- url: http://nginx:3702/api/v1/push
send_exemplars: true
# Add X-Scope-OrgID header so that Mimir knows what tenant the remote write data should be stored in.
# In this case, our tenant is "backend"
headers:
X-Scope-OrgID: backend
wal_directory: "/tmp/agent/prom"
configs:
- name: "backend-metrics"
scrape_configs:
- job_name: "backend_fastapi"
static_configs:
- targets: ['backend:5050']
# - name: "myapp-metrics"
# scrape_configs:
# - job_name: "backend_flask"
# static_configs:
# - targets: ['myapp:5055']
- name: "loki-metrics"
scrape_configs:
- job_name: "loki_metrics"
static_configs:
- targets: ['nginx:3502']
- name: "tempo-metrics"
scrape_configs:
- job_name: "tempo_metrics"
static_configs:
- targets: ['nginx:4602']
- name: "mimir-metrics"
scrape_configs:
- job_name: "monitoring/mimir"
static_configs:
- targets: ['nginx:4702']
- name: "postgres-metrics"
scrape_configs:
- job_name: "postgres_metrics"
static_configs:
- targets: ['db_exporter:9187']
- name: "cadvisor-metrics"
scrape_configs:
- job_name: "cadvisor_metrics"
static_configs:
- targets: ['cadvisor:8080']
- name: "mimir-continuous-tests-metrics"
scrape_configs:
- job_name: "mimir-continuous-tests_metrics"
static_configs:
- targets: ['mimir-continuous-test:8085']
logs:
configs:
- name: "backend-logs"
clients:
- url: http://nginx:3502/loki/api/v1/push
positions:
filename: "/tmp/agent/loki.yaml"
scrape_configs:
# This value should be a problem --> https://github.com/grafana/loki/issues/7275
- job_name: "backend_fastapi"
loki_push_api:
server:
http_listen_port: 3501
labels:
agent_from: grafana_agent
traces:
configs:
- name: "backend-traces"
attributes:
actions:
- action: insert
key: tempo.attribute.labels
value: "backend_fastapi"
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:3601
remote_write:
- endpoint: http://nginx:3602
insecure: true
protocol: http
automatic_logging:
backend: "stdout"
spans: true