Skip to content

Open Telemetry tracing #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ [email protected]
ADMIN_NAME=admin
[email protected]
PROJECT_INSTALL=
#IMAGE_PHP=skilldlabs/php:83-unit
IMAGE_PHP=skilldlabs/php:83-frankenphp
EXEC_SHELL=bash
PKGMAN=apt
IMAGE_PHP=skilldlabs/php:83-unit
#IMAGE_PHP=skilldlabs/php:83-frankenphp
#EXEC_SHELL=bash
#PKGMAN=apt
IMAGE_NGINX=skilldlabs/nginx:1.24
IMAGE_FRONT=node:lts-alpine
IMAGE_SOLR=solr:8-slim
Expand All @@ -32,3 +32,4 @@ REDIS_PORT=6379
REDIS_PASSWD=1234567890
# See readme for basicauth convention
RA_BASIC_AUTH=
ADDITIONAL_PHP_PACKAGES=php83-pecl-grpc php83-pecl-opentelemetry php83-pecl-protobuf
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,4 @@ drush:
# frankenphp/caddy https://caddyserver.com/docs/api
reload:
$(call php-0, /bin/sh ./scripts/makefile/reload.sh /var/www/html/docker)
$(call php-0, /bin/sh ./scripts/makefile/reload.sh)
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"drupal/migrate_generator": "^2.0",
"drupal/seven": "^1.0",
"drush/drush": "^13.2",
"mladenrtl/opentelemetry-auto-drupal": "^0.1",
"open-telemetry/exporter-otlp": "^1.1",
"skilldlabs/drupal-cleanup": "^1",
"skilldlabs/druxxy": "^1.1",
"webflo/drupal-finder": "^1.3"
Expand Down Expand Up @@ -59,7 +61,9 @@
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"drupal/core-vendor-hardening": true,
"skilldlabs/drupal-cleanup": true
"php-http/discovery": false,
"skilldlabs/drupal-cleanup": true,
"tbachert/spi": false
}
},
"autoload": {
Expand Down
42 changes: 42 additions & 0 deletions docker/docker-compose.override.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ services:
php:
environment:
COMPOSER_MEMORY_LIMIT: "1G"
OTEL_PHP_AUTOLOAD_ENABLED: true
OTEL_TRACES_EXPORTER: otlp
OTEL_EXPORTER_OTLP_ENDPOINT: http://tempo:4318
OTEL_EXPORTER_OTLP_PROTOCOL: http/json
# BLACKFIRE_CLIENT_ID: x
# BLACKFIRE_CLIENT_TOKEN: x
# NEW_RELIC_APPNAME: "${COMPOSE_PROJECT_NAME}"
Expand All @@ -43,6 +47,44 @@ services:
- 'traefik.http.middlewares.web-${COMPOSE_PROJECT_NAME}.basicauth.users=${RA_BASIC_AUTH}'
- 'traefik.http.middlewares.web-${COMPOSE_PROJECT_NAME}.basicauth.removeheader=true'

# 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.

init:
image: &tempoImage grafana/tempo:latest
user: root
entrypoint:
- "chown"
- "10001:10001"
- "/var/tempo"
volumes:
- ${DB_DATA_DIR}/tempo:/var/tempo

# To eventually offload to Tempo...
tempo:
<<: *service-defaults
image: *tempoImage
container_name: "${COMPOSE_PROJECT_NAME}_tempo"
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- "./tempo.yml:/etc/tempo.yaml"
- ${DB_DATA_DIR}/tempo:/var/tempo

grafana:
<<: *service-defaults
image: grafana/grafana:latest
container_name: "${COMPOSE_PROJECT_NAME}_grafana"
volumes:
- "./grafana-datasources.yml:/etc/grafana/provisioning/datasources/datasources.yaml"
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
labels:
- 'sdc.port=3000'
- 'traefik.enable=true'

# Get access keys from https://blackfire.io/my/profiles
# Then download extension using "make blackfire"

Expand Down
18 changes: 18 additions & 0 deletions docker/grafana-datasources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: 1

datasources:
- 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
46 changes: 46 additions & 0 deletions docker/tempo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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

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:
metrics_generator:
processors: [service-graphs, span-metrics, local-blocks] # enables metrics generator