Added integration testing with OTel

This commit is contained in:
vladvildanov
2026-11-25 12:12:32 +02:00
parent aba81b94d0
commit ee955ff682
11 changed files with 373 additions and 7 deletions
+13
View File
@@ -119,3 +119,16 @@ services:
profiles:
- sentinel
- all
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
container_name: otel-collector
command: ["--config=/etc/otel-collector.yml"]
ports:
- 4318:4318 # OTLP HTTP receiver
- 8889:8889 # Prometheus endpoint read by the tests
volumes:
- "./otel-collector.yml:/etc/otel-collector.yml"
profiles:
- otel
- all
+15
View File
@@ -0,0 +1,15 @@
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
exporters:
prometheus:
endpoint: 0.0.0.0:8889
service:
pipelines:
metrics:
receivers: [otlp]
exporters: [prometheus]
+21 -3
View File
@@ -139,10 +139,28 @@ jobs:
with:
dependency-versions: highest
# Optional dependency that cannot be part of require-dev: it does not support PHP < 8.1.
- name: Install OpenTelemetry API
# Optional dependencies that cannot be part of require-dev: they do not support PHP < 8.2.
- name: Install OpenTelemetry SDK
if: ${{ matrix.php >= '8.2' }}
run: composer require --dev --no-interaction open-telemetry/api
run: |
composer config --no-plugins allow-plugins.php-http/discovery false
composer config --no-plugins allow-plugins.tbachert/spi false
composer require --dev --no-interaction open-telemetry/sdk open-telemetry/exporter-otlp guzzlehttp/guzzle
- name: Start OpenTelemetry collector
if: ${{ matrix.php >= '8.2' }}
uses: hoverkraft-tech/compose-action@v3.2.0
with:
compose-file: .github/docker-compose.yml
services: otel-collector
- name: Run OpenTelemetry tests
if: ${{ matrix.php >= '8.2' }}
run: vendor/bin/phpunit --group otel
- name: Run OpenTelemetry tests using Relay
if: ${{ matrix.php >= '8.2' && matrix.redis >= '8.0' }}
run: vendor/bin/phpunit -c phpunit.relay.xml --group otel
- name: Run tests
if: ${{ matrix.php != '8.4' || matrix.redis != '8.0' }}