Skip to content

Commit

Permalink
Agent modules: rename docker_compose to local
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>

improve jaeger environment

Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Mar 17, 2024
1 parent 501da3d commit bf6e33b
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 69 deletions.
6 changes: 3 additions & 3 deletions docker-compose/common/config/agent-flow/logs.river
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]
}
}
6 changes: 3 additions & 3 deletions docker-compose/common/config/agent-flow/metrics.river
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Module: Docker Compose
Module: Local
Description: Grafana LGTMP Stack Receiver Provider
*/

Expand Down Expand Up @@ -40,43 +40,43 @@ 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
}

/********************************************
* Endpoints
********************************************/

// Metrics
prometheus.remote_write "docker_compose" {
prometheus.remote_write "local" {
endpoint {
url = argument.metrics_endpoint.value + "/api/v1/push"
send_native_histograms = true
}
}

// Logs
loki.write "docker_compose" {
loki.write "local" {
endpoint {
url = argument.logs_endpoint.value + "/loki/api/v1/push"
tenant_id = argument.tenant.value
}
}

// Traces
otelcol.exporter.otlp "docker_compose" {
otelcol.exporter.otlp "local" {
client {
endpoint = argument.traces_endpoint.value

Expand All @@ -88,7 +88,7 @@ otelcol.exporter.otlp "docker_compose" {
}

// Profiles
pyroscope.write "docker_compose" {
pyroscope.write "local" {
endpoint {
url = argument.profiles_endpoint.value
}
Expand Down
20 changes: 10 additions & 10 deletions docker-compose/common/config/agent-flow/monolithic-mode-all.river
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
}
Expand All @@ -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,
]
}
}
Expand All @@ -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]
}
}

Expand All @@ -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
}
}
6 changes: 3 additions & 3 deletions docker-compose/common/config/agent-flow/profiles.river
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
}
12 changes: 6 additions & 6 deletions docker-compose/common/config/agent-flow/traces.river
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
}
Expand All @@ -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]
}
}

Expand Down
44 changes: 19 additions & 25 deletions docker-compose/microservices-mode/traces/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand Down
28 changes: 18 additions & 10 deletions docker-compose/monolithic-mode/all-in-one/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"

Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"

Expand All @@ -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"

Expand Down

0 comments on commit bf6e33b

Please sign in to comment.