{"id":21424813,"url":"https://github.com/opentelemetry-php/contrib-auto-curl","last_synced_at":"2025-07-14T08:31:58.352Z","repository":{"id":260276404,"uuid":"880803276","full_name":"opentelemetry-php/contrib-auto-curl","owner":"opentelemetry-php","description":"[READONLY] Curl auto-instrumentation","archived":false,"fork":false,"pushed_at":"2025-06-11T12:16:34.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-17T12:04:16.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"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":"2024-10-30T11:45:58.000Z","updated_at":"2025-06-11T12:16:38.000Z","dependencies_parsed_at":"2024-10-30T14:28:41.052Z","dependency_job_id":"b7116381-5cbf-41e6-8991-1bfde6a606d2","html_url":"https://github.com/opentelemetry-php/contrib-auto-curl","commit_stats":null,"previous_names":["opentelemetry-php/contrib-auto-curl"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/opentelemetry-php/contrib-auto-curl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-curl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-curl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-curl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-curl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentelemetry-php","download_url":"https://codeload.github.com/opentelemetry-php/contrib-auto-curl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentelemetry-php%2Fcontrib-auto-curl/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:42.651Z","updated_at":"2025-07-14T08:31:56.668Z","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-curl/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/curl)\n[![Mirror](https://img.shields.io/badge/mirror-opentelemetry--php--contrib-blue)](https://github.com/opentelemetry-php/contrib-auto-curl)\n[![Latest Version](http://poser.pugx.org/open-telemetry/opentelemetry-auto-curl/v/unstable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-curl/)\n[![Stable](http://poser.pugx.org/open-telemetry/opentelemetry-auto-curl/v/stable)](https://packagist.org/packages/open-telemetry/opentelemetry-auto-curl/)\n\nThis is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.\n\n# OpenTelemetry curl 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 client kind spans will automatically be created when calling `curl_exec` or `curl_multi_exec` functions.\nAdditionally, distributed tracing is supported by setting the `traceparent` header.\n\n## Limitations\nThe curl_multi instrumentation is not resilient to shortcomings in the application and requires proper implementation. If the application does not call the curl_multi_info_read function, the instrumentation will be unable to measure the execution time for individual requests-time will be aggregated for all transfers. Similarly, error detection will be impacted, as the error code information will be missing in this case. In case of encountered issues, it is recommended to review the application code and adjust it to match example #1 provided in [curl_multi_exec documentation](https://www.php.net/manual/en/function.curl-multi-exec.php).\n\nTo ensure the stability of the monitored application, capturing request headers sent to the server works only if the application does not use the `CURLOPT_VERBOSE` option.\n\n## Configuration\n\n### Disabling curl instrumentation\n\nThe extension can be disabled via [runtime configuration](https://opentelemetry.io/docs/instrumentation/php/sdk/#configuration):\n\n```shell\nOTEL_PHP_DISABLED_INSTRUMENTATIONS=curl\n```\n\n### Request and response headers capturing\n\nCurl auto-instrumentation enables capturing headers from both requests and responses. This feature is disabled by default and be enabled through environment variables or array directives in the `php.ini` configuration file.\n\nTo enable response header capture from the server, specify the required headers as shown in the example below. In this case, the \"Content-Type\" and \"Server\" headers will be captured. These options values are case-insensitive:\n\n#### Environment variables configuration\n\n```bash\nOTEL_PHP_INSTRUMENTATION_HTTP_RESPONSE_HEADERS=content-type,server\nOTEL_PHP_INSTRUMENTATION_HTTP_REQUEST_HEADERS=host,accept\n```\n\n#### php.ini configuration\n\n```ini\nOTEL_PHP_INSTRUMENTATION_HTTP_RESPONSE_HEADERS=content-type,server\n; or\notel.instrumentation.http.response_headers[]=content-type\notel.instrumentation.http.response_headers[]=server\n```\n\n\nSimilarly, to capture headers sent in a request to the server, use the following configuration:\n\n```ini\nOTEL_PHP_INSTRUMENTATION_HTTP_REQUEST_HEADERS=host,accept\n; or\notel.instrumentation.http.request_headers[]=host\notel.instrumentation.http.request_headers[]=accept\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentelemetry-php%2Fcontrib-auto-curl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentelemetry-php%2Fcontrib-auto-curl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentelemetry-php%2Fcontrib-auto-curl/lists"}