{"id":18868745,"url":"https://github.com/inspector-apm/inspector-php","last_synced_at":"2026-01-30T19:06:02.004Z","repository":{"id":34461337,"uuid":"179131088","full_name":"inspector-apm/inspector-php","owner":"inspector-apm","description":"Connect your PHP application to Inspector monitoring dashboard.","archived":false,"fork":false,"pushed_at":"2026-01-21T11:27:35.000Z","size":400,"stargazers_count":34,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-21T22:57:18.058Z","etag":null,"topics":["error-handling","error-monitoring","error-reporting","inspector","monitoring","monitoring-tool","php"],"latest_commit_sha":null,"homepage":"https://inspector.dev?utm_source=github\u0026utm_medium=link\u0026utm_campaign=organic\u0026utm_content=php","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inspector-apm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-02T17:57:01.000Z","updated_at":"2026-01-21T11:26:53.000Z","dependencies_parsed_at":"2023-01-15T07:13:53.229Z","dependency_job_id":"3c047592-a459-40b3-a880-66b4e1e30c16","html_url":"https://github.com/inspector-apm/inspector-php","commit_stats":{"total_commits":426,"total_committers":5,"mean_commits":85.2,"dds":"0.018779342723004744","last_synced_commit":"a492f18ebfbea41b32d71284d5a51e14ed948f5c"},"previous_names":[],"tags_count":207,"template":false,"template_full_name":null,"purl":"pkg:github/inspector-apm/inspector-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-apm%2Finspector-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-apm%2Finspector-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-apm%2Finspector-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-apm%2Finspector-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inspector-apm","download_url":"https://codeload.github.com/inspector-apm/inspector-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inspector-apm%2Finspector-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["error-handling","error-monitoring","error-reporting","inspector","monitoring","monitoring-tool","php"],"created_at":"2024-11-08T05:14:40.627Z","updated_at":"2026-01-30T19:06:01.998Z","avatar_url":"https://github.com/inspector-apm.png","language":"PHP","readme":"# Inspector | Code Execution Monitoring Tool\n\n[![Total Downloads](https://poser.pugx.org/inspector-apm/inspector-php/downloads)](//packagist.org/packages/inspector-apm/inspector-php)\n[![Latest Stable Version](https://poser.pugx.org/inspector-apm/inspector-php/v/stable)](https://packagist.org/packages/inspector-apm/inspector-php)\n[![License](https://poser.pugx.org/inspector-apm/inspector-php/license)](//packagist.org/packages/inspector-apm/inspector-php)\n\n\u003e Before moving on, please consider giving us a GitHub star ⭐️. Thank you!\n\nCode Execution Monitoring, built for PHP developers.\n\n## Requirements\n\n- PHP \u003e= ^8.1\n\n## Install\nInstall the latest version by:\n\n```shell\ncomposer require inspector-apm/inspector-php\n```\n\n## Use\n\nTo start sending data to Inspector you need an Ingestion Key to create an instance of the `Configuration` class.\nYou can obtain `INSPECTOR_API_KEY` creating a new project in your [Inspector](https://www.inspector.dev) dashboard.\n\n```php\nuse Inspector\\Inspector;\nuse Inspector\\Configuration;\n\n$configuration = new Configuration('YOUR_INGESTION_KEY');\n$inspector = new Inspector($configuration);\n```\n\nAll start with a `transaction`. Transaction represents an execution cycle, and it can contain one or hundred of segments:\n\n```php\n// Start an execution cycle with a transaction\n$inspector-\u003estartTransaction($_SERVER['PATH_INFO']);\n```\n\nUse `addSegment` method to monitor a code block in your transaction:\n\n```php\n$result = $inspector-\u003eaddSegment(function ($segment) {\n    // Do something here...\n\treturn \"Hello World!\";\n}, 'my-process');\n\necho $result; // this will print \"Hello World!\"\n```\n\nInspector will monitor your code execution in real time alerting you if something goes wrong.\n\n## Custom Transport\nYou can also set up a custom transport class to transfer monitoring data from your server to Inspector\nin a personalized way.\n\nThe transport class needs to implement `\\Inspector\\Transports\\TransportInterface`:\n\n```php\nclass CustomTransport implements \\Inspector\\Transports\\TransportInterface\n{\n    protected $configuration;\n\n    protected $queue = [];\n\n    public function __constructor($configuration)\n    {\n        $this-\u003econfiguration = $configuration;\n    }\n\n    public function addEntry(\\Inspector\\Models\\Model $entry)\n    {\n        // Add an \\Inspector\\Models\\Model entry in the queue.\n        $this-\u003equeue[] = $entry;\n    }\n\n    public function flush()\n    {\n        // Performs data transfer.\n        $handle = curl_init('https://ingest.inspector.dev');\n        curl_setopt($handle, CURLOPT_POST, 1);\n        curl_setopt($handle, CURLOPT_HTTPHEADER, [\n            'X-Inspector-Key: xxxxxxxxxxxx',\n            'Content-Type: application/json',\n            'Accept: application/json',\n        ]);\n        curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($this-\u003equeue));\n        curl_exec($handle);\n        curl_close($handle);\n    }\n}\n```\n\nThen you can set the new transport in the `Inspector` instance\nusing a callback that will receive the current configuration state as parameter.\n\n```php\n$inspector-\u003esetTransport(function (\\Inspector\\Configuration $configuration) {\n    return new CustomTransport($configuration);\n});\n```\n\n**[Chek out the official documentation](https://docs.inspector.dev/php)**\n\n\u003ca name=\"agentic\"\u003e\u003c/a\u003e\n\n## Agentic Integration\n\nYou can connect the Inspector library documentation to your coding assistant as a Model Context Protocol (MCP) server.\n\nIt makes it easy for tools like Claude Code, Cursor, and VS Code extensions reliably understand what Inspector\nclient library can do, its configurations, how to use it.\n\n[AI Assisted Integration](https://docs.inspector.dev/concepts/agentic-integration)\n\n## Contributing\n\nWe encourage you to contribute to Inspector! Please check out the [Contribution Guidelines](CONTRIBUTING.md) about how to proceed. Join us!\n\n## LICENSE\n\nThis package is licensed under the [MIT](LICENSE) license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspector-apm%2Finspector-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finspector-apm%2Finspector-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finspector-apm%2Finspector-php/lists"}