Git Product home page Git Product logo

prometheus_push_gateway_php's Introduction

A prometheus push gateway client library written in PHP

Tests

This package provides an easy PHP API for Prometheus Push Gateway. It was part of promphp/prometheus_client_php and was moved into a seperate package as of Prometheus Client PHP Version 2.0.0.

How does it work?

The PushGateway allows Prometheus to get Metrics from Systems that are not scrableable (Your Prometheus cannot access that systems). With this library you can easily send your metrics to the PushGateway.

Installation

Add as Composer dependency:

composer require promphp/prometheus_push_gateway_php

Usage

Let's assume you have that simple counter and want to send it to your PushGateway.

\Prometheus\CollectorRegistry::getDefault()
    ->getOrRegisterCounter('', 'some_quick_counter', 'just a quick measurement')
    ->inc();

// Now send it to the PushGateway:
$pushGateway = new \PrometheusPushGateway\PushGateway('http://192.168.59.100:9091');
$pushGateway->push(\Prometheus\CollectorRegistry::getDefault(), 'my_job', ['instance' => 'foo']);

Also look at the examples.

Development

Dependencies

Black box testing

Just start the PushGateway by using docker-compose

docker-compose up

Use composer to grab all dependencies

docker run --rm --interactive --tty --volume $PWD:/app composer install

Execute the tests:

docker-compose run phpunit vendor/bin/phpunit tests/Test/

prometheus_push_gateway_php's People

Contributors

claude-vessaz-hs avatar dependabot-preview[bot] avatar lkaemmerling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

prometheus_push_gateway_php's Issues

how to config url prefix?

Our pushgateway endpoint is something like a.b.c.d:1234/foo/bar/metrics/job/<xxx>
So how to add the /foo/bar prefix ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.