diff --git a/docker-compose/common/config/agent-flow/logs.river b/docker-compose/common/config/agent-flow/logs.river index b94f4acd..d83edd75 100644 --- a/docker-compose/common/config/agent-flow/logs.river +++ b/docker-compose/common/config/agent-flow/logs.river @@ -9,8 +9,8 @@ logging { * Grafana LGTMP Stack Receiver Provider ********************************************/ -module.file "local" { - filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker_compose.river" +module.file "lgtmp_provider_local" { + filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river" arguments { logs_endpoint = "http://gateway:3100" @@ -25,6 +25,6 @@ module.file "logs_primary" { filename = env("AGENT_CONFIG_FOLDER") + "/modules/docker/logs/all.river" arguments { - forward_to = [module.file.local.exports.logs_receiver] + forward_to = [module.file.lgtmp_provider_local.exports.logs_receiver] } } diff --git a/docker-compose/common/config/agent-flow/metrics.river b/docker-compose/common/config/agent-flow/metrics.river index 12593f7c..20fb44fc 100644 --- a/docker-compose/common/config/agent-flow/metrics.river +++ b/docker-compose/common/config/agent-flow/metrics.river @@ -9,8 +9,8 @@ logging { * Grafana LGTMP Stack Receiver Provider ********************************************/ -module.file "local" { - filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker_compose.river" +module.file "lgtmp_provider_local" { + filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river" arguments { metrics_endpoint = "http://gateway:8080" @@ -25,7 +25,7 @@ module.file "metrics_primary" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river" arguments { - forward_to = [module.file.local.exports.metrics_receiver] + forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver] clustering = true } } diff --git a/docker-compose/common/config/agent-flow/modules/docker_compose.river b/docker-compose/common/config/agent-flow/modules/local.river similarity index 80% rename from docker-compose/common/config/agent-flow/modules/docker_compose.river rename to docker-compose/common/config/agent-flow/modules/local.river index 6a1d6bea..4dbdcfec 100644 --- a/docker-compose/common/config/agent-flow/modules/docker_compose.river +++ b/docker-compose/common/config/agent-flow/modules/local.river @@ -1,5 +1,5 @@ /* -Module: Docker Compose +Module: Local Description: Grafana LGTMP Stack Receiver Provider */ @@ -40,19 +40,19 @@ argument "profiles_endpoint" { ********************************************/ export "metrics_receiver" { - value = prometheus.remote_write.docker_compose.receiver + value = prometheus.remote_write.local.receiver } export "logs_receiver" { - value = loki.write.docker_compose.receiver + value = loki.write.local.receiver } export "traces_receiver" { - value = otelcol.exporter.otlp.docker_compose.input + value = otelcol.exporter.otlp.local.input } export "profiles_receiver" { - value = pyroscope.write.docker_compose.receiver + value = pyroscope.write.local.receiver } /******************************************** @@ -60,7 +60,7 @@ export "profiles_receiver" { ********************************************/ // Metrics -prometheus.remote_write "docker_compose" { +prometheus.remote_write "local" { endpoint { url = argument.metrics_endpoint.value + "/api/v1/push" send_native_histograms = true @@ -68,7 +68,7 @@ prometheus.remote_write "docker_compose" { } // Logs -loki.write "docker_compose" { +loki.write "local" { endpoint { url = argument.logs_endpoint.value + "/loki/api/v1/push" tenant_id = argument.tenant.value @@ -76,7 +76,7 @@ loki.write "docker_compose" { } // Traces -otelcol.exporter.otlp "docker_compose" { +otelcol.exporter.otlp "local" { client { endpoint = argument.traces_endpoint.value @@ -88,7 +88,7 @@ otelcol.exporter.otlp "docker_compose" { } // Profiles -pyroscope.write "docker_compose" { +pyroscope.write "local" { endpoint { url = argument.profiles_endpoint.value } diff --git a/docker-compose/common/config/agent-flow/monolithic-mode-all.river b/docker-compose/common/config/agent-flow/monolithic-mode-all.river index d216bce0..6b462350 100644 --- a/docker-compose/common/config/agent-flow/monolithic-mode-all.river +++ b/docker-compose/common/config/agent-flow/monolithic-mode-all.river @@ -9,12 +9,12 @@ logging { * Grafana LGTMP Stack Receiver Provider ********************************************/ -module.file "local" { - filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker_compose.river" +module.file "lgtmp_provider_local" { + filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river" } /* -module.file "grafana_cloud" { +module.file "lgtmp_provider_grafana_cloud" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/grafana_cloud.river" arguments { @@ -32,7 +32,7 @@ module.file "metrics_primary" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river" arguments { - forward_to = [module.file.local.exports.metrics_receiver] + forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver] clustering = true } } @@ -46,8 +46,8 @@ module.file "logs_primary" { arguments { forward_to = [ - module.file.local.exports.logs_receiver, - // module.file.grafana_cloud.exports.logs_receiver, + module.file.lgtmp_provider_local.exports.logs_receiver, + // module.file.lgtmp_provider_grafana_cloud.exports.logs_receiver, ] } } @@ -59,9 +59,9 @@ module.file "traces_primary" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/traces/all.river" arguments { - metrics_forward_to = [module.file.local.exports.metrics_receiver] - logs_forward_to = [module.file.local.exports.logs_receiver] - traces_forward_to = [module.file.local.exports.traces_receiver] + metrics_forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver] + logs_forward_to = [module.file.lgtmp_provider_local.exports.logs_receiver] + traces_forward_to = [module.file.lgtmp_provider_local.exports.traces_receiver] } } @@ -78,7 +78,7 @@ module.file "profiles_primary" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/profiles/all.river" arguments { - forward_to = [module.file.local.exports.profiles_receiver] + forward_to = [module.file.lgtmp_provider_local.exports.profiles_receiver] clustering = true } } diff --git a/docker-compose/common/config/agent-flow/profiles.river b/docker-compose/common/config/agent-flow/profiles.river index f5a05774..2ac93ac6 100644 --- a/docker-compose/common/config/agent-flow/profiles.river +++ b/docker-compose/common/config/agent-flow/profiles.river @@ -9,8 +9,8 @@ logging { * Grafana LGTMP Stack Receiver Provider ********************************************/ -module.file "local" { - filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker_compose.river" +module.file "lgtmp_provider_local" { + filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river" arguments { profiles_endpoint = "http://gateway:4040" @@ -25,7 +25,7 @@ module.file "profiles_primary" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/profiles/all.river" arguments { - forward_to = [module.file.local.exports.profiles_receiver] + forward_to = [module.file.lgtmp_provider_local.exports.profiles_receiver] clustering = true } } diff --git a/docker-compose/common/config/agent-flow/traces.river b/docker-compose/common/config/agent-flow/traces.river index 5a800b6c..950a7511 100644 --- a/docker-compose/common/config/agent-flow/traces.river +++ b/docker-compose/common/config/agent-flow/traces.river @@ -9,8 +9,8 @@ logging { * Grafana LGTMP Stack Receiver Provider ********************************************/ -module.file "local" { - filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker_compose.river" +module.file "lgtmp_provider_local" { + filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river" arguments { metrics_endpoint = "http://gateway:8080" @@ -26,7 +26,7 @@ module.file "metrics_primary" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river" arguments { - forward_to = [module.file.local.exports.metrics_receiver] + forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver] clustering = true } } @@ -38,9 +38,9 @@ module.file "traces_primary" { filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/traces/all.river" arguments { - metrics_forward_to = [module.file.local.exports.metrics_receiver] - logs_forward_to = [module.file.local.exports.logs_receiver] - traces_forward_to = [module.file.local.exports.traces_receiver] + metrics_forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver] + logs_forward_to = [module.file.lgtmp_provider_local.exports.logs_receiver] + traces_forward_to = [module.file.lgtmp_provider_local.exports.traces_receiver] } } diff --git a/docker-compose/microservices-mode/traces/docker-compose.yaml b/docker-compose/microservices-mode/traces/docker-compose.yaml index 5c9851cb..578846f3 100644 --- a/docker-compose/microservices-mode/traces/docker-compose.yaml +++ b/docker-compose/microservices-mode/traces/docker-compose.yaml @@ -12,6 +12,12 @@ include: - path: ../../common/compose-include/load-mimir-rule.yaml - path: ../../common/compose-include/load-tempo-rule.yaml +x-environment: &jaeger-environment + JAEGER_AGENT_HOST: agent + JAEGER_AGENT_PORT: 6831 + JAEGER_SAMPLER_TYPE: const + JAEGER_SAMPLER_PARAM: 1 + services: gateway: depends_on: @@ -55,11 +61,8 @@ services: - -target=distributor - -config.expand-env=true environment: - - JAEGER_AGENT_HOST=agent - - JAEGER_AGENT_PORT=6831 - - JAEGER_TAGS=app=distributor - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 + <<: *jaeger-environment + JAEGER_TAGS: app=distributor healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ] interval: 15s @@ -79,11 +82,8 @@ services: - -target=ingester - -config.expand-env=true environment: - - JAEGER_AGENT_HOST=agent - - JAEGER_AGENT_PORT=6831 - - JAEGER_TAGS=app=ingester - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 + <<: *jaeger-environment + JAEGER_TAGS: app=ingester deploy: replicas: 3 networks: @@ -103,11 +103,8 @@ services: - -target=query-frontend - -config.expand-env=true environment: - - JAEGER_AGENT_HOST=agent - - JAEGER_AGENT_PORT=6831 - - JAEGER_TAGS=app=query-frontend - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 + <<: *jaeger-environment + JAEGER_TAGS: app=query-frontend querier: depends_on: @@ -123,11 +120,8 @@ services: - -target=querier - -config.expand-env=true environment: - - JAEGER_AGENT_HOST=agent - - JAEGER_AGENT_PORT=6831 - - JAEGER_TAGS=app=querier - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 + <<: *jaeger-environment + JAEGER_TAGS: app=querier compactor: depends_on: @@ -140,11 +134,8 @@ services: - -config.file=/etc/tempo.yaml - -target=compactor environment: - - JAEGER_AGENT_HOST=agent - - JAEGER_AGENT_PORT=6831 - - JAEGER_TAGS=app=compactor - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 + <<: *jaeger-environment + JAEGER_TAGS: app=compactor mimir: depends_on: @@ -157,6 +148,9 @@ services: - -config.file=/etc/config.yaml - -target=all - -config.expand-env=true + environment: + <<: *jaeger-environment + JAEGER_TAGS: app=mimir healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080/ready || exit 1" ] interval: 10s diff --git a/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml b/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml index edde66e1..c5db4961 100644 --- a/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml +++ b/docker-compose/monolithic-mode/all-in-one/docker-compose.yaml @@ -9,6 +9,12 @@ version: '3.9' include: - path: ../../common/compose-include/minio.yaml +x-environment: &jaeger-environment + JAEGER_AGENT_HOST: agent + JAEGER_AGENT_PORT: 6831 + JAEGER_SAMPLER_TYPE: const + JAEGER_SAMPLER_PARAM: 1 + services: agent: labels: @@ -35,6 +41,7 @@ services: environment: - AGENT_MODE=flow - AGENT_CONFIG_FOLDER=/etc/agent-config + # expose 12345 port so we can directly access grafana-agent inside container ports: - "12345:12345" @@ -52,11 +59,15 @@ services: - -target=all - -config.expand-env=true - -ruler.max-rules-per-rule-group=50 + environment: + <<: *jaeger-environment + JAEGER_TAGS: app=mimir healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080/ready || exit 1" ] interval: 10s timeout: 5s retries: 5 + # expose 38080 port so we can directly access mimir inside container ports: - "38080:8080" networks: @@ -104,16 +115,14 @@ services: - -target=all - -config.expand-env=true environment: - - JAEGER_AGENT_HOST=agent - - JAEGER_AGENT_PORT=6831 - - JAEGER_TAGS=app=loki - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 + <<: *jaeger-environment + JAEGER_TAGS: app=loki healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ] interval: 10s timeout: 5s retries: 5 + # expose 33100 port so we can directly access loki inside container ports: - "33100:3100" networks: @@ -142,16 +151,14 @@ services: - -target=all - -config.expand-env=true environment: - - JAEGER_AGENT_HOST=agent - - JAEGER_AGENT_PORT=6831 - - JAEGER_TAGS=app=tempo - - JAEGER_SAMPLER_TYPE=const - - JAEGER_SAMPLER_PARAM=1 + <<: *jaeger-environment + JAEGER_TAGS: app=tempo healthcheck: test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3200/ready || exit 1" ] interval: 10s timeout: 5s retries: 5 + # expose 33200 port so we can directly access tempo inside container ports: - "33200:3200" @@ -168,6 +175,7 @@ services: command: - -config.file=/etc/config.yaml - -config.expand-env=true + # expose 34040 port so we can directly access pyroscope inside container ports: - "34040:4040"