metrixio/packagist

This tool lets you easily gather data about downloads from Packagist. It works with Prometheus and Grafana to collect data.

1.0.0 2022-12-26 21:51 UTC

This package is auto-updated.

Last update: 2024-04-27 01:08:27 UTC


README

68747470733a2f2f706f7365722e707567782e6f72672f6d6574726978696f2f7061636b61676973742f726571756972652f706870 68747470733a2f2f706f7365722e707567782e6f72672f6d6574726978696f2f7061636b61676973742f76657273696f6e badge.svg 68747470733a2f2f706f7365722e707567782e6f72672f6d6574726978696f2f7061636b61676973742f646f776e6c6f616473

packagist

This tool lets you easily gather data about downloads from Packagist.

It works with Prometheus and Grafana to collect data from Packagist, store it in Prometheus, and create visualizations with Grafana. You can use Grafana to customize the data you collect and create dashboards that fit your needs.

We hope you find it helpful!

Dashboard

image

Usage

Check out the documentation in the dashboard repository. That should give you all the details you need to get going.

# Packagist repository names to follow (comma separated)
PACKAGIST_REPOSITORIES=...

Docker

version: "3.7"

services:
    docker-metrics:
        image: ghcr.io/metrixio/packagist:latest
        environment:
            PACKAGIST_REPOSITORIES: ...
        restart: on-failure

    prometheus:
        image: prom/prometheus
        volumes:
            - ./runtime/prometheus:/prometheus
        restart: always

    grafana:
        image: grafana/grafana
        depends_on:
            - prometheus
        ports:
            - 3000:3000
        volumes:
            - ./runtime/grafana:/var/lib/grafana
        restart: always

Local server

composer create-project metrixio/packagist

Define the repositories you want to track in .env file

PACKAGIST_REPOSITORIES=spiral/framework,...

Once the project is installed and configured you can start application server:

./rr serve

Metrics will be available on http://127.0.0.1:2112.

Note: To fix unable to open metrics page, change metrics address in RoadRunner config file to 127.0.0.1:2112.

The package is built with some of the best tools out there for PHP. It's powered by Spiral Framework, which makes it super fast and efficient, and it uses RoadRunner as the server, which is a really great tool for collecting metrics data for Prometheus.