{"id":20993574,"url":"https://github.com/felix-lessoer/cakephp_elasticapm","last_synced_at":"2026-04-28T10:04:50.762Z","repository":{"id":62504110,"uuid":"248055020","full_name":"felix-lessoer/cakephp_elasticapm","owner":"felix-lessoer","description":"Monitor your cakephp project with Elastic APM","archived":false,"fork":false,"pushed_at":"2020-03-17T20:13:40.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T12:42:42.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://elastic.co","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felix-lessoer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-17T19:22:59.000Z","updated_at":"2023-11-24T20:49:30.000Z","dependencies_parsed_at":"2022-11-02T12:03:30.738Z","dependency_job_id":null,"html_url":"https://github.com/felix-lessoer/cakephp_elasticapm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/felix-lessoer/cakephp_elasticapm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-lessoer%2Fcakephp_elasticapm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-lessoer%2Fcakephp_elasticapm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-lessoer%2Fcakephp_elasticapm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-lessoer%2Fcakephp_elasticapm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felix-lessoer","download_url":"https://codeload.github.com/felix-lessoer/cakephp_elasticapm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-lessoer%2Fcakephp_elasticapm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28098795,"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","status":"online","status_checked_at":"2025-12-28T02:00:05.685Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-19T07:15:22.054Z","updated_at":"2025-12-28T11:05:20.623Z","avatar_url":"https://github.com/felix-lessoer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enable Elastic APM for your cake php project\n\nFor now this plugin supports to collect common events from cake php. Tested in cake php v3.8 .\nThis plugin is based on the [Elastic APM php agent](https://github.com/philkra/elastic-apm-php-agent)\n\n## Installation\n\nJust use composer to setup the plugin\n```\ncomposer require felix-lessoer/cakephp-elasticapm\n```\n\n## Configuration\nInclude this snippet in `config/app.php`\n\n```php\n'ElasticApm' =\u003e [\n        'enabled' =\u003e true,\n        'rumEnabled' =\u003e true,\n        'appName' =\u003e '\u003capp name\u003e',\n        'appVersion' =\u003e \"1.0\",\n        'serverUrl' =\u003e '\u003capm server url\u003e',\n        'secretToken' =\u003e '\u003capm server secret token\u003e',\n        'environment' =\u003e \"development\"\n    ]\n```\n`enabled`: If false the collection gets deactivated\n\nInclude this snippet in `src/Application.php` in your function `bootstrap()`\n\n```php\nif (Configure::read('ElasticApm.enabled')) {\n    $this-\u003eaddPlugin(ElasticApmPlugin::class);\n}\n```\n\n## Add RUM agent\nThe RUM agent is optional, but provides better insights into your page speed.\n\nDownload the agent [here](https://github.com/elastic/apm-agent-rum-js/releases) and add it into your `webroot/js` dirctory\n\nAdd this to into the `\u003chead\u003e` area of your page\n`\u003c?php echo $this-\u003eHtml-\u003escript('elastic-apm-rum.umd.min.js'); ?\u003e`\n\nAdd this snipped directly at the beginning of `\u003cbody\u003e`:\n```\n  \u003cscript\u003e\n    var parts = window.location.pathname.split('?');\n    var pageName = window.location.pathname;\n    if (parts.length \u003e 0) {\n      pageName = parts[0]\n    }\n    if (\u003c?php echo Configure::read('ElasticApm.rumEnabled'); ?\u003e) {\n      elasticApm.init({\n        serviceName: '\u003c?php echo Configure::read('ElasticApm.appName'); ?\u003e RUM',\n        serverUrl: '\u003c?php echo Configure::read('ElasticApm.serverUrl'); ?\u003e',\n        environment: '\u003c?php echo Configure::read('ElasticApm.environment'); ?\u003e',\n        serviceVersion: '\u003c?php echo Configure::read('ElasticApm.appVersion'); ?\u003e',\n        pageLoadTraceId: '\u003c?= $traceId ?\u003e',\n        pageLoadSpanId: '\u003c?= $spanId ?\u003e',\n        pageLoadSampled: true,\n        pageLoadTransactionName: pageName,\n        breakdownMetrics: true,\n        //monitorLongtasks: true,\n      });\n      //Optional adding user context\n      elasticApm.setUserContext({\n        id: \u003cuserid\u003e,\n        username: \u003cusername\u003e,\n      });\n    }\n  \u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelix-lessoer%2Fcakephp_elasticapm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelix-lessoer%2Fcakephp_elasticapm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelix-lessoer%2Fcakephp_elasticapm/lists"}