All Projects → renoki-co → octane-exporter

renoki-co / octane-exporter

Licence: Apache-2.0 License
Export Laravel Octane metrics using this Prometheus exporter.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to octane-exporter

Prometheus Book
Prometheus操作指南
Stars: ✭ 2,637 (+18735.71%)
Mutual labels:  metrics, grafana, prometheus
Iota Prom Exporter
Iota Exporter for Prometheus Metrics
Stars: ✭ 33 (+135.71%)
Mutual labels:  metrics, grafana, prometheus
Grafterm
Metrics dashboards on terminal (a grafana inspired terminal version)
Stars: ✭ 613 (+4278.57%)
Mutual labels:  metrics, grafana, prometheus
Docker Traefik Prometheus
A Docker Swarm Stack for monitoring Traefik with Promethues and Grafana
Stars: ✭ 215 (+1435.71%)
Mutual labels:  metrics, grafana, prometheus
Grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Stars: ✭ 45,930 (+327971.43%)
Mutual labels:  metrics, grafana, prometheus
Docker monitoring logging alerting
Docker host and container monitoring, logging and alerting out of the box using cAdvisor, Prometheus, Grafana for monitoring, Elasticsearch, Kibana and Logstash for logging and elastalert and Alertmanager for alerting.
Stars: ✭ 479 (+3321.43%)
Mutual labels:  metrics, grafana, prometheus
Unifiedmetrics
Fully-featured metrics collection agent for Minecraft servers. Supports Prometheus and InfluxDB. Dashboard included out-of-box.
Stars: ✭ 29 (+107.14%)
Mutual labels:  metrics, grafana, prometheus
Prometheus
Kubernetes Setup for Prometheus and Grafana
Stars: ✭ 824 (+5785.71%)
Mutual labels:  metrics, grafana, prometheus
Pingprom
Prometheus uptime monitoring quickstart
Stars: ✭ 107 (+664.29%)
Mutual labels:  metrics, grafana, prometheus
Citrix Adc Metrics Exporter
Export metrics from Citrix ADC (NetScaler) to Prometheus
Stars: ✭ 67 (+378.57%)
Mutual labels:  metrics, grafana, prometheus
Hastic Server
Hastic data management server for analyzing patterns and anomalies from Grafana
Stars: ✭ 292 (+1985.71%)
Mutual labels:  metrics, grafana, prometheus
Appmetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Stars: ✭ 1,986 (+14085.71%)
Mutual labels:  metrics, grafana, prometheus
chia-monitor
🍃 A comprehensive monitoring and alerting solution for the status of your Chia farmer and harvesters.
Stars: ✭ 131 (+835.71%)
Mutual labels:  metrics, grafana, prometheus
Swagger Stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
Stars: ✭ 559 (+3892.86%)
Mutual labels:  metrics, grafana, prometheus
flask prometheus metrics
Prometheus Metrics for Flask Web App
Stars: ✭ 17 (+21.43%)
Mutual labels:  metrics, grafana, prometheus
Promcord
📊 Analyze your entire discord guild in grafana using prometheus. Message, User, Game and Voice statistics...
Stars: ✭ 39 (+178.57%)
Mutual labels:  metrics, grafana, prometheus
Heplify Server
HEP Capture Server
Stars: ✭ 110 (+685.71%)
Mutual labels:  metrics, grafana, prometheus
Github Monitoring
Monitor your GitHub Repos with Docker & Prometheus
Stars: ✭ 163 (+1064.29%)
Mutual labels:  metrics, grafana, prometheus
Aliyun Exporter
Prometheus exporter for Alibaba Cloud Monitor
Stars: ✭ 210 (+1400%)
Mutual labels:  metrics, grafana
Ssl exporter
Exports Prometheus metrics for SSL certificates
Stars: ✭ 211 (+1407.14%)
Mutual labels:  metrics, prometheus

Laravel Octane Prometheus Exporter

CI codecov StyleCI Latest Stable Version Total Downloads Monthly Downloads License

Export Laravel Octane metrics using this Prometheus exporter.

🤝 Supporting

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. 📦

🚀 Installation

You can install the package via composer:

composer require renoki-co/octane-exporter

In case you haven't published your Octane settings, do so:

php artisan octane:install

Next up, add the following Octane tables in your config/octane.php. These tables will be used to keep track of stats for the events:

return [

    'tables' => [
        'octane_exporter_requests:1' => [
            'total_count' => 'int',
            '2xx_count' => 'int',
            '3xx_count' => 'int',
            '4xx_count' => 'int',
            '5xx_count' => 'int',
        ],
        'octane_exporter_tasks:1' => [
            'total_count' => 'int',
            'active_count' => 'int',
        ],
        'octane_exporter_workers:1' => [
            'active_count' => 'int',
        ],
        'octane_exporter_ticks:1' => [
            'total_count' => 'int',
            'active_count' => 'int',
        ],

        // ...
    ],

];

The final step is to add the following listeners after the already existent ones in config/octane.php:

return [

    'listeners' => [
        WorkerStarting::class => [
            // ...
            \RenokiCo\OctaneExporter\Listeners\TrackStartedWorkers::class,
        ],

        RequestTerminated::class => [
            // ...
            \RenokiCo\OctaneExporter\Listeners\TrackTerminatedRequests::class,
        ],

        TaskReceived::class => [
            // ...
            \RenokiCo\OctaneExporter\Listeners\TrackReceivedTasks::class,
        ],

        TaskTerminated::class => [
            // ...
            \RenokiCo\OctaneExporter\Listeners\TrackTerminatedTasks::class,
        ],

        TickReceived::class => [
            // ...
            \RenokiCo\OctaneExporter\Listeners\TrackReceivedTicks::class,
        ],

        TickTerminated::class => [
            // ...
            \RenokiCo\OctaneExporter\Listeners\TrackTerminatedTicks::class,
        ],

        WorkerStopping::class => [
            // ...
            \RenokiCo\OctaneExporter\Listeners\TrackStoppedWorkers::class,
        ],
    ],

];

🙌 Usage

This 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.

scrape_configs:
  - job_name: 'octane'
    metrics_path: '/exporter/group/octane-metrics'
    scrape_interval: 5
    static_configs:
      - targets: ['localhost:8000']
        labels:
          app: 'my-octane-app'

Please keep in mind that the metrics are calculated by-process. Point your Prometheus scraper to all instances that run the Octane start command.

# HELP laravel_octane_active_tasks_count Get the number of active tasks that pass through Octane.
# TYPE laravel_octane_active_tasks_count gauge
laravel_octane_active_tasks_count{remote_addr="",addr="",name=""} 0
# HELP laravel_octane_active_ticks_count Get the number of active ticks that run currently in Octane.
# TYPE laravel_octane_active_ticks_count gauge
laravel_octane_active_ticks_count{remote_addr="",addr="",name=""} 0
# HELP laravel_octane_active_workers_count Get the number of active workers for Octane.
# TYPE laravel_octane_active_workers_count gauge
laravel_octane_active_workers_count{remote_addr="",addr="",name=""} 8
# HELP laravel_octane_requests_count Get the number of requests, by status, that passed through Octane.
# TYPE laravel_octane_requests_count gauge
laravel_octane_requests_count{remote_addr="",addr="",name="",status="2xx_count"} 7
laravel_octane_requests_count{remote_addr="",addr="",name="",status="3xx_count"} 0
laravel_octane_requests_count{remote_addr="",addr="",name="",status="4xx_count"} 0
laravel_octane_requests_count{remote_addr="",addr="",name="",status="5xx_count"} 0
laravel_octane_requests_count{remote_addr="",addr="",name="",status="total_count"} 7
# HELP laravel_octane_status Check if the octane service is running. 1 = active, 0 = inactive
# TYPE laravel_octane_status gauge
laravel_octane_status{remote_addr="",addr="",name=""} 1
# HELP laravel_octane_total_tasks_count Get the number of total tasks that passed through Octane.
# TYPE laravel_octane_total_tasks_count gauge
laravel_octane_total_tasks_count{remote_addr="",addr="",name=""} 0
# 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.
# TYPE laravel_octane_total_ticks_count gauge
laravel_octane_total_ticks_count{remote_addr="",addr="",name=""} 1242
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.0.11"} 1

🐛 Testing

vendor/bin/phpunit

🤝 Contributing

Please see CONTRIBUTING for details.

🔒 Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

🎉 Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].