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]>
  • Loading branch information
qclaogui committed Mar 7, 2024
1 parent cf841d8 commit d2d2ff0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 108 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
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
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
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

0 comments on commit d2d2ff0

Please sign in to comment.