Skip to content
Closed
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
10 changes: 9 additions & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
'Instrumentation/MySqli',
'Instrumentation/OpenAIPHP',
'Instrumentation/PDO',
'Instrumentation/PgSql',
# Sort PSRs numerically.
'Instrumentation/Psr3',
'Instrumentation/Psr6',
Expand Down Expand Up @@ -78,6 +79,8 @@ jobs:
php-version: 8.1
- project: 'Instrumentation/PDO'
php-version: 8.1
- project: 'Instrumentation/PgSql'
php-version: 8.1
steps:
- uses: actions/checkout@v4

Expand All @@ -86,7 +89,7 @@ jobs:
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
extensions: ast, amqp, grpc, opentelemetry, rdkafka, mysqli
extensions: ast, amqp, grpc, opentelemetry, rdkafka, mysqli, pgsql

- name: Validate composer.json and composer.lock
run: composer validate
Expand Down Expand Up @@ -151,6 +154,11 @@ jobs:
run: |
docker compose up mysql -d --wait

- name: Start PostgreSQL
if: ${{ matrix.project == 'Instrumentation/PgSql' }}
run: |
docker compose up postgres -d --wait

- name: Run PHPUnit
working-directory: src/${{ matrix.project }}
run: vendor/bin/phpunit
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"OpenTelemetry\\Contrib\\Instrumentation\\MySqli\\": "src/Instrumentation/MySqli/src",
"OpenTelemetry\\Contrib\\Instrumentation\\OpenAIPHP\\": "src/Instrumentation/OpenAIPHP/src",
"OpenTelemetry\\Contrib\\Instrumentation\\PDO\\": "src/Instrumentation/PDO/src",
"OpenTelemetry\\Contrib\\Instrumentation\\PgSql\\": "src/Instrumentation/PgSql/src",
"OpenTelemetry\\Contrib\\Instrumentation\\Psr3\\": "src/Instrumentation/Psr3/src",
"OpenTelemetry\\Contrib\\Instrumentation\\Psr6\\": "src/Instrumentation/Psr6/src",
"OpenTelemetry\\Contrib\\Instrumentation\\Psr14\\": "src/Instrumentation/Psr14/src",
Expand Down Expand Up @@ -73,6 +74,7 @@
"src/Instrumentation/MySqli/_register.php",
"src/Instrumentation/OpenAIPHP/_register.php",
"src/Instrumentation/PDO/_register.php",
"src/Instrumentation/PgSql/_register.php",
"src/Instrumentation/Psr3/_register.php",
"src/Instrumentation/Psr6/_register.php",
"src/Instrumentation/Psr14/_register.php",
Expand Down Expand Up @@ -146,6 +148,7 @@
"open-telemetry/opentelemetry-auto-mysqli": "self.version",
"open-telemetry/opentelemetry-auto-openai-php": "self.version",
"open-telemetry/opentelemetry-auto-pdo": "self.version",
"open-telemetry/opentelemetry-auto-pgsql": "self.version",
"open-telemetry/opentelemetry-auto-psr3": "self.version",
"open-telemetry/opentelemetry-auto-psr6": "self.version",
"open-telemetry/opentelemetry-auto-psr14": "self.version",
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ services:
MONGODB_HOST: ${MONGODB_HOST:-mongodb}
MONGODB_PORT: ${MONGODB_PORT:-27017}
MYSQL_HOST: ${MYSQL_HOST:-mysql}
PGSQL_HOST: ${PGSQL_HOST:-postgres}
PGSQL_DATABASE: ${PGSQL_DATABASE:-postgres}
PGSQL_USER: ${PGSQL_USER:-postgres}
PGSQL_PASSWD: ${PGSQL_PASSWD:-postgres_password}

zipkin:
image: openzipkin/zipkin-slim
Expand Down Expand Up @@ -88,3 +92,16 @@ services:
retries: 3
volumes:
- ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql

postgres:
image: postgres:17
hostname: postgres
ports:
- "5432:5432/tcp"
environment:
POSTGRES_PASSWORD: postgres_password
healthcheck:
test: psql -c 'SELECT 1' -h localhost postgres postgres
interval: 1s
timeout: 30s
retries: 10
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN install-php-extensions \
mongodb \
amqp \
rdkafka \
mysqli
mysqli \
pgsql

USER php
12 changes: 12 additions & 0 deletions src/Instrumentation/PgSql/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
* text=auto

*.md diff=markdown
*.php diff=php

/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.php export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml.dist export-ignore
/tests export-ignore
1 change: 1 addition & 0 deletions src/Instrumentation/PgSql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
Loading
Loading