diff --git a/grafana-alloy/config.alloy.tpl b/grafana-alloy/config.alloy.tpl index 172d09d..3ae3439 100644 --- a/grafana-alloy/config.alloy.tpl +++ b/grafana-alloy/config.alloy.tpl @@ -75,6 +75,20 @@ otelcol.exporter.otlphttp "greptimedb_logs" { } } +loki.write "greptime_loki" { + endpoint { + url = "${GREPTIME_SCHEME:=http}://${GREPTIME_HOST:=greptimedb}:${GREPTIME_PORT:=4000}/v1/loki/api/v1/push" + headers = { + "X-Greptime-DB-Name" = "${GREPTIME_DB:=public}", + "X-Greptime-Log-Table-Name" = "${GREPTIME_LOG_TABLE_NAME:=loki_demo_logs}", + } + } + external_labels = { + "job" = "greptime", + "from" = "alloy", + } +} + otelcol.auth.basic "credentials" { username = "${GREPTIME_USERNAME}" password = "${GREPTIME_PASSWORD}" @@ -88,7 +102,7 @@ otelcol.processor.attributes "enrichment" { } output { - logs = [otelcol.exporter.otlphttp.greptimedb_logs.input] + logs = [otelcol.exporter.otlphttp.greptimedb_logs.input, loki.write.greptime_loki.receiver] } } diff --git a/grafana-alloy/docker-compose.yml b/grafana-alloy/docker-compose.yml index 8654dc1..3f37fa1 100644 --- a/grafana-alloy/docker-compose.yml +++ b/grafana-alloy/docker-compose.yml @@ -11,7 +11,7 @@ services: init: true greptimedb: - image: docker.io/greptime/greptimedb:v0.10.0-nightly-20241104 + image: docker.io/greptime/greptimedb:v0.11.0-nightly-20241125 command: standalone start --http-addr=0.0.0.0:4000 --rpc-addr=0.0.0.0:4001 --mysql-addr=0.0.0.0:4002 --postgres-addr 0.0.0.0:4003 ports: - 4000:4000