{"id":18550151,"url":"https://github.com/renoki-co/octane-exporter","last_synced_at":"2025-04-09T21:32:52.390Z","repository":{"id":37961822,"uuid":"410801641","full_name":"renoki-co/octane-exporter","owner":"renoki-co","description":"Export Laravel Octane metrics using this Prometheus exporter.","archived":false,"fork":false,"pushed_at":"2023-10-11T07:53:54.000Z","size":68,"stargazers_count":28,"open_issues_count":3,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T12:39:39.649Z","etag":null,"topics":["grafana","hacktoberfest","laravel","metrics","octane","ops","php","prometheus"],"latest_commit_sha":null,"homepage":"","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/renoki-co.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"rennokki"}},"created_at":"2021-09-27T08:24:50.000Z","updated_at":"2024-06-08T14:30:20.000Z","dependencies_parsed_at":"2023-02-16T08:01:16.032Z","dependency_job_id":null,"html_url":"https://github.com/renoki-co/octane-exporter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":"renoki-co/laravel-package-skeleton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renoki-co%2Foctane-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renoki-co%2Foctane-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renoki-co%2Foctane-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renoki-co%2Foctane-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renoki-co","download_url":"https://codeload.github.com/renoki-co/octane-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248114915,"owners_count":21050141,"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":["grafana","hacktoberfest","laravel","metrics","octane","ops","php","prometheus"],"created_at":"2024-11-06T21:03:37.567Z","updated_at":"2025-04-09T21:32:52.063Z","avatar_url":"https://github.com/renoki-co.png","language":"PHP","funding_links":["https://github.com/sponsors/rennokki"],"categories":[],"sub_categories":[],"readme":"Laravel Octane Prometheus Exporter\n==================================\n\n![CI](https://github.com/renoki-co/octane-exporter/workflows/CI/badge.svg?branch=master)\n[![codecov](https://codecov.io/gh/renoki-co/octane-exporter/branch/master/graph/badge.svg)](https://codecov.io/gh/renoki-co/octane-exporter/branch/master)\n[![StyleCI](https://github.styleci.io/repos/410801641/shield?branch=master)](https://github.styleci.io/repos/410801641)\n[![Latest Stable Version](https://poser.pugx.org/renoki-co/octane-exporter/v/stable)](https://packagist.org/packages/renoki-co/octane-exporter)\n[![Total Downloads](https://poser.pugx.org/renoki-co/octane-exporter/downloads)](https://packagist.org/packages/renoki-co/octane-exporter)\n[![Monthly Downloads](https://poser.pugx.org/renoki-co/octane-exporter/d/monthly)](https://packagist.org/packages/renoki-co/octane-exporter)\n[![License](https://poser.pugx.org/renoki-co/octane-exporter/license)](https://packagist.org/packages/renoki-co/octane-exporter)\n\nExport Laravel Octane metrics using this Prometheus exporter.\n\n## 🤝 Supporting\n\n**If you are using one or more Renoki Co. open-source packages in your production apps, in presentation demos, hobby projects, school projects or so, sponsor our work with [Github Sponsors](https://github.com/sponsors/rennokki). 📦**\n\n[\u003cimg src=\"https://github-content.s3.fr-par.scw.cloud/static/30.jpg\" height=\"210\" width=\"418\" /\u003e](https://github-content.renoki.org/github-repo/30)\n\n## 🚀 Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require renoki-co/octane-exporter\n```\n\nIn case you haven't published your Octane settings, do so:\n\n```bash\nphp artisan octane:install\n```\n\nNext up, add the following Octane tables in your `config/octane.php`. These tables will be used to keep track of stats for the events:\n\n```php\nreturn [\n\n    'tables' =\u003e [\n        'octane_exporter_requests:1' =\u003e [\n            'total_count' =\u003e 'int',\n            '2xx_count' =\u003e 'int',\n            '3xx_count' =\u003e 'int',\n            '4xx_count' =\u003e 'int',\n            '5xx_count' =\u003e 'int',\n        ],\n        'octane_exporter_tasks:1' =\u003e [\n            'total_count' =\u003e 'int',\n            'active_count' =\u003e 'int',\n        ],\n        'octane_exporter_workers:1' =\u003e [\n            'active_count' =\u003e 'int',\n        ],\n        'octane_exporter_ticks:1' =\u003e [\n            'total_count' =\u003e 'int',\n            'active_count' =\u003e 'int',\n        ],\n\n        // ...\n    ],\n\n];\n```\n\nThe final step is to add the following listeners after the already existent ones in `config/octane.php`:\n\n```php\nreturn [\n\n    'listeners' =\u003e [\n        WorkerStarting::class =\u003e [\n            // ...\n            \\RenokiCo\\OctaneExporter\\Listeners\\TrackStartedWorkers::class,\n        ],\n\n        RequestTerminated::class =\u003e [\n            // ...\n            \\RenokiCo\\OctaneExporter\\Listeners\\TrackTerminatedRequests::class,\n        ],\n\n        TaskReceived::class =\u003e [\n            // ...\n            \\RenokiCo\\OctaneExporter\\Listeners\\TrackReceivedTasks::class,\n        ],\n\n        TaskTerminated::class =\u003e [\n            // ...\n            \\RenokiCo\\OctaneExporter\\Listeners\\TrackTerminatedTasks::class,\n        ],\n\n        TickReceived::class =\u003e [\n            // ...\n            \\RenokiCo\\OctaneExporter\\Listeners\\TrackReceivedTicks::class,\n        ],\n\n        TickTerminated::class =\u003e [\n            // ...\n            \\RenokiCo\\OctaneExporter\\Listeners\\TrackTerminatedTicks::class,\n        ],\n\n        WorkerStopping::class =\u003e [\n            // ...\n            \\RenokiCo\\OctaneExporter\\Listeners\\TrackStoppedWorkers::class,\n        ],\n    ],\n\n];\n```\n\n## 🙌 Usage\n\nThis package is pretty straightforward. Upon installing it, it will register the route at `/exporter/group/octane-metrics` and you can point Prometheus towards it for scraping.\n\n```yaml\nscrape_configs:\n  - job_name: 'octane'\n    metrics_path: '/exporter/group/octane-metrics'\n    scrape_interval: 5\n    static_configs:\n      - targets: ['localhost:8000']\n        labels:\n          app: 'my-octane-app'\n```\n\nPlease keep in mind that the metrics are calculated by-process. Point your Prometheus scraper to all instances that run the Octane start command.\n\n```\n# HELP laravel_octane_active_tasks_count Get the number of active tasks that pass through Octane.\n# TYPE laravel_octane_active_tasks_count gauge\nlaravel_octane_active_tasks_count{remote_addr=\"\",addr=\"\",name=\"\"} 0\n# HELP laravel_octane_active_ticks_count Get the number of active ticks that run currently in Octane.\n# TYPE laravel_octane_active_ticks_count gauge\nlaravel_octane_active_ticks_count{remote_addr=\"\",addr=\"\",name=\"\"} 0\n# HELP laravel_octane_active_workers_count Get the number of active workers for Octane.\n# TYPE laravel_octane_active_workers_count gauge\nlaravel_octane_active_workers_count{remote_addr=\"\",addr=\"\",name=\"\"} 8\n# HELP laravel_octane_requests_count Get the number of requests, by status, that passed through Octane.\n# TYPE laravel_octane_requests_count gauge\nlaravel_octane_requests_count{remote_addr=\"\",addr=\"\",name=\"\",status=\"2xx_count\"} 7\nlaravel_octane_requests_count{remote_addr=\"\",addr=\"\",name=\"\",status=\"3xx_count\"} 0\nlaravel_octane_requests_count{remote_addr=\"\",addr=\"\",name=\"\",status=\"4xx_count\"} 0\nlaravel_octane_requests_count{remote_addr=\"\",addr=\"\",name=\"\",status=\"5xx_count\"} 0\nlaravel_octane_requests_count{remote_addr=\"\",addr=\"\",name=\"\",status=\"total_count\"} 7\n# HELP laravel_octane_status Check if the octane service is running. 1 = active, 0 = inactive\n# TYPE laravel_octane_status gauge\nlaravel_octane_status{remote_addr=\"\",addr=\"\",name=\"\"} 1\n# HELP laravel_octane_total_tasks_count Get the number of total tasks that passed through Octane.\n# TYPE laravel_octane_total_tasks_count gauge\nlaravel_octane_total_tasks_count{remote_addr=\"\",addr=\"\",name=\"\"} 0\n# HELP laravel_octane_total_ticks_count Get the number of total ticks that got through Octane. This is the equivalent of seconds passed since this server is alive.\n# TYPE laravel_octane_total_ticks_count gauge\nlaravel_octane_total_ticks_count{remote_addr=\"\",addr=\"\",name=\"\"} 1242\n# HELP php_info Information about the PHP environment.\n# TYPE php_info gauge\nphp_info{version=\"8.0.11\"} 1\n```\n\n## 🐛 Testing\n\n``` bash\nvendor/bin/phpunit\n```\n\n## 🤝 Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## 🔒  Security\n\nIf you discover any security related issues, please email alex@renoki.org instead of using the issue tracker.\n\n## 🎉 Credits\n\n- [Alex Renoki](https://github.com/rennokki)\n- [All Contributors](../../contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenoki-co%2Foctane-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenoki-co%2Foctane-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenoki-co%2Foctane-exporter/lists"}