Coder Social home page Coder Social logo

laravel-prometheus-exporter's People

Contributors

alsma avatar bradwhittington avatar janwehner avatar johnmarkmassey avatar lucacri avatar matthewgoslett avatar nicja avatar nope7777 avatar shad0wfir3 avatar stefanbauer avatar zoidyzoidzoid 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-prometheus-exporter's Issues

Project unmaintained?

Hi,

This project seems unmaintained. There are a few PRs that would be great to review and merge, like Laravel 8 support.

Can we help maintaining in any way?

Thanks,

Securing the metrics endpoint

This is both a question—how do other users of this package secure the endpoint?—and a suggestion: Maybe it would be a good idea to add a section on security to the readme. I'm well aware someone integrating Prometheus into their ecosystem probably knows what they do, but opening up metrics accidentally may still be a huge threat vector.
Therefore I'd like to collect strategies to secure the endpoint, and maybe come up with a secure default to recommend in the readme.

We currently use a middleware that checks the source IP against an allowlist of Prometheus instances (simplified):

public function handle($request, Closure $next)
{
    if (in_array($request->ip(), config('services.prometheus.allowed_ips'), true) {
        return abort(404);
    }

    return $next($request);
}

Segmentation fault (core dumped)

After installing this package one of my projects, if I run the test it throws the below error:

  Symfony\Component\Process\Exception\ProcessSignaledException 

  The process has been signaled with signal "11".

  at vendor/symfony/process/Process.php:424
    420▕             usleep(1000);
    421▕         }
    422▕ 
    423▕         if ($this->processInformation['signaled'] && $this->processInformation['termsig'] !== $this->latestSignal) {
  ➜ 424▕             throw new ProcessSignaledException($this);
    425▕         }
    426▕ 
    427▕         return $this->exitcode;
    428▕     }

  1   vendor/symfony/process/Process.php:234
      Symfony\Component\Process\Process::wait()

  2   vendor/nunomaduro/collision/src/Adapters/Laravel/Commands/TestCommand.php:95
      Symfony\Component\Process\Process::run(Object(Closure))

  3   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36
      NunoMaduro\Collision\Adapters\Laravel\Commands\TestCommand::handle()

  4   vendor/laravel/framework/src/Illuminate/Container/Util.php:40
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

  5   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93
      Illuminate\Container\Util::unwrapIfClosure(Object(Closure))

  6   vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37
      Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Object(Closure))

  7   vendor/laravel/framework/src/Illuminate/Container/Container.php:610
      Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), [])

  8   vendor/laravel/framework/src/Illuminate/Console/Command.php:136
      Illuminate\Container\Container::call()

  9   vendor/symfony/console/Command/Command.php:258
      Illuminate\Console\Command::execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  10  vendor/laravel/framework/src/Illuminate/Console/Command.php:121
      Symfony\Component\Console\Command\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

  11  vendor/symfony/console/Application.php:920
      Illuminate\Console\Command::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  12  vendor/symfony/console/Application.php:266
      Symfony\Component\Console\Application::doRunCommand(Object(NunoMaduro\Collision\Adapters\Laravel\Commands\TestCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  13  vendor/symfony/console/Application.php:142
      Symfony\Component\Console\Application::doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  14  vendor/laravel/framework/src/Illuminate/Console/Application.php:93
      Symfony\Component\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  15  vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:129
      Illuminate\Console\Application::run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  16  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

  • OS: Linux Mint Linux Mint 20.1
  • Laravel Framework 8.16.1
  • PHP 7.3.27-9+ubuntu18.04.1+deb.sury.org+1
  • PHPUnit 9.4.3
  • Docker version 20.10.5

Hardware configuration

  • RAM: 12GB
  • Processor: i3 (4 @@@CoreJ)
  • Storage: 120GB and 500GB SSD

I tried to change the adapter as well, getting the same error for memory and redis adapter

If I try to run the single test it works, but if I try to run the whole test suit it stuck with the above error [Segmentfault (core dump)]

  • php artisan test --filter authorize_user_can_add_book -> 200
  • php artisan test -> Segmentfault (core dump)

Prometheus DB Connection with Laravel

Hi!
Hope you are fine. I wanted to integrate prometheus with laravel. I have followed your guide but I am unable to understand how to configure the DB Parameters of Prometheus in Laravel and secondly how to test that if laravel and prometheus are linked successfully. Any help in this regard would be appreciated.
Thanks.

Allow multiple middleware

Support for multiple middleware would be great under some scenarios, e.g.:

PROMETHEUS_METRICS_ROUTE_MIDDLEWARE=admin,authorized_ips

When change registerGauge 3rd parameter array size, it breaks

Error: array_combine(): Both parameters should have an equal number of elements

PROMETHEUS_NAMESPACE=namespace
PROMETHEUS_METRICS_ROUTE_ENABLED=true
PROMETHEUS_METRICS_ROUTE_PATH=metrics
PROMETHEUS_METRICS_ROUTE_MIDDLEWARE=null
PROMETHEUS_STORAGE_ADAPTER=redis
PROMETHEUS_REDIS_PREFIX=PROMETHEUS_

Redis Connect method error

When using this library I get error:

{
  "message": "Call to undefined method Illuminate\\Support\\Facades\\Redis::connect()",
  "context": {
    "exception": {
      "class": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
      "message": "Call to undefined method Illuminate\\Support\\Facades\\Redis::connect()",
      "code": 0,
      "file": "/var/www/html/vendor/jimdo/prometheus_client_php/src/Prometheus/Storage/Redis.php:95"
    }
  }
}

Predis is installed and defined as the client in database.php
But I have tried from tinker, Illuminate\Support\Facades\Redis::connect() is working.
Also I have checked my docker image, it does not install php-redis or php5-redis.

What could be the probable reason?

Add support for laravel v6.0

Hi, are you willing to widen the supported version of laravel to allow the new major release 6.0?

The dependency in composer.json could be changed to ^5.3 || ^6.0

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.