diff --git a/grafana-alloy/config.alloy.tpl b/grafana-alloy/config.alloy.tpl index 4e76f12..51d8444 100644 --- a/grafana-alloy/config.alloy.tpl +++ b/grafana-alloy/config.alloy.tpl @@ -84,11 +84,25 @@ loki.source.file "greptime" { targets = [ {__path__ = "/tmp/foo.txt"}, ] - forward_to = [otelcol.receiver.loki.greptime.receiver] + forward_to = [otelcol.receiver.loki.greptime.receiver, loki.write.greptime_loki.receiver] } otelcol.receiver.loki "greptime" { output { logs = [otelcol.exporter.otlphttp.greptimedb_logs.input] } +} + +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", + } } \ No newline at end of file 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