Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions grafana-alloy/config.central-template.alloy
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
logging {
level = "debug"
format = "logfmt"
}

// Receivers
otelcol.receiver.otlp "otlp_receiver" {
grpc {
endpoint = "127.0.0.1:4317"
}
http {
endpoint = "127.0.0.1:4318"
}

output {
logs = [otelcol.processor.batch.default.input]
traces = [otelcol.processor.batch.default.input]
}
}

otelcol.processor.batch "default" {
output {
logs = [otelcol.exporter.loki.default.input]
traces = [otelcol.processor.attributes.custom_labels.input]
}
}

otelcol.processor.attributes "custom_labels" {
action {
key = "host"
action = "insert"
// Insert host name here:
value = "{HOSTNAME}"
}
output {
traces = [otelcol.exporter.otlp.sov_tempo.input]
}
}

// Exporters

// Tempo
otelcol.exporter.otlp "sov_tempo" {
client {
endpoint = "{TEMPO_HOST}"
auth = otelcol.auth.basic.sov_tempo.handler
}
}

otelcol.auth.basic "sov_tempo" {
username = "{ALLOY_USER}"
password = "{ALLOY_PASSWORD}"
}


// OTLP -> Loki
otelcol.exporter.loki "default" {
forward_to = [
loki.process.add_hostname.receiver,
]
}

loki.process "add_hostname" {
forward_to = [
loki.write.sov_loki.receiver,
]

stage.static_labels {
values = {
host = "{HOSTNAME}",
}
}
}

// Sovereign Loki
loki.write "sov_loki" {
endpoint {
url = "https://{LOKI_HOST}/loki/api/v1/push"

basic_auth {
username = "{ALLOY_USER}"
password = "{ALLOY_PASSWORD}"
}
}
}
8 changes: 4 additions & 4 deletions grafana-alloy/config.cloud.alloy
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ logging {
// Receivers
otelcol.receiver.otlp "otlp_receiver" {
grpc {
endpoint = "0.0.0.0:4317"
endpoint = "127.0.0.1:4317"
}
http {
endpoint = "0.0.0.0:4318"
endpoint = "127.0.0.1:4318"
}

output {
Expand Down Expand Up @@ -48,8 +48,8 @@ otelcol.exporter.otlp "grafanacloud" {

// Tempo: auth
otelcol.auth.basic "grafanacloud" {
username = "1071746"
password = "glc_1"
username = "1071746"
password = "glc_1"
}

// OTLP -> Loki
Expand Down