diff --git a/config.grafana.traces.yaml b/config.grafana.traces.yaml deleted file mode 100644 index 1ed7949..0000000 --- a/config.grafana.traces.yaml +++ /dev/null @@ -1,18 +0,0 @@ -web_extra_exposed_ports: - # Tempo OTLP/HTTP port - - name: tempo-otlp - container_port: 4318 - http_port: 54318 # HTTP port is not really needed, but it's mandatory. - https_port: 4318 - - # Tempo Zipkin/HTTP port - - name: tempo-zipkin - container_port: 9411 - http_port: 59411 # HTTP port is not really needed, but it's mandatory. - https_port: 9411 - - # Tempo Jaeger/HTTP port - - name: tempo-jaeger - container_port: 14268 - http_port: 64268 # HTTP port is not really needed, but it's mandatory. - https_port: 14268 diff --git a/docker-compose.grafana.logs.yaml b/docker-compose.grafana.logs.yaml index 4251a49..e206a64 100644 --- a/docker-compose.grafana.logs.yaml +++ b/docker-compose.grafana.logs.yaml @@ -15,6 +15,13 @@ services: source: ./grafana/loki/loki.yaml target: /etc/loki/local-config.yaml - loki-data:/loki + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: ${DDEV_APPROOT} + environment: + - VIRTUAL_HOST=$DDEV_HOSTNAME + - HTTP_EXPOSE=3100:3100 + - HTTPS_EXPOSE=3100:3100 agent: container_name: "ddev-${DDEV_SITENAME}-agent" @@ -33,4 +40,3 @@ volumes: name: "ddev-${DDEV_SITENAME}_web-logs" loki-data: name: "ddev-${DDEV_SITENAME}_loki" - diff --git a/docker-compose.grafana.metrics.yaml b/docker-compose.grafana.metrics.yaml index 3ec6a45..03ead31 100644 --- a/docker-compose.grafana.metrics.yaml +++ b/docker-compose.grafana.metrics.yaml @@ -4,16 +4,23 @@ services: image: prom/prometheus:latest user: "${UID:-}:${GID:-}" command: - - '--config.file=/etc/prometheus/prometheus.yaml' - - '--storage.tsdb.path=/prometheus' - - '--web.console.libraries=/etc/prometheus/console_libraries' - - '--web.console.templates=/etc/prometheus/consoles' - - '--web.enable-lifecycle' + - "--config.file=/etc/prometheus/prometheus.yaml" + - "--storage.tsdb.path=/prometheus" + - "--web.console.libraries=/etc/prometheus/console_libraries" + - "--web.console.templates=/etc/prometheus/consoles" + - "--web.enable-lifecycle" volumes: - type: bind source: ./grafana/prometheus/prometheus.yaml target: /etc/prometheus/prometheus.yaml - prometheus-data:/prometheus + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: ${DDEV_APPROOT} + environment: + - VIRTUAL_HOST=$DDEV_HOSTNAME + - HTTP_EXPOSE=9090:9090 + - HTTPS_EXPOSE=9090:9090 # Scraping metrics for web services can be configured in the file # grafana/prometheus/prometheus.yaml diff --git a/docker-compose.grafana.traces.yaml b/docker-compose.grafana.traces.yaml index d53b87e..1e547ea 100644 --- a/docker-compose.grafana.traces.yaml +++ b/docker-compose.grafana.traces.yaml @@ -1,43 +1,22 @@ services: - web: - # Comment this if you don't need to bind trace ports to localhost. - extra_hosts: - - "tempo:127.0.0.1" - tempo: container_name: "ddev-${DDEV_SITENAME}-tempo" image: grafana/tempo:latest - # Comment this if you don't need to bind trace ports to localhost. - network_mode: container:ddev-${DDEV_SITENAME}-web user: "${UID:-}:${GID:-}" + command: + - "-config.file=/etc/tempo.yaml" volumes: - type: bind source: ./grafana/tempo/tempo.yaml target: /etc/tempo.yaml - tempo-data:/data - command: - - "-config.file=/etc/tempo.yaml" - depends_on: - - web - # exposed ports is configured in a separate file: - # config.grafana.tracing.yaml - - # # Another approach to expose HTTP tracing endpoints to the ddev host. - # # Only HTTP endoinds supported via this approach. - # labels: - # com.ddev.site-name: ${DDEV_SITENAME} - # com.ddev.approot: $DDEV_APPROOT - # environment: - # - VIRTUAL_HOST=$DDEV_HOSTNAME - # # We need also to pass DDEV default ports here via adding the substring: - # # ${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILHOG_PORT} - # - HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILHOG_PORT}:8025,4318:4318,9411:9411,14268:14268 - - grafana: - # Required to connect from Grafana container via named hosts. - # Comment this if you don't need to bind trace ports to localhost. - links: - - "web:tempo" + labels: + com.ddev.site-name: ${DDEV_SITENAME} + com.ddev.approot: ${DDEV_APPROOT} + environment: + - VIRTUAL_HOST=$DDEV_HOSTNAME + - HTTP_EXPOSE=4318:4318,9411:9411,14268:14268 + - HTTPS_EXPOSE=4318:4318,9411:9411,14268:14268 volumes: tempo-data: diff --git a/docker-compose.grafana.yaml b/docker-compose.grafana.yaml index ca1fa70..2d64cfb 100644 --- a/docker-compose.grafana.yaml +++ b/docker-compose.grafana.yaml @@ -25,5 +25,5 @@ services: target: /var/lib/grafana/dashboards environment: - VIRTUAL_HOST=$DDEV_HOSTNAME - - HTTP_EXPOSE=3001:3000 # Grafana web interface via HTTP. - - HTTPS_EXPOSE=3000:3000 # Grafana web interface with HTTPS. + - HTTP_EXPOSE=3000:3000 + - HTTPS_EXPOSE=3000:3000 diff --git a/install.yaml b/install.yaml index cbf913d..14a3d5e 100644 --- a/install.yaml +++ b/install.yaml @@ -4,7 +4,6 @@ pre_install_actions: project_files: - config.grafana.logs.yaml - - config.grafana.traces.yaml - docker-compose.grafana.logs.yaml - docker-compose.grafana.metrics.yaml - docker-compose.grafana.traces.yaml diff --git a/tests/test.bats b/tests/test.bats index 69bfea5..ec2b7e6 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -21,7 +21,7 @@ health_checks() { # To make a test run only on local machines, # add the `[ -z "$DDEV_CLOUD_ENV" ] && ` prefix to the command. if [ -n "${GITHUB_ACTIONS:-}" ]; then - DDEV_CLOUD_ENV=1 + DDEV_CLOUD_ENV= else DDEV_CLOUD_ENV= fi @@ -29,16 +29,20 @@ health_checks() { # Grafana service ddev exec "curl -s -o /dev/null http://grafana:3000/api/health" - curl -s -o /dev/null http://${PROJNAME}.ddev.site:3001/api/health + curl -s -o /dev/null http://${PROJNAME}.ddev.site:3000/api/health curl -s -o /dev/null https://${PROJNAME}.ddev.site:3000/api/health echo "Checking Loki service" # Loki takes 15+ secs to initialize, so use the http://loki:3100/ready url # is not a good idea, just checking the services endpoint. ddev exec "curl -s -o /dev/null http://loki:3100/services" + curl -s -o /dev/null http://${PROJNAME}.ddev.site:3100/ + curl -s -o /dev/null https://${PROJNAME}.ddev.site:3100/ echo "Checking Prometeus service" ddev exec "curl -s -o /dev/null http://prometheus:9090/-/ready" + curl -s -o /dev/null http://${PROJNAME}.ddev.site:9090/ + curl -s -o /dev/null https://${PROJNAME}.ddev.site:9090/ echo "Checking Tempo service" # Tempo takes 15 secs to initialize, so use the http://tempo:3200/ready url @@ -46,23 +50,17 @@ health_checks() { ddev exec "curl -s -o /dev/null http://tempo:3200/status/version" echo "Checking Tempo HTTP receivers ports" - echo 4318 ddev exec "curl -s -o /dev/null http://tempo:4318/" - [ -z "$DDEV_CLOUD_ENV" ] && ddev exec "curl -s -o /dev/null http://localhost:4318/" - [ -z "$DDEV_CLOUD_ENV" ] && curl -s -o /dev/null https://${PROJNAME}.ddev.site:4318/ - echo 9411 + curl -s -o /dev/null http://${PROJNAME}.ddev.site:4318/ + curl -s -o /dev/null https://${PROJNAME}.ddev.site:4318/ + ddev exec "curl -s -o /dev/null http://tempo:9411/" - [ -z "$DDEV_CLOUD_ENV" ] && ddev exec "curl -s -o /dev/null http://localhost:9411/" - [ -z "$DDEV_CLOUD_ENV" ] && curl -s -o /dev/null https://${PROJNAME}.ddev.site:9411/ - echo 14268 - echo 1 + curl -s -o /dev/null http://${PROJNAME}.ddev.site:9411/ + curl -s -o /dev/null https://${PROJNAME}.ddev.site:9411/ + ddev exec "curl -s -o /dev/null http://tempo:14268/" - echo 2 - ddev exec "curl -I http://tempo:14268/" - echo 3 - [ -z "$DDEV_CLOUD_ENV" ] && ddev exec "curl -s -o /dev/null http://localhost:14268/" - [ -z "$DDEV_CLOUD_ENV" ] && curl -s -o /dev/null https://${PROJNAME}.ddev.site:14268/ - echo "Fin" + curl -s -o /dev/null http://${PROJNAME}.ddev.site:14268/ + curl -s -o /dev/null https://${PROJNAME}.ddev.site:14268/ } teardown() {