prometheus_client_php | Prometheus instrumentation library for PHP applications | Analytics library
kandi X-RAY | prometheus_client_php Summary
kandi X-RAY | prometheus_client_php Summary
Prometheus instrumentation library for PHP applications
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of prometheus_client_php
prometheus_client_php Key Features
prometheus_client_php Examples and Code Snippets
Community Discussions
Trending Discussions on prometheus_client_php
QUESTION
Description
Being new to the grafana and prometheus world, I am struggeling to add custom metrics from my laravel php cli application to grafana cloud - preferably via grafana agent.
Situation
I am using grafana cloud with their grafana agent on a linux server that is running a laravel php worker without a web server. The grafana agent is running with node_exporter integration. I have already tried to find some documentation on how to add a custom exporter or adding a scraper to gather information. What I have currently found is that the agent will be somehow (?) querying an HTTP endpoint and parse the response (which format?) to post it to the grafa cloud endpoint (prometheus push gateway as far as I understood).
I did not find a documentation on how to write a custom exporter for the grafana agent, since I am running a php worker thread without an http endpoint on that server. Exposing those information on an endpoint is doable but feels wrong, isn't it? Basically I'd like to do a 'php artisan mypackage:metrics' and let that call generate the correct output which then is used by the agent to post to grafana.
Questions
- How can I write my custom exporter that is queried by the grafana agent?
- What is the correct data format?
- If grafana agent exporter is not the right direction, how can scraping work?
What I've tried
- regarding the data structure / format
According to [1], I tried to create my custom metrics like the following - correct?
...ANSWER
Answered 2021-Dec-27 at 11:49Grafana Agent works with the same metric format Prometheus does. It is focused on scraping metrics instead of Prometheus and pushing them (remote_write
) to the Prometheus instance that Grafana Cloud hosts for you. This is mentioned in the list of product features.
You can use Prometheus PHP library to create metrics and avoid troubles with the raw format. The best practices are also applicable.
Once you are done with creating metrics, you need to instruct the agent to scrape them from your server. Use these docs (one, two) for reference.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install prometheus_client_php
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page