@primafuture/telemetry-stack 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +235 -0
- package/bin/telemetry-stack.mjs +654 -0
- package/package.json +26 -0
- package/stack/configs/config.alloy +74 -0
- package/stack/configs/grafana-datasources.yaml +105 -0
- package/stack/configs/prometheus.yaml +23 -0
- package/stack/configs/redpanda-console.yaml +5 -0
- package/stack/docker-compose.yaml +146 -0
- package/stack/templates/loki.yaml +63 -0
- package/stack/templates/mimir.yaml +52 -0
- package/stack/templates/tempo.yaml +99 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Main Alloy pipeline for application telemetry.
|
|
2
|
+
// It receives OTLP traces, metrics, and logs from apps and routes them to the stack.
|
|
3
|
+
|
|
4
|
+
// Copy selected log attributes into resource attributes so Loki can index them as labels.
|
|
5
|
+
otelcol.processor.transform "loki_labels" {
|
|
6
|
+
log_statements {
|
|
7
|
+
context = "log"
|
|
8
|
+
statements = [
|
|
9
|
+
`set(resource.attributes["log_type"], attributes["log_type"]) where attributes["log_type"] != nil`,
|
|
10
|
+
`set(resource.attributes["log.file.path"], attributes["log.file.path"]) where attributes["log.file.path"] != nil`,
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
output {
|
|
14
|
+
logs = [otelcol.processor.batch.pipeline.input]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Public OTLP receiver exposed by the alloy service.
|
|
19
|
+
// Applications send OTLP gRPC to port 4317 or OTLP HTTP to port 4318.
|
|
20
|
+
otelcol.receiver.otlp "otlp_receiver" {
|
|
21
|
+
grpc {
|
|
22
|
+
endpoint = "0.0.0.0:4317"
|
|
23
|
+
}
|
|
24
|
+
http {
|
|
25
|
+
endpoint = "0.0.0.0:4318"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
output {
|
|
29
|
+
traces = [otelcol.processor.batch.pipeline.input]
|
|
30
|
+
metrics = [otelcol.processor.batch.pipeline.input]
|
|
31
|
+
// Logs pass through the label transform first, then continue into the shared batch processor.
|
|
32
|
+
logs = [otelcol.processor.transform.loki_labels.input]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Batch processor reduces exporter overhead and fans telemetry out by signal type.
|
|
37
|
+
otelcol.processor.batch "pipeline" {
|
|
38
|
+
output {
|
|
39
|
+
traces = [otelcol.exporter.otlp.tempo.input]
|
|
40
|
+
metrics = [otelcol.exporter.prometheus.prometheus.input]
|
|
41
|
+
logs = [otelcol.exporter.otlphttp.loki_otlp.input]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Send traces to Tempo through OTLP gRPC.
|
|
46
|
+
otelcol.exporter.otlp "tempo" {
|
|
47
|
+
client {
|
|
48
|
+
endpoint = sys.env("ALLOY_OTLP_UPSTREAM")
|
|
49
|
+
tls {
|
|
50
|
+
insecure = true
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Convert OpenTelemetry metrics to Prometheus remote_write samples.
|
|
56
|
+
otelcol.exporter.prometheus "prometheus" {
|
|
57
|
+
forward_to = [prometheus.remote_write.default.receiver]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Store metrics in Prometheus first; Prometheus then forwards them to Mimir.
|
|
61
|
+
prometheus.remote_write "default" {
|
|
62
|
+
endpoint {
|
|
63
|
+
url = sys.env("ALLOY_PROM_REMOTE_WRITE_URL")
|
|
64
|
+
protobuf_message = "io.prometheus.write.v2.Request"
|
|
65
|
+
send_native_histograms = true
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Send logs to Loki through its OTLP HTTP endpoint, for example http://loki:3100/otlp.
|
|
70
|
+
otelcol.exporter.otlphttp "loki_otlp" {
|
|
71
|
+
client {
|
|
72
|
+
endpoint = sys.env("ALLOY_LOKI_OTLP_ENDPOINT")
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Grafana datasource provisioning for the local telemetry stack.
|
|
2
|
+
# Grafana loads this file at startup and creates ready-to-use data sources.
|
|
3
|
+
apiVersion: 1
|
|
4
|
+
|
|
5
|
+
datasources:
|
|
6
|
+
# Prometheus is used for short-term metrics and for trace exemplars.
|
|
7
|
+
- name: Prometheus
|
|
8
|
+
type: prometheus
|
|
9
|
+
uid: prometheus
|
|
10
|
+
access: proxy
|
|
11
|
+
orgId: 1
|
|
12
|
+
url: http://prometheus:9090
|
|
13
|
+
basicAuth: false
|
|
14
|
+
isDefault: false
|
|
15
|
+
version: 1
|
|
16
|
+
editable: true
|
|
17
|
+
jsonData:
|
|
18
|
+
httpMethod: GET
|
|
19
|
+
exemplarTraceIdDestinations:
|
|
20
|
+
- datasourceUid: tempo-streaming-disabled
|
|
21
|
+
name: trace_id
|
|
22
|
+
# Mimir exposes the same Prometheus query API for metrics stored in object storage.
|
|
23
|
+
- name: Mimir
|
|
24
|
+
type: prometheus
|
|
25
|
+
uid: mimir
|
|
26
|
+
access: proxy
|
|
27
|
+
orgId: 1
|
|
28
|
+
url: http://mimir:9009/prometheus
|
|
29
|
+
basicAuth: false
|
|
30
|
+
isDefault: false
|
|
31
|
+
version: 1
|
|
32
|
+
editable: true
|
|
33
|
+
jsonData:
|
|
34
|
+
httpMethod: GET
|
|
35
|
+
# Loki is used for logs. Derived fields turn trace_id and span_id labels into Tempo links.
|
|
36
|
+
- name: Loki
|
|
37
|
+
type: loki
|
|
38
|
+
uid: loki
|
|
39
|
+
access: proxy
|
|
40
|
+
orgId: 1
|
|
41
|
+
url: http://loki:3100
|
|
42
|
+
basicAuth: false
|
|
43
|
+
isDefault: false
|
|
44
|
+
version: 1
|
|
45
|
+
editable: true
|
|
46
|
+
jsonData:
|
|
47
|
+
httpMethod: GET
|
|
48
|
+
derivedFields:
|
|
49
|
+
- datasourceUid: tempo-streaming-disabled
|
|
50
|
+
matcherRegex: trace_id
|
|
51
|
+
matcherType: label
|
|
52
|
+
name: Traceid
|
|
53
|
+
url: "$${__value.raw}"
|
|
54
|
+
urlDisplayLabel: "$${__value.raw} (Tempo)"
|
|
55
|
+
- datasourceUid: tempo-streaming-disabled
|
|
56
|
+
matcherRegex: span_id
|
|
57
|
+
matcherType: label
|
|
58
|
+
name: SpanId
|
|
59
|
+
url: '{span:id = "$${__value.raw}"}'
|
|
60
|
+
urlDisplayLabel: "$${__value.raw} (Tempo)"
|
|
61
|
+
# This Tempo datasource enables streaming features and is the default trace datasource.
|
|
62
|
+
- name: Tempo (yes streaming)
|
|
63
|
+
type: tempo
|
|
64
|
+
access: proxy
|
|
65
|
+
orgId: 1
|
|
66
|
+
url: http://tempo:3200
|
|
67
|
+
basicAuth: false
|
|
68
|
+
isDefault: true
|
|
69
|
+
version: 1
|
|
70
|
+
editable: true
|
|
71
|
+
apiVersion: 1
|
|
72
|
+
uid: tempo-streaming-enabled
|
|
73
|
+
jsonData:
|
|
74
|
+
httpMethod: GET
|
|
75
|
+
serviceMap:
|
|
76
|
+
datasourceUid: prometheus
|
|
77
|
+
streamingEnabled:
|
|
78
|
+
search: true
|
|
79
|
+
metrics: true
|
|
80
|
+
# This Tempo datasource keeps streaming disabled for links that need stable TraceQL behavior.
|
|
81
|
+
- name: Tempo (no streaming)
|
|
82
|
+
type: tempo
|
|
83
|
+
access: proxy
|
|
84
|
+
orgId: 1
|
|
85
|
+
url: http://tempo:3200
|
|
86
|
+
basicAuth: false
|
|
87
|
+
isDefault: false
|
|
88
|
+
version: 1
|
|
89
|
+
editable: true
|
|
90
|
+
apiVersion: 1
|
|
91
|
+
uid: tempo-streaming-disabled
|
|
92
|
+
jsonData:
|
|
93
|
+
httpMethod: GET
|
|
94
|
+
serviceMap:
|
|
95
|
+
datasourceUid: prometheus
|
|
96
|
+
tracesToLogsV2:
|
|
97
|
+
customQuery: false
|
|
98
|
+
datasourceUid: loki
|
|
99
|
+
filterBySpanID: true
|
|
100
|
+
filterByTraceID: true
|
|
101
|
+
spanEndTimeShift: 10s
|
|
102
|
+
spanStartTimeShift: "-10s"
|
|
103
|
+
tags:
|
|
104
|
+
- key: service.name
|
|
105
|
+
value: service_name
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Local Prometheus configuration for development and demos.
|
|
2
|
+
# Prometheus receives remote_write data from Alloy, scrapes local stack targets, and forwards metrics to Mimir.
|
|
3
|
+
|
|
4
|
+
# Scrape every 15 seconds so demo graphs update quickly.
|
|
5
|
+
global:
|
|
6
|
+
scrape_interval: 15s
|
|
7
|
+
evaluation_interval: 15s
|
|
8
|
+
|
|
9
|
+
# Forward all collected metrics to Mimir for long-term metric storage.
|
|
10
|
+
remote_write:
|
|
11
|
+
- url: http://mimir:9009/api/v1/push
|
|
12
|
+
send_native_histograms: true
|
|
13
|
+
|
|
14
|
+
# Scrape built-in stack targets.
|
|
15
|
+
scrape_configs:
|
|
16
|
+
- job_name: 'prometheus'
|
|
17
|
+
static_configs:
|
|
18
|
+
- targets: [ 'localhost:9090' ]
|
|
19
|
+
# Tempo exposes internal metrics on its HTTP port.
|
|
20
|
+
- job_name: 'tempo'
|
|
21
|
+
static_configs:
|
|
22
|
+
- targets:
|
|
23
|
+
- 'tempo:3200'
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Telemetry stack used by the npm CLI.
|
|
2
|
+
# TELEMETRY_DATA_DIR must point to the host directory where runtime data is stored.
|
|
3
|
+
# Host ports can be overridden with environment variables, for example GRAFANA_PORT=3300.
|
|
4
|
+
services:
|
|
5
|
+
# Pre-creates writable data directories before services with different container UIDs start.
|
|
6
|
+
init-data:
|
|
7
|
+
image: library/busybox:latest@sha256:b3255e7dfbcd10cb367af0d409747d511aeb66dfac98cf30e97e87e4207dd76f
|
|
8
|
+
volumes:
|
|
9
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}:/data
|
|
10
|
+
command: sh -c "mkdir -p /data/tempo /data/minio /data/redpanda /data/loki /data/mimir /data/prometheus /data/grafana && chmod 0777 /data/tempo /data/minio /data/redpanda /data/loki /data/mimir /data/prometheus /data/grafana"
|
|
11
|
+
|
|
12
|
+
# Tempo stores traces and accepts OTLP trace data from Alloy.
|
|
13
|
+
tempo:
|
|
14
|
+
image: grafana/tempo:latest@sha256:f3eed6cfd68a2e9eef773f3e2eb0f56cef27cf00a34dd60c7e62c90ef07d02f8
|
|
15
|
+
depends_on:
|
|
16
|
+
init-data:
|
|
17
|
+
condition: service_completed_successfully
|
|
18
|
+
redpanda:
|
|
19
|
+
condition: service_started
|
|
20
|
+
command: "-target=all -config.file=/etc/tempo.yaml"
|
|
21
|
+
restart: always
|
|
22
|
+
volumes:
|
|
23
|
+
- ${TELEMETRY_GENERATED_CONFIG_DIR:?Set TELEMETRY_GENERATED_CONFIG_DIR}/tempo.yaml:/etc/tempo.yaml:ro
|
|
24
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}/tempo:/var/tempo
|
|
25
|
+
ports:
|
|
26
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${TEMPO_PORT:-3200}:3200"
|
|
27
|
+
|
|
28
|
+
# MinIO provides local S3-compatible object storage for Tempo, Loki, and Mimir.
|
|
29
|
+
minio:
|
|
30
|
+
image: minio/minio:latest@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e
|
|
31
|
+
volumes:
|
|
32
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}/minio:/data
|
|
33
|
+
environment:
|
|
34
|
+
- MINIO_ROOT_USER=${TELEMETRY_MINIO_ACCESS_KEY:?Set TELEMETRY_MINIO_ACCESS_KEY}
|
|
35
|
+
- MINIO_ROOT_PASSWORD=${TELEMETRY_MINIO_SECRET_KEY:?Set TELEMETRY_MINIO_SECRET_KEY}
|
|
36
|
+
ports:
|
|
37
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${MINIO_CONSOLE_PORT:-9001}:9001"
|
|
38
|
+
entrypoint:
|
|
39
|
+
- sh
|
|
40
|
+
- -euc
|
|
41
|
+
- mkdir -p /data/tempo /data/loki /data/mimir && minio server /data --console-address ':9001'
|
|
42
|
+
|
|
43
|
+
# Mimir stores long-term metrics and receives remote_write data from Prometheus.
|
|
44
|
+
mimir:
|
|
45
|
+
image: grafana/mimir:latest@sha256:df4b7a5fefba96c19fa3e0b3d3ecceed32892ef49ae893ce37492cfe4f299645
|
|
46
|
+
command: -target=all -config.file=/etc/mimir.yaml
|
|
47
|
+
volumes:
|
|
48
|
+
- ${TELEMETRY_GENERATED_CONFIG_DIR:?Set TELEMETRY_GENERATED_CONFIG_DIR}/mimir.yaml:/etc/mimir.yaml:ro
|
|
49
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}/mimir:/var/mimir
|
|
50
|
+
ports:
|
|
51
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${MIMIR_PORT:-9009}:9009"
|
|
52
|
+
depends_on:
|
|
53
|
+
init-data:
|
|
54
|
+
condition: service_completed_successfully
|
|
55
|
+
minio:
|
|
56
|
+
condition: service_started
|
|
57
|
+
|
|
58
|
+
# Redpanda is the Kafka-compatible broker used by Tempo ingestion.
|
|
59
|
+
redpanda:
|
|
60
|
+
image: redpandadata/redpanda:latest@sha256:a6340e8d52455996b6fbe34df219305cb934eddceab2da2ce8e1ef32bbe04703
|
|
61
|
+
volumes:
|
|
62
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}/redpanda:/var/lib/redpanda/data
|
|
63
|
+
ports:
|
|
64
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${REDPANDA_PORT:-9092}:9092"
|
|
65
|
+
command: >
|
|
66
|
+
redpanda start --overprovisioned
|
|
67
|
+
--mode=dev-container
|
|
68
|
+
--kafka-addr=PLAINTEXT://0.0.0.0:9092
|
|
69
|
+
--advertise-kafka-addr=PLAINTEXT://redpanda:9092
|
|
70
|
+
|
|
71
|
+
# Redpanda Console is the browser UI for inspecting the local Redpanda broker.
|
|
72
|
+
redpanda-console:
|
|
73
|
+
image: docker.redpanda.com/redpandadata/console:v3.5.0@sha256:b2cbdd93dee412142f95a61488118f33b8e31ea576bfb3ce625fbaffbdf0803a
|
|
74
|
+
environment:
|
|
75
|
+
- CONFIG_FILEPATH=/etc/redpanda/redpanda-console-config.yaml
|
|
76
|
+
volumes:
|
|
77
|
+
- ./configs/redpanda-console.yaml:/etc/redpanda/redpanda-console-config.yaml
|
|
78
|
+
ports:
|
|
79
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${REDPANDA_CONSOLE_PORT:-8080}:8080"
|
|
80
|
+
depends_on:
|
|
81
|
+
- redpanda
|
|
82
|
+
|
|
83
|
+
# Alloy is the main OpenTelemetry gateway for app traces, metrics, and logs.
|
|
84
|
+
alloy:
|
|
85
|
+
image: grafana/alloy:latest@sha256:8abcd0d97a97099cabb34be8dcfc448fca6c35931ae9291aaf74056105dedcca
|
|
86
|
+
volumes:
|
|
87
|
+
- ./configs/config.alloy:/etc/alloy/config.alloy
|
|
88
|
+
command:
|
|
89
|
+
- run
|
|
90
|
+
- /etc/alloy/config.alloy
|
|
91
|
+
- --storage.path=/var/lib/alloy/data
|
|
92
|
+
- --server.http.listen-addr=0.0.0.0:12345
|
|
93
|
+
- --stability.level=experimental
|
|
94
|
+
environment:
|
|
95
|
+
- ALLOY_OTLP_UPSTREAM=tempo:4317
|
|
96
|
+
- ALLOY_PROM_REMOTE_WRITE_URL=http://prometheus:9090/api/v1/write
|
|
97
|
+
- ALLOY_LOKI_OTLP_ENDPOINT=http://loki:3100/otlp
|
|
98
|
+
ports:
|
|
99
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${ALLOY_PORT:-12345}:12345"
|
|
100
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${OTLP_GRPC_PORT:-4317}:4317"
|
|
101
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${OTLP_HTTP_PORT:-4318}:4318"
|
|
102
|
+
depends_on:
|
|
103
|
+
- tempo
|
|
104
|
+
- prometheus
|
|
105
|
+
- loki
|
|
106
|
+
|
|
107
|
+
# Loki stores logs and exposes them to Grafana through the Loki datasource.
|
|
108
|
+
loki:
|
|
109
|
+
image: grafana/loki:latest@sha256:3c8fd3570dd9219951a60d3f919c7f31923d10baee578b77bc26c4a0b32d092d
|
|
110
|
+
command: -config.file=/etc/loki/config.yaml
|
|
111
|
+
volumes:
|
|
112
|
+
- ${TELEMETRY_GENERATED_CONFIG_DIR:?Set TELEMETRY_GENERATED_CONFIG_DIR}/loki.yaml:/etc/loki/config.yaml:ro
|
|
113
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}/loki:/loki
|
|
114
|
+
ports:
|
|
115
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${LOKI_PORT:-3100}:3100"
|
|
116
|
+
|
|
117
|
+
# Prometheus receives metrics from Alloy, scrapes local jobs, and forwards to Mimir.
|
|
118
|
+
prometheus:
|
|
119
|
+
image: prom/prometheus:latest@sha256:4a61322ac1103a0e3aea2a61ef1718422a48fa046441f299d71e660a3bc71ae9
|
|
120
|
+
command:
|
|
121
|
+
- --config.file=/etc/prometheus.yaml
|
|
122
|
+
- --storage.tsdb.retention.time=7d
|
|
123
|
+
- --web.enable-remote-write-receiver
|
|
124
|
+
- --enable-feature=exemplar-storage
|
|
125
|
+
- --enable-feature=native-histograms
|
|
126
|
+
volumes:
|
|
127
|
+
- ./configs/prometheus.yaml:/etc/prometheus.yaml
|
|
128
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}/prometheus:/prometheus
|
|
129
|
+
ports:
|
|
130
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${PROMETHEUS_PORT:-9090}:9090"
|
|
131
|
+
|
|
132
|
+
# Grafana is the browser UI with datasources provisioned from stack/configs.
|
|
133
|
+
grafana:
|
|
134
|
+
image: grafana/grafana:latest@sha256:b0ae311af06228bcfd4a620504b653db80f5b91e94dc3dc2a5b7dab202bcde20
|
|
135
|
+
volumes:
|
|
136
|
+
- ./configs/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
|
|
137
|
+
- ${TELEMETRY_DATA_DIR:?Set TELEMETRY_DATA_DIR}/grafana:/var/lib/grafana
|
|
138
|
+
environment:
|
|
139
|
+
- GF_AUTH_ANONYMOUS_ENABLED=${GRAFANA_ANONYMOUS_ENABLED:-true}
|
|
140
|
+
- GF_AUTH_ANONYMOUS_ORG_ROLE=${GRAFANA_ANONYMOUS_ORG_ROLE:-Admin}
|
|
141
|
+
- GF_AUTH_DISABLE_LOGIN_FORM=${GRAFANA_DISABLE_LOGIN_FORM:-true}
|
|
142
|
+
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
|
|
143
|
+
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin}
|
|
144
|
+
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor metricsSummary
|
|
145
|
+
ports:
|
|
146
|
+
- "${TELEMETRY_BIND_ADDRESS:-0.0.0.0}:${GRAFANA_PORT:-3000}:3000"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Generated Loki configuration.
|
|
2
|
+
# This file is rendered from the package template; edit telemetry-stack.env instead.
|
|
3
|
+
auth_enabled: false
|
|
4
|
+
|
|
5
|
+
server:
|
|
6
|
+
http_listen_port: 3100
|
|
7
|
+
|
|
8
|
+
# Single-process ring suitable only for this local Docker Compose stack.
|
|
9
|
+
common:
|
|
10
|
+
ring:
|
|
11
|
+
instance_addr: 127.0.0.1
|
|
12
|
+
kvstore:
|
|
13
|
+
store: inmemory
|
|
14
|
+
replication_factor: 1
|
|
15
|
+
path_prefix: /loki
|
|
16
|
+
|
|
17
|
+
# TSDB schema backed by the local MinIO S3-compatible storage service.
|
|
18
|
+
schema_config:
|
|
19
|
+
configs:
|
|
20
|
+
- from: 2024-04-01
|
|
21
|
+
store: tsdb
|
|
22
|
+
object_store: s3
|
|
23
|
+
schema: v13
|
|
24
|
+
index:
|
|
25
|
+
prefix: index_
|
|
26
|
+
period: 24h
|
|
27
|
+
|
|
28
|
+
# Store Loki chunks and indexes in the local MinIO bucket named loki.
|
|
29
|
+
storage_config:
|
|
30
|
+
tsdb_shipper:
|
|
31
|
+
active_index_directory: /loki/index
|
|
32
|
+
cache_location: /loki/index_cache
|
|
33
|
+
cache_ttl: 24h
|
|
34
|
+
aws:
|
|
35
|
+
endpoint: http://minio:9000
|
|
36
|
+
bucketnames: loki
|
|
37
|
+
access_key_id: "{{TELEMETRY_MINIO_ACCESS_KEY}}"
|
|
38
|
+
secret_access_key: "{{TELEMETRY_MINIO_SECRET_KEY}}"
|
|
39
|
+
s3forcepathstyle: true
|
|
40
|
+
insecure: true
|
|
41
|
+
region: us-east-1
|
|
42
|
+
|
|
43
|
+
# Compactor enforces retention and deletes old objects from MinIO.
|
|
44
|
+
compactor:
|
|
45
|
+
working_directory: /loki/retention
|
|
46
|
+
compaction_interval: 10m
|
|
47
|
+
retention_enabled: true
|
|
48
|
+
retention_delete_delay: 2h
|
|
49
|
+
retention_delete_worker_count: 150
|
|
50
|
+
delete_request_store: s3
|
|
51
|
+
|
|
52
|
+
# Keep demo logs for 7 days.
|
|
53
|
+
limits_config:
|
|
54
|
+
retention_period: 168h
|
|
55
|
+
|
|
56
|
+
# OTLP logs arrive with resource attributes. This list chooses which attributes
|
|
57
|
+
# Loki indexes as labels; dots are converted to underscores in Loki/Grafana.
|
|
58
|
+
distributor:
|
|
59
|
+
otlp_config:
|
|
60
|
+
default_resource_attributes_as_index_labels:
|
|
61
|
+
- service.name
|
|
62
|
+
- log_type
|
|
63
|
+
- log.file.path
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Generated Mimir configuration.
|
|
2
|
+
# This file is rendered from the package template; edit telemetry-stack.env instead.
|
|
3
|
+
|
|
4
|
+
multitenancy_enabled: false
|
|
5
|
+
|
|
6
|
+
# Mimir exposes its HTTP API on the internal Docker network.
|
|
7
|
+
server:
|
|
8
|
+
http_listen_port: 9009
|
|
9
|
+
|
|
10
|
+
# Store metric blocks in the local MinIO bucket named mimir.
|
|
11
|
+
common:
|
|
12
|
+
storage:
|
|
13
|
+
backend: s3
|
|
14
|
+
s3:
|
|
15
|
+
endpoint: minio:9000
|
|
16
|
+
access_key_id: "{{TELEMETRY_MINIO_ACCESS_KEY}}"
|
|
17
|
+
secret_access_key: "{{TELEMETRY_MINIO_SECRET_KEY}}"
|
|
18
|
+
insecure: true
|
|
19
|
+
bucket_name: mimir
|
|
20
|
+
|
|
21
|
+
# Blocks storage requires a prefix when using a common object storage bucket.
|
|
22
|
+
blocks_storage:
|
|
23
|
+
storage_prefix: blocks
|
|
24
|
+
tsdb:
|
|
25
|
+
dir: /var/mimir/tsdb
|
|
26
|
+
bucket_store:
|
|
27
|
+
sync_dir: /var/mimir/tsdb-sync
|
|
28
|
+
|
|
29
|
+
# Run a single local ingester with an in-memory memberlist ring.
|
|
30
|
+
ingester:
|
|
31
|
+
ring:
|
|
32
|
+
kvstore:
|
|
33
|
+
store: memberlist
|
|
34
|
+
replication_factor: 1
|
|
35
|
+
|
|
36
|
+
# Enable native histograms and keep demo metrics for 7 days.
|
|
37
|
+
limits:
|
|
38
|
+
native_histograms_ingestion_enabled: true
|
|
39
|
+
compactor_blocks_retention_period: 168h
|
|
40
|
+
|
|
41
|
+
# Compact old metric blocks and enforce retention.
|
|
42
|
+
compactor:
|
|
43
|
+
data_dir: /var/mimir/compactor
|
|
44
|
+
sharding_ring:
|
|
45
|
+
kvstore:
|
|
46
|
+
store: memberlist
|
|
47
|
+
|
|
48
|
+
# Store gateway serves blocks from object storage back to queriers.
|
|
49
|
+
store_gateway:
|
|
50
|
+
sharding_ring:
|
|
51
|
+
kvstore:
|
|
52
|
+
store: memberlist
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Generated Tempo configuration.
|
|
2
|
+
# This file is rendered from the package template; edit telemetry-stack.env instead.
|
|
3
|
+
|
|
4
|
+
partition_ring_live_store: true
|
|
5
|
+
stream_over_http_enabled: true
|
|
6
|
+
|
|
7
|
+
# Tempo exposes its HTTP API on port 3200 inside the Docker network.
|
|
8
|
+
server:
|
|
9
|
+
http_listen_port: 3200
|
|
10
|
+
log_level: info
|
|
11
|
+
|
|
12
|
+
# Receive OTLP traces from Alloy and write them through the Kafka-compatible path.
|
|
13
|
+
distributor:
|
|
14
|
+
ingester_write_path_enabled: false
|
|
15
|
+
kafka_write_path_enabled: true
|
|
16
|
+
receivers:
|
|
17
|
+
otlp:
|
|
18
|
+
protocols:
|
|
19
|
+
grpc:
|
|
20
|
+
endpoint: "tempo:4317"
|
|
21
|
+
http:
|
|
22
|
+
endpoint: "tempo:4318"
|
|
23
|
+
#log_received_spans:
|
|
24
|
+
# enabled: true
|
|
25
|
+
# log_discarded_spans:
|
|
26
|
+
# enabled: true
|
|
27
|
+
|
|
28
|
+
# Keep trace blocks for 7 days during backend compaction.
|
|
29
|
+
backend_scheduler:
|
|
30
|
+
provider:
|
|
31
|
+
compaction:
|
|
32
|
+
compaction:
|
|
33
|
+
block_retention: 168h
|
|
34
|
+
|
|
35
|
+
# Backend workers compact trace blocks and coordinate through memberlist.
|
|
36
|
+
backend_worker:
|
|
37
|
+
backend_scheduler_addr: backend-scheduler:3200
|
|
38
|
+
compaction:
|
|
39
|
+
block_retention: 168h
|
|
40
|
+
ring:
|
|
41
|
+
kvstore:
|
|
42
|
+
store: memberlist
|
|
43
|
+
|
|
44
|
+
# Enable querying data that is still in the live store.
|
|
45
|
+
querier:
|
|
46
|
+
query_live_store: true
|
|
47
|
+
|
|
48
|
+
# Generate Prometheus metrics from spans and service graphs.
|
|
49
|
+
metrics_generator:
|
|
50
|
+
registry:
|
|
51
|
+
external_labels:
|
|
52
|
+
source: tempo
|
|
53
|
+
cluster: docker-compose
|
|
54
|
+
storage:
|
|
55
|
+
path: /var/tempo/generator/wal
|
|
56
|
+
remote_write:
|
|
57
|
+
- url: http://prometheus:9090/api/v1/write
|
|
58
|
+
send_exemplars: true
|
|
59
|
+
|
|
60
|
+
# Grafana uses the query frontend for trace search and trace detail views.
|
|
61
|
+
query_frontend:
|
|
62
|
+
rf1_after: "1999-01-01T00:00:00Z"
|
|
63
|
+
mcp_server:
|
|
64
|
+
enabled: true
|
|
65
|
+
|
|
66
|
+
# Store trace blocks in MinIO and write the local WAL under the data directory.
|
|
67
|
+
storage:
|
|
68
|
+
trace:
|
|
69
|
+
backend: s3
|
|
70
|
+
s3:
|
|
71
|
+
bucket: tempo
|
|
72
|
+
endpoint: minio:9000
|
|
73
|
+
access_key: "{{TELEMETRY_MINIO_ACCESS_KEY}}"
|
|
74
|
+
secret_key: "{{TELEMETRY_MINIO_SECRET_KEY}}"
|
|
75
|
+
insecure: true
|
|
76
|
+
wal:
|
|
77
|
+
path: /var/tempo/wal
|
|
78
|
+
|
|
79
|
+
# Turn traces into span metrics and service graph metrics for Grafana.
|
|
80
|
+
overrides:
|
|
81
|
+
defaults:
|
|
82
|
+
metrics_generator:
|
|
83
|
+
processors: ["span-metrics", "service-graphs"]
|
|
84
|
+
generate_native_histograms: both
|
|
85
|
+
|
|
86
|
+
# Use Redpanda as the Kafka-compatible ingestion queue for this local stack.
|
|
87
|
+
ingest:
|
|
88
|
+
enabled: true
|
|
89
|
+
kafka:
|
|
90
|
+
address: redpanda:9092
|
|
91
|
+
topic: tempo-ingest
|
|
92
|
+
|
|
93
|
+
# Build compacted blocks frequently so demo data appears quickly.
|
|
94
|
+
block_builder:
|
|
95
|
+
consume_cycle_duration: 30s
|
|
96
|
+
|
|
97
|
+
# Disable upstream usage reports for this local package.
|
|
98
|
+
usage_report:
|
|
99
|
+
reporting_enabled: false
|