103 lines
1.8 KiB
Plaintext
103 lines
1.8 KiB
Plaintext
logging {
|
|
level = "debug"
|
|
|
|
// Forward internal logs to the local Loki instance.
|
|
write_to = [loki.relabel.alloy_logs.receiver]
|
|
}
|
|
|
|
loki.relabel "alloy_logs" {
|
|
rule {
|
|
target_label = "instance"
|
|
replacement = constants.hostname
|
|
}
|
|
|
|
rule {
|
|
target_label = "job"
|
|
replacement = "integrations/self"
|
|
}
|
|
|
|
forward_to = [loki.write.loki.receiver]
|
|
}
|
|
|
|
tracing {
|
|
// Write all spans. Don't do this in production!
|
|
sampling_fraction = 1.0
|
|
|
|
// Forward internal spans to the local Tempo instance.
|
|
write_to = [otelcol.exporter.otlp.tempo.input]
|
|
}
|
|
|
|
prometheus.exporter.self "alloy" {}
|
|
prometheus.scrape "alloy" {
|
|
targets = prometheus.exporter.self.alloy.targets
|
|
forward_to = [prometheus.remote_write.mimir.receiver]
|
|
}
|
|
|
|
pyroscope.scrape "default" {
|
|
targets = [
|
|
{"__address__" = "localhost:12345", "service_name" = "alloy"},
|
|
]
|
|
forward_to = [pyroscope.write.pyroscope.receiver]
|
|
}
|
|
|
|
prometheus.remote_write "mimir" {
|
|
endpoint {
|
|
url = string.format(
|
|
"http://%s/api/v1/receive",
|
|
coalesce(sys.env("REMOTE_WRITE_HOST"), "localhost:9009"),
|
|
)
|
|
}
|
|
}
|
|
|
|
loki.write "loki" {
|
|
endpoint {
|
|
url = string.format(
|
|
"http://%s/loki/api/v1/push",
|
|
coalesce(sys.env("LOKI_HOST"), "localhost:3100"),
|
|
)
|
|
}
|
|
}
|
|
|
|
otelcol.receiver.otlp "default" {
|
|
grpc {
|
|
endpoint = "alloy:4017"
|
|
}
|
|
|
|
http {
|
|
endpoint = "alloy:4018"
|
|
}
|
|
|
|
output {
|
|
metrics = [otelcol.exporter.otlp.tempo.input]
|
|
logs = [otelcol.exporter.otlp.tempo.input]
|
|
traces = [otelcol.exporter.otlp.tempo.input]
|
|
}
|
|
}
|
|
|
|
otelcol.exporter.otlp "tempo" {
|
|
client {
|
|
endpoint = coalesce(sys.env("TEMPO_HOST"), "localhost:4317")
|
|
|
|
wait_for_ready = true
|
|
|
|
tls {
|
|
insecure = true
|
|
}
|
|
}
|
|
|
|
sending_queue {
|
|
enabled = false
|
|
num_consumers = 100
|
|
queue_size = 10000
|
|
}
|
|
}
|
|
|
|
pyroscope.write "pyroscope" {
|
|
endpoint {
|
|
url = string.format(
|
|
"http://%s",
|
|
coalesce(sys.env("PYROSCOPE_HOST"), "localhost:4040"),
|
|
)
|
|
}
|
|
}
|