-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathconfig.alloy.j2
More file actions
75 lines (69 loc) · 2.2 KB
/
config.alloy.j2
File metadata and controls
75 lines (69 loc) · 2.2 KB
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
{# Alloy Configuration Template #}
{# Variables available:
- pyroscope: Pyroscope object
- endpoint: Pyroscope endpoint
- basic_auth: Pyroscope basic auth
- username
- password
- port: Pyroscope port
- execution_metrics: Execution client prometheus metrics object
- address: Execution client prometheus metrics address
- metrics_path: Execution client prometheus metrics path
- scrape_interval: Execution client prometheus metrics scrape interval
- scrape_timeout: Execution client prometheus metrics scrape timeout
- labels: Execution client prometheus metrics labels dictionary
- prometheus_rw: Prometheus remote write object
- endpoint: Prometheus remote write endpoint
- basic_auth: Prometheus remote write basic auth
- username
- password
#}
{% if pyroscope %}
pyroscope.receive_http "default" {
http {
listen_address = "0.0.0.0"
listen_port = {{ pyroscope.port }}
}
forward_to = [pyroscope.write.pyroscope_backend.receiver]
}
pyroscope.write "pyroscope_backend" {
endpoint {
url = "{{ pyroscope.endpoint }}"
{% if pyroscope.basic_auth %}
basic_auth {
username = "{{ pyroscope.basic_auth.username }}"
password = "{{ pyroscope.basic_auth.password }}"
}
{% endif %}
}
}
{% endif %}
{% if execution_metrics and prometheus_rw %}
prometheus.remote_write "prometheus_backend" {
endpoint {
url = "{{ prometheus_rw.endpoint }}"
{% if prometheus_rw.basic_auth %}
basic_auth {
username = "{{ prometheus_rw.basic_auth.username }}"
password = "{{ prometheus_rw.basic_auth.password }}"
}
{% endif %}
}
}
prometheus.scrape "execution" {
targets = [{
"__address__" = "{{ execution_metrics.address }}",
{% for key, value in execution_metrics.labels.items() %}
"{{ key }}" = "{{ value }}",
{% endfor %}
}]
forward_to = [prometheus.remote_write.prometheus_backend.receiver]
{% if execution_metrics.scrape_interval %}
scrape_interval = "{{ execution_metrics.scrape_interval }}"
{% endif %}
{% if execution_metrics.scrape_timeout %}
scrape_timeout = "{{ execution_metrics.scrape_timeout }}"
{% endif %}
metrics_path = "{{ execution_metrics.metrics_path }}"
}
{% endif %}