https://github.com/opentelemetry-php/contrib-auto-postgresql
[READONLY] Postgresql auto-instrumentation
https://github.com/opentelemetry-php/contrib-auto-postgresql
Last synced: 10 months ago
JSON representation
[READONLY] Postgresql auto-instrumentation
- Host: GitHub
- URL: https://github.com/opentelemetry-php/contrib-auto-postgresql
- Owner: opentelemetry-php
- Created: 2025-08-01T14:01:59.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-01T14:04:08.000Z (11 months ago)
- Last Synced: 2025-09-04T19:02:50.152Z (10 months ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/open-telemetry/opentelemetry-php-contrib/releases)
[](https://github.com/open-telemetry/opentelemetry-php/issues)
[](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation/PostgreSql)
[](https://github.com/open-telemetry/opentelemetry-php-contrib)
[](https://packagist.org/packages/open-telemetry/opentelemetry-auto-postgresql/)
[](https://packagist.org/packages/open-telemetry/opentelemetry-auto-postgresql/)
> This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
# OpenTelemetry PostgreSQL auto-instrumentation
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to
install and configure the extension and SDK.
## Overview
This package provides auto-instrumentation for the PostgreSQL native PHP extension (`ext-pgsql`).
Hooks are registered via Composer, and client spans are automatically created for key database operations.
Supported functions include:
### Connection
- `pg_connect`
- `pg_pconnect`
### Queries
- `pg_query`
- `pg_query_params`
- `pg_send_query`
- `pg_send_query_params`
- `pg_get_result`
### Prepared Statements
- `pg_prepare`
- `pg_send_prepare`
- `pg_execute`
- `pg_send_execute`
### Table/Row Operations
- `pg_insert`
- `pg_select`
- `pg_update`
- `pg_delete`
### COPY
- `pg_copy_from`
- `pg_copy_to`
### Large Objects (LOB)
- `pg_lo_create`
- `pg_lo_open`
- `pg_lo_write`
- `pg_lo_read`
- `pg_lo_read_all`
- `pg_lo_unlink`
- `pg_lo_import`
- `pg_lo_export`
## Configuration
### Disabling PostgreSQL instrumentation
The extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration):
```shell
OTEL_PHP_DISABLED_INSTRUMENTATIONS=postgresql
```
## Compatibility
PHP 8.2 or newer is required