Skip to content

Commit

Permalink
Merge pull request #63 from qclaogui:agent-metrics-collection
Browse files Browse the repository at this point in the history
Agents always enable metrics collection
  • Loading branch information
qclaogui authored Mar 23, 2024
2 parents 6f6e012 + f963275 commit c675d52
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 25 deletions.
3 changes: 1 addition & 2 deletions docker-compose/common/compose-include/agent-collect-all.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

services:
agent-all-in-one:
grafana-agent:
labels:
logs.agent.grafana.com/log-format: logfmt
app: grafana-agent
depends_on:
gateway:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

services:
agent-logs:
grafana-agent:
labels:
logs.agent.grafana.com/log-format: logfmt
app: grafana-agent
depends_on:
gateway:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

services:
agent-metrics:
grafana-agent:
labels:
logs.agent.grafana.com/log-format: logfmt
app: grafana-agent
depends_on:
gateway:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

services:
agent-profiles:
grafana-agent:
labels:
logs.agent.grafana.com/log-format: logfmt
app: grafana-agent
depends_on:
gateway:
condition: service_started
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

services:
agent-traces:
grafana-agent:
labels:
logs.agent.grafana.com/log-format: logfmt
app: grafana-agent
depends_on:
gateway:
condition: service_healthy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Note:
# include is available in Docker Compose version 2.20 and later, and Docker Desktop version 4.22 and later.
include:
- path: agent-collect-metrics.yaml
- path: load-rules-to-mimir.yaml

services:
Expand Down
13 changes: 11 additions & 2 deletions docker-compose/common/config/agent-flow/logs.river
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ logging {
/********************************************
* Grafana LGTMP Stack Receiver Provider
********************************************/

module.file "lgtmp_provider_local" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river"

Expand All @@ -20,11 +19,21 @@ module.file "lgtmp_provider_local" {
/********************************************
* Logs
********************************************/

module.file "logs_primary" {
filename = env("AGENT_CONFIG_FOLDER") + "/modules/docker/logs/all.river"

arguments {
forward_to = [module.file.lgtmp_provider_local.exports.logs_receiver]
}
}

/********************************************
* Metrics
********************************************/
module.file "metrics_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river"

arguments {
forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver]
}
}
2 changes: 0 additions & 2 deletions docker-compose/common/config/agent-flow/metrics.river
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ logging {
/********************************************
* Grafana LGTMP Stack Receiver Provider
********************************************/

module.file "lgtmp_provider_local" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river"

Expand All @@ -20,7 +19,6 @@ module.file "lgtmp_provider_local" {
/********************************************
* Metrics
********************************************/

module.file "metrics_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ logging {
/********************************************
* Grafana LGTMP Stack Receiver Provider
********************************************/

module.file "lgtmp_provider_local" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river"

Expand All @@ -34,7 +33,6 @@ module.file "lgtmp_provider_grafana_cloud" {
/********************************************
* Metrics
********************************************/

module.file "metrics_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river"

Expand All @@ -46,7 +44,6 @@ module.file "metrics_primary" {
/********************************************
* Logs
********************************************/

module.file "logs_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/logs/all.river"

Expand Down Expand Up @@ -79,7 +76,6 @@ tracing {
/********************************************
* Profiles
********************************************/

module.file "profiles_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/profiles/all.river"

Expand Down
13 changes: 11 additions & 2 deletions docker-compose/common/config/agent-flow/profiles.river
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ logging {
/********************************************
* Grafana LGTMP Stack Receiver Provider
********************************************/

module.file "lgtmp_provider_local" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river"

Expand All @@ -20,11 +19,21 @@ module.file "lgtmp_provider_local" {
/********************************************
* Profiles
********************************************/

module.file "profiles_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/profiles/all.river"

arguments {
forward_to = [module.file.lgtmp_provider_local.exports.profiles_receiver]
}
}

/********************************************
* Metrics
********************************************/
module.file "metrics_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river"

arguments {
forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver]
}
}
12 changes: 11 additions & 1 deletion docker-compose/common/config/agent-flow/traces.river
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ logging {
/********************************************
* Grafana LGTMP Stack Receiver Provider
********************************************/

module.file "lgtmp_provider_local" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/local.river"

Expand All @@ -30,3 +29,14 @@ module.file "traces_primary" {
traces_forward_to = [module.file.lgtmp_provider_local.exports.traces_receiver]
}
}

/********************************************
* Metrics
********************************************/
module.file "metrics_primary" {
filename = coalesce(env("AGENT_CONFIG_FOLDER"), "/etc/agent-config") + "/modules/docker/metrics/all.river"

arguments {
forward_to = [module.file.lgtmp_provider_local.exports.metrics_receiver]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include:
- path: ../../common/compose-include/option-to-collect-metrics.yaml

x-environment: &jaeger-environment
JAEGER_AGENT_HOST: agent-traces
JAEGER_AGENT_HOST: grafana-agent
JAEGER_AGENT_PORT: 6831
JAEGER_SAMPLER_TYPE: const
JAEGER_SAMPLER_PARAM: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ x-labels: &profiles-labels
profiles.agent.grafana.com/goroutine.scrape: true

x-environment: &jaeger-environment
JAEGER_AGENT_HOST: agent-all-in-one
JAEGER_AGENT_HOST: grafana-agent
JAEGER_AGENT_PORT: 6831
JAEGER_SAMPLER_TYPE: const
JAEGER_SAMPLER_PARAM: 1
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/monolithic-mode/traces/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include:
- path: ../../common/compose-include/option-to-collect-metrics.yaml

x-environment: &jaeger-environment
JAEGER_AGENT_HOST: agent-traces
JAEGER_AGENT_HOST: grafana-agent
JAEGER_AGENT_PORT: 6831
JAEGER_SAMPLER_TYPE: const
JAEGER_SAMPLER_PARAM: 1
Expand Down

0 comments on commit c675d52

Please sign in to comment.