-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add grafana stack with otel collector.
- Loading branch information
1 parent
28058dc
commit 3470cd1
Showing
10 changed files
with
2,466 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
uid: prometheus | ||
access: proxy | ||
orgId: 1 | ||
url: http://prometheus:9090 | ||
basicAuth: false | ||
isDefault: false | ||
version: 1 | ||
editable: false | ||
jsonData: | ||
httpMethod: GET | ||
- name: Tempo | ||
type: tempo | ||
access: proxy | ||
orgId: 1 | ||
url: http://tempo:3200 | ||
basicAuth: false | ||
isDefault: true | ||
version: 1 | ||
editable: false | ||
apiVersion: 1 | ||
uid: tempo | ||
jsonData: | ||
httpMethod: GET | ||
serviceMap: | ||
datasourceUid: prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
http: | ||
|
||
exporters: | ||
otlp: | ||
endpoint: tempo:4317 | ||
tls: | ||
insecure: true | ||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
exporters: [otlp] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
global: | ||
scrape_interval: 15s | ||
evaluation_interval: 15s | ||
|
||
scrape_configs: | ||
- job_name: 'prometheus' | ||
static_configs: | ||
- targets: ['localhost:9090'] | ||
- job_name: 'tempo' | ||
static_configs: | ||
- targets: ['tempo:3200'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
stream_over_http_enabled: true | ||
server: | ||
http_listen_port: 3200 | ||
log_level: info | ||
|
||
query_frontend: | ||
search: | ||
duration_slo: 5s | ||
throughput_bytes_slo: 1.073741824e+09 | ||
trace_by_id: | ||
duration_slo: 5s | ||
|
||
distributor: | ||
receivers: # this configuration will listen on all ports and protocols that tempo is capable of. | ||
jaeger: # the receives all come from the OpenTelemetry collector. more configuration information can | ||
protocols: # be found there: https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver | ||
thrift_http: # | ||
grpc: # for a production deployment you should only enable the receivers you need! | ||
thrift_binary: | ||
thrift_compact: | ||
zipkin: | ||
otlp: | ||
protocols: | ||
http: | ||
grpc: | ||
opencensus: | ||
|
||
ingester: | ||
max_block_duration: 5m # cut the headblock when this much time passes. this is being set for demo purposes and should probably be left alone normally | ||
|
||
compactor: | ||
compaction: | ||
block_retention: 1h # overall Tempo trace retention. set for demo purposes | ||
|
||
metrics_generator: | ||
registry: | ||
external_labels: | ||
source: tempo | ||
cluster: docker-compose | ||
storage: | ||
path: /var/tempo/generator/wal | ||
remote_write: | ||
- url: http://prometheus:9090/api/v1/write | ||
send_exemplars: true | ||
traces_storage: | ||
path: /var/tempo/generator/traces | ||
|
||
storage: | ||
trace: | ||
backend: local # backend configuration to use | ||
wal: | ||
path: /var/tempo/wal # where to store the wal locally | ||
local: | ||
path: /var/tempo/blocks | ||
|
||
overrides: | ||
defaults: | ||
global: | ||
max_bytes_per_trace: 100000000 | ||
ingestion: | ||
max_traces_per_user: 10000 | ||
read: | ||
max_bytes_per_tag_values_query: 100000000 | ||
metrics_generator: | ||
processors: [service-graphs, span-metrics, local-blocks] # enables metrics generator |
2 changes: 2 additions & 0 deletions
2
generator/src/templates/nginx/http/gateway/otel-stack.server.conf.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% extends "nginx/http/gateway/server.conf.twig" %} | ||
{% block upstream %}{{ upstream }}:8080{% endblock upstream %} |
1 change: 1 addition & 0 deletions
1
generator/src/templates/service/otel-stack/default/otel-stack.yml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% include "service/#{engine}/latest/#{engine}.yml.twig" with _context only %} |
67 changes: 67 additions & 0 deletions
67
generator/src/templates/service/otel-stack/latest/otel-stack.yml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
# Tempo runs as user 10001, and docker compose creates the volume as root. | ||
# As such, we need to chown the volume in order for Tempo to start correctly. | ||
tempo-init: | ||
image: &tempoImage grafana/tempo:main-1a21818 | ||
user: root | ||
entrypoint: | ||
- "chown" | ||
- "10001:10001" | ||
- "/var/tempo" | ||
volumes: | ||
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/tempo:rw | ||
|
||
tempo: | ||
image: *tempoImage | ||
command: [ "-config.file=/etc/tempo.yaml" ] | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/tempo.yaml:/etc/tempo.yaml | ||
- {{ serviceName }}-{{ serviceData['engine'] }}-data:/var/tempo:rw | ||
networks: | ||
- private | ||
expose: | ||
- "14268" # jaeger ingest | ||
- "3200" # tempo | ||
- "4317" # otlp grpc | ||
- "4318" # otlp http | ||
- "9411" # zipkin | ||
depends_on: | ||
- tempo-init | ||
|
||
collector: | ||
image: otel/opentelemetry-collector:0.86.0 | ||
command: [ "--config=/etc/otel-collector.yaml" ] | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/otel-collector.yaml:/etc/otel-collector.yaml | ||
networks: | ||
- private | ||
|
||
prometheus: | ||
image: prom/prometheus:latest | ||
command: | ||
- --config.file=/etc/prometheus.yaml | ||
- --web.enable-remote-write-receiver | ||
- --enable-feature=exemplar-storage | ||
networks: | ||
- private | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/otel-stack/prometheus.yaml:/etc/prometheus.yaml | ||
expose: | ||
- "9090" | ||
|
||
grafana: | ||
image: grafana/grafana:11.0.0 | ||
volumes: | ||
- ./${DEPLOYMENT_PATH}/context/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml | ||
networks: | ||
- public | ||
- private | ||
environment: | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
- GF_AUTH_DISABLE_LOGIN_FORM=true | ||
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor | ||
|
||
expose: | ||
- "3000" | ||
|