Skip to content

Commit 392e48c

Browse files
authored
fix: add authentication for alloy loki write (#97)
1 parent 19fb101 commit 392e48c

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

grafana-alloy/config.alloy.tpl

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,21 @@ otelcol.exporter.otlphttp "greptimedb_logs" {
7676
}
7777

7878
loki.write "greptime_loki" {
79-
endpoint {
80-
url = "${GREPTIME_SCHEME:=http}://${GREPTIME_HOST:=greptimedb}:${GREPTIME_PORT:=4000}/v1/loki/api/v1/push"
81-
headers = {
82-
"x-greptime-db-name" = "${GREPTIME_DB:=public}",
83-
"x-greptime-log-table-name" = "${GREPTIME_LOG_TABLE_NAME:=loki_demo_logs}",
84-
}
79+
endpoint {
80+
url = "${GREPTIME_SCHEME:=http}://${GREPTIME_HOST:=greptimedb}:${GREPTIME_PORT:=4000}/v1/loki/api/v1/push"
81+
headers = {
82+
"x-greptime-db-name" = "${GREPTIME_DB:=public}",
83+
"x-greptime-log-table-name" = "${GREPTIME_LOG_TABLE_NAME:=loki_demo_logs}",
8584
}
86-
external_labels = {
87-
"job" = "greptime",
88-
"from" = "alloy",
85+
basic_auth {
86+
username = "${GREPTIME_USERNAME}"
87+
password = "${GREPTIME_PASSWORD}"
8988
}
89+
}
90+
external_labels = {
91+
"job" = "greptime",
92+
"from" = "alloy",
93+
}
9094
}
9195

9296
otelcol.auth.basic "credentials" {

0 commit comments

Comments
 (0)