-
Notifications
You must be signed in to change notification settings - Fork 18
/
module.river
101 lines (79 loc) · 2.09 KB
/
module.river
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
97
98
99
100
101
/********************************************
* ARGUMENTS
********************************************/
argument "prometheus_endpoint" { }
argument "prometheus_user" { }
argument "prometheus_password" { }
argument "loki_endpoint" { }
argument "loki_user" { }
argument "loki_password" { }
argument "tempo_endpoint" { }
argument "tempo_user" { }
argument "tempo_password" { }
argument "grafana_agent_port" {
optional = true
default = "12345"
}
/********************************************
* EXPORTS
********************************************/
export "log_receiver" {
value = loki.write.default.receiver
}
export "trace_input" {
value = otelcol.processor.batch.default.input
}
/********************************************
* AGENT METRICS
********************************************/
prometheus.remote_write "default" {
endpoint {
url = argument.prometheus_endpoint.value
basic_auth {
username = argument.prometheus_user.value
password = argument.prometheus_password.value
}
}
}
prometheus.scrape "default" {
targets = [{"__address__" = "0.0.0.0:" + argument.grafana_agent_port.value}]
forward_to = [prometheus.remote_write.default.receiver]
scrape_interval = "10s"
}
/********************************************
* AGENT LOGGING
********************************************/
loki.write "default" {
endpoint {
url = argument.loki_endpoint.value
basic_auth {
username = argument.loki_user.value
password = argument.loki_password.value
}
}
}
/********************************************
* AGENT TRACING
********************************************/
otelcol.processor.batch "default" {
output {
traces = [otelcol.processor.memory_limiter.default.input]
}
}
otelcol.processor.memory_limiter "default" {
check_interval = "1s"
limit = "150MiB"
output {
traces = [otelcol.exporter.otlp.default.input]
}
}
otelcol.auth.basic "default" {
username = argument.tempo_user.value
password = argument.tempo_password.value
}
otelcol.exporter.otlp "default" {
client {
endpoint = argument.tempo_endpoint.value
auth = otelcol.auth.basic.default.handler
}
}