{"id":21424820,"url":"https://github.com/opentelemetry-php/contrib-auto-psr3","last_synced_at":"2025-07-14T08:31:58.716Z","repository":{"id":176715355,"uuid":"651289903","full_name":"opentelemetry-php/contrib-auto-psr3","owner":"opentelemetry-php","description":"[READONLY] OpenTelemetry psr-3 auto-instrumentation","archived":false,"fork":false,"pushed_at":"2025-05-20T01:40:59.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-21T17:18:18.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opentelemetry-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-08T23:41:47.000Z","updated_at":"2025-05-14T00:20:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"594e6889-3c52-4dfe-8f9f-7cbb01f07237","html_url":"https://github.com/opentelemetry-php/contrib-auto-psr3","commit_stats":null,"previous_names":["opentelemetry-php/contrib-auto-psr3"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/opentelemetry-php/contrib-auto-psr3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-psr3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-psr3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-psr3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-psr3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentelemetry-php","download_url":"https://codeload.github.com/opentelemetry-php/contrib-auto-psr3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-psr3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262625,"owners_count":23736433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T21:24:44.072Z","updated_at":"2025-07-14T08:31:56.969Z","avatar_url":"https://github.com/opentelemetry-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Releases](https://img.shields.io/badge/releases-purple)](https://github.com/opentelemetry-php/contrib-auto-psr3/releases)\n[![Issues](https://img.shields.io/badge/issues-pink)](https://github.com/open-telemetry/opentelemetry-php/issues)\n[![Source](https://img.shields.io/badge/source-contrib-green)](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation/Psr3)\n[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-auto-psr3)\n[![Latest Version](http://poser.pugx.org/open-telemetry/opentelemetry-auto-psr3/v/unstable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-psr3/)\n[![Stable](http://poser.pugx.org/open-telemetry/opentelemetry-auto-psr3/v/stable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-psr3/)\n\nThis is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.\n\n# OpenTelemetry PSR-3 auto-instrumentation\n\nPlease read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to\ninstall and configure the extension and SDK.\n\n## Overview\nAuto-instrumentation hooks are registered via composer, and depending on the mode, will:\n\n* automatically inject trace id and span id into log message context of any psr3 logger; or\n* transform the message into the OpenTelemetry LogRecord format, for export to an OpenTelemetry logging-compatible backend\n\n## Mode\n\nThe package can operate in two modes, controlled by the environment variable `OTEL_PHP_PSR3_MODE`:\n\n### `inject`\nInject `traceId` and `spanId` of the active trace span into the context of each logged message. Depending on the PSR-3 implementation,\nthe values may be written to the log output, or may be available for interpolation into the log message.\n\nFor example:\n\n```php\nputenv('OTEL_PHP_PSR3_MODE=inject');\nrequire 'vendor/autoload.php';\n\n$logger = /* create logger */\n$logger-\u003einfo('traceId={traceId} spanId={spanId}');\n```\n\n### `export`\nThe logged output will be processed and emitted by the logger as normal, but the output will also be encoded using\nthe [OpenTelemetry log model](https://opentelemetry.io/docs/specs/otel/logs/data-model/) and can be\nexported to an OpenTelemetry-compatible backend.\n\n```php\nputenv('OTEL_PHP_PSR3_MODE=export');\nputenv('OTEL_PHP_AUTOLOAD_ENABLED=true');\nputenv('OTEL_LOGS_EXPORTER=console');\nrequire 'vendor/autoload.php';\n\n$logger = /* create logger */\n$logger-\u003einfo('Hello, OTEL');\n```\n\n## Configuration\n\nThe extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration):\n\n```shell\nOTEL_PHP_DISABLED_INSTRUMENTATIONS=psr3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentelemetry-php%2Fcontrib-auto-psr3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentelemetry-php%2Fcontrib-auto-psr3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentelemetry-php%2Fcontrib-auto-psr3/lists"}