Skip to content

Commit

Permalink
code clean
Browse files Browse the repository at this point in the history
Signed-off-by: Weifeng Wang <[email protected]>

code clean

Signed-off-by: Weifeng Wang <[email protected]>
  • Loading branch information
qclaogui committed Mar 7, 2024
1 parent 349d01e commit e94b0bb
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 177 deletions.
17 changes: 14 additions & 3 deletions docker-compose/common/config/agent-flow/logs.river
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ discovery.relabel "containers" {
target_label = "pod"
}

rule {
source_labels = ["__meta_docker_container_label_com_docker_compose_service"]
regex = "(.*)"
target_label = "app"
}

rule {
source_labels = ["__meta_docker_container_name"]
regex = "/(.*)"
Expand Down Expand Up @@ -95,20 +101,25 @@ otelcol.receiver.otlp "containers" {
}

otelcol.processor.batch "containers" {
send_batch_size = 16384
send_batch_max_size = 0
timeout = "2s"

output {
logs = [otelcol.processor.memory_limiter.containers.input]
}
}

otelcol.processor.memory_limiter "containers" {
check_interval = "1s"
limit = "256MiB"
check_interval = "1s"
limit_percentage = 50
spike_limit_percentage = 30

output {
logs = [otelcol.exporter.loki.containers.input]
}
}

otelcol.exporter.loki "containers" {
forward_to = [module.file.docker_compose.exports.logs_receiver]
forward_to = [loki.process.containers.receiver]
}
27 changes: 1 addition & 26 deletions docker-compose/common/config/loki/datasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,6 @@ datasources:
uid: logs
url: http://gateway:3100
basicAuth: false
isDefault: true # Note: default datasources
version: 1
editable: true

# Tempo for traces
- name: Traces
type: tempo
access: proxy
orgId: 1
uid: traces
url: http://gateway:3200
basicAuth: false
isDefault: false
version: 1
editable: true
apiVersion: 1

# Pyroscope for profiles
- name: Profiles
type: grafana-pyroscope-datasource
access: proxy
orgId: 1
uid: profiles
url: http://gateway:4040
basicAuth: false
isDefault: false # Note: default datasources
isDefault: true
version: 1
editable: true
25 changes: 0 additions & 25 deletions docker-compose/common/config/mimir/datasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,3 @@ datasources:
isDefault: false
version: 1
editable: true

# Tempo for traces
- name: Traces
type: tempo
access: proxy
orgId: 1
uid: traces
url: http://gateway:3200
basicAuth: false
isDefault: false
version: 1
editable: true
apiVersion: 1

# Pyroscope for profiles
- name: Profiles
type: grafana-pyroscope-datasource
access: proxy
orgId: 1
uid: profiles
url: http://gateway:4040
basicAuth: false
isDefault: false # Note: default datasources
version: 1
editable: true
43 changes: 5 additions & 38 deletions docker-compose/common/config/pyroscope/datasources.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,10 @@
apiVersion: 1

datasources:
# Mimir for metrics
- name: Metrics
type: prometheus
uid: metrics
access: proxy
orgId: 1
url: http://gateway:8080/prometheus
basicAuth: false
isDefault: false
version: 1
editable: true

# Loki for logs
- name: Logs
type: loki
access: proxy
orgId: 1
uid: logs
url: http://gateway:3100
basicAuth: false
isDefault: false
version: 1
editable: true

# Tempo for traces
- name: Traces
type: tempo
access: proxy
orgId: 1
uid: traces
url: http://gateway:3200
basicAuth: false
isDefault: false
version: 1
editable: true
apiVersion: 1
deleteDatasources:
- name: Profiles
uid: profiles

datasources:
# Pyroscope for profiles
- name: Profiles
type: grafana-pyroscope-datasource
Expand All @@ -46,6 +13,6 @@ datasources:
uid: profiles
url: http://gateway:4040
basicAuth: false
isDefault: true # Note: default datasources
isDefault: true
version: 1
editable: true
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
analytics:
reporting_enabled: false

# https://grafana.com/docs/pyroscope/latest/configure-server/configure-disk-storage/#configure-pyroscope-disk-storage
pyroscopedb:
max_block_duration: 5m

# https://grafana.com/docs/pyroscope/latest/configure-server/reference-configuration-parameters/#use-environment-variables-in-the-configuration
storage:
backend: s3
Expand Down
14 changes: 0 additions & 14 deletions docker-compose/common/config/tempo/datasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ deleteDatasources:
uid: logs
- name: Traces
uid: traces
- name: Profiles
uid: profiles

datasources:
# Mimir for metrics
Expand Down Expand Up @@ -78,15 +76,3 @@ datasources:
query: 'sum(rate(traces_spanmetrics_calls_total{$$__tags, status_code="STATUS_CODE_ERROR"}[$$__rate_interval]))'
- name: '(D) Duration'
query: 'histogram_quantile(0.9, sum(rate(traces_spanmetrics_latency_bucket{$$__tags}[$$__rate_interval])) by (le))'

# Pyroscope for profiles
- name: Profiles
type: grafana-pyroscope-datasource
access: proxy
orgId: 1
uid: profiles
url: http://gateway:4040
basicAuth: false
isDefault: false # Note: default datasources
version: 1
editable: true
8 changes: 0 additions & 8 deletions docker-compose/microservices-mode/traces/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ services:
- -target=all
- -config.expand-env=true
- -log.level=warn
# environment:
# - JAEGER_SERVICE_NAME=mimir
# - JAEGER_AGENT_HOST=agent
# - JAEGER_AGENT_PORT=6831
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080/ready || exit 1" ]
interval: 10s
Expand Down Expand Up @@ -198,7 +192,5 @@ services:
- GF_LOG_LEVEL=error
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password}
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles
# - GF_TRACING_OPENTELEMETRY_OTLP_ADDRESS=agent:4317
# - GF_TRACING_OPENTELEMETRY_CUSTOM_ATTRIBUTES=app:grafana
ports:
- "3000:3000"
24 changes: 0 additions & 24 deletions docker-compose/monolithic-mode/all-in-one/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ services:
- -target=all
- -config.expand-env=true
- -log.level=warn
# environment:
# - JAEGER_AGENT_HOST=agent
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=mimir
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080/ready || exit 1" ]
interval: 10s
Expand Down Expand Up @@ -91,12 +85,6 @@ services:
- -target=all
- -config.expand-env=true
- -log.level=warn
# environment:
# - JAEGER_AGENT_HOST=agent
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=loki
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1" ]
interval: 10s
Expand Down Expand Up @@ -171,12 +159,6 @@ services:
container_name: pyroscope
volumes:
- ../../common/config/pyroscope/monolithic-mode-profiles.yaml:/etc/config.yaml
# environment:
# - JAEGER_AGENT_HOST=agent
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=pyroscope
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1
command:
- -config.file=/etc/config.yaml
- -config.expand-env=true
Expand All @@ -200,12 +182,6 @@ services:
- GF_LOG_LEVEL=warn
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password}
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles
# - GF_DIAGNOSTICS_PROFILING_ENABLED=true
# - GF_DIAGNOSTICS_PROFILING_ADDR=0.0.0.0
# - GF_DIAGNOSTICS_PROFILING_PORT=6060
# - GF_TRACING_OPENTELEMETRY_OTLP_ADDRESS=agent:4317
# - GF_TRACING_OPENTELEMETRY_CUSTOM_ATTRIBUTES=app:grafana
# - GF_INSTALL_PLUGINS=pyroscope-datasource,pyroscope-panel
ports:
- "3000:3000"

2 changes: 0 additions & 2 deletions docker-compose/monolithic-mode/profiles/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ services:
- -target=all
- -log.level=warn
- -config.expand-env=true
# ports:
# - "4040:4040"
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:4040/ready || exit 1" ]
interval: 15s
Expand Down
8 changes: 0 additions & 8 deletions docker-compose/monolithic-mode/traces/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ services:
- -target=all
- -config.expand-env=true
- -log.level=warn
# environment:
# - JAEGER_AGENT_HOST=agent
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=mimir
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8080/ready || exit 1" ]
interval: 10s
Expand Down Expand Up @@ -123,7 +117,5 @@ services:
- GF_LOG_LEVEL=warn
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-admin_password}
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles
# - GF_TRACING_OPENTELEMETRY_OTLP_ADDRESS=agent:4317
# - GF_TRACING_OPENTELEMETRY_CUSTOM_ATTRIBUTES=app:grafana
ports:
- "3000:3000"
4 changes: 4 additions & 0 deletions kubernetes/microservices-mode/profiles/configs/pyroscope.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
analytics:
reporting_enabled: false

# https://grafana.com/docs/pyroscope/latest/configure-server/configure-disk-storage/#configure-pyroscope-disk-storage
pyroscopedb:
max_block_duration: 5m

storage:
backend: s3
s3:
Expand Down
7 changes: 0 additions & 7 deletions kubernetes/microservices-mode/traces/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ secretGenerator:
literals:
- NAMESPACE=monitoring-system
- GF_LOG_LEVEL=warn
# - GF_TRACING_OPENTELEMETRY_OTLP_ADDRESS=grafana-agent.monitoring-system.svc.cluster.local:4317
# - GF_TRACING_OPENTELEMETRY_CUSTOM_ATTRIBUTES=app:grafana
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles

- name: tempo-distributed-env
Expand All @@ -40,11 +38,6 @@ secretGenerator:
namespace: monitoring-system
literals:
- MIMIR_S3_SECRET_ACCESS_KEY=VD538OYxSEiGD4I9mmFfqFMCGq1vIiGm
# - JAEGER_AGENT_HOST=grafana-agent.monitoring-system.svc.cluster.local
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=mimir
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1

configMapGenerator:
- name: grafana-datasources
Expand Down
17 changes: 0 additions & 17 deletions kubernetes/monolithic-mode/all-in-one/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,12 @@ secretGenerator:
namespace: monitoring-system
literals:
- GF_LOG_LEVEL=warn
# - GF_TRACING_OPENTELEMETRY_OTLP_ADDRESS=grafana-agent.monitoring-system.svc.cluster.local:4317
# - GF_TRACING_OPENTELEMETRY_CUSTOM_ATTRIBUTES=app:grafana
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor tracesEmbeddedFlameGraph traceqlSearch correlations metricsSummary traceToMetrics traceToProfiles

- name: loki-env
namespace: logging-system
literals:
- LOKI_S3_SECRET_ACCESS_KEY=VD538OYxSEiGD4I9mmFfqFMCGq1vIiGm
# - JAEGER_AGENT_HOST=grafana-agent.monitoring-system.svc.cluster.local
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=loki
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1

- name: tempo-env
namespace: tracing-system
Expand All @@ -55,21 +48,11 @@ secretGenerator:
namespace: monitoring-system
literals:
- MIMIR_S3_SECRET_ACCESS_KEY=VD538OYxSEiGD4I9mmFfqFMCGq1vIiGm
# - JAEGER_AGENT_HOST=grafana-agent.monitoring-system.svc.cluster.local
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=mimir
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1

- name: pyroscope-env
namespace: profiles-system
literals:
- PYROSCOPE_STORAGE_S3_SECRET_ACCESS_KEY=VD538OYxSEiGD4I9mmFfqFMCGq1vIiGm
# - JAEGER_AGENT_HOST=grafana-agent.monitoring-system.svc.cluster.local
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=pyroscope
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1

configMapGenerator:
- name: grafana-datasources
Expand Down
4 changes: 4 additions & 0 deletions kubernetes/monolithic-mode/profiles/configs/pyroscope.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
analytics:
reporting_enabled: false

# https://grafana.com/docs/pyroscope/latest/configure-server/configure-disk-storage/#configure-pyroscope-disk-storage
pyroscopedb:
max_block_duration: 5m

# https://grafana.com/docs/pyroscope/latest/configure-server/reference-configuration-parameters/#use-environment-variables-in-the-configuration
storage:
backend: s3
Expand Down
5 changes: 0 additions & 5 deletions kubernetes/monolithic-mode/traces/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ secretGenerator:
namespace: monitoring-system
literals:
- MIMIR_S3_SECRET_ACCESS_KEY=VD538OYxSEiGD4I9mmFfqFMCGq1vIiGm
# - JAEGER_AGENT_HOST=grafana-agent.monitoring-system.svc.cluster.local
# - JAEGER_AGENT_PORT=6831
# - JAEGER_TAGS=app=mimir
# - JAEGER_SAMPLER_TYPE=const
# - JAEGER_SAMPLER_PARAM=1

configMapGenerator:
- name: grafana-datasources
Expand Down

0 comments on commit e94b0bb

Please sign in to comment.