easybill / serverdensity_udp_metric_client
Client for UDP-Agent https://github.com/easybill/serverdensity-udp-agent
Package info
github.com/easybill/serverdensity-udp-agent
Language:Rust
pkg:composer/easybill/serverdensity_udp_metric_client
Requires
- php: >=7.0
- dev-master
- 0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- 0.2
- 0.1
- dev-dependabot/github_actions/actions/download-artifact-8
- dev-dependabot/github_actions/actions/checkout-6
- dev-dependabot/github_actions/clechasseur/rs-clippy-check-5
- dev-dependabot/cargo/bytes-1.11.1
- dev-dependabot/cargo/tokio-1.50.0
- dev-dependabot/cargo/md5-0.8.0
- dev-dependabot/cargo/clap-4.5.60
- dev-dependabot/cargo/prometheus-client-0.24.0
- dev-PLAT-325-add-dependabot
- dev-dependabot/cargo/quinn-proto-0.11.8
- dev-tg/gauge
- dev-make-server-density-optional
This package is auto-updated.
Last update: 2026-03-27 00:48:57 UTC
README
Installing
This project is build on each release for Linux & Mac x86, aarch64. You can download these pre-build binaries from the releases tab.
Other Platforms
For other platforms you need to compile this lib yourself:
- Install Rust and Cargo
- Clone this repository
- Run
cargo b --release --bin=openmetrics_udpserver - The executable is located in
target/release/openmetrics_udpserver
Sending Metrics
The UDP-Server will collect sent metrics and make them available through a http endpoint using the openmetrics-text encoding. Sent values for the metric types Min, Average & Peak are just single values (if a value is received twice before collection, the old value gets overridden). The Sum metric type will sum up all received values until a collection happens - then the counter is reset to 0.
From performance perspective you could send thousands of messages per second.
PHP
We provide a small php client
composer require easybill/serverdensity_udp_metric_client
<?php $client = new ServerdensityUDPAgent(); $client->sendSum('[METRIC_GROUP].[METRIC]', 1);
Data Format
The data format that must be used to send data to the server must be as follows:
- u16: representation of the metric type (see table below)
- i32: the data count
- the utf-8 encoded name of the metric
All numbers must be encoded using big endian byte order.
Metric Types:
| Type | ID |
|---|---|
| Sum | 42 |
| Average | 43 |
| Peak | 44 |
| Min | 45 |
Installing + Supervisor
# replace the download link for the required platform
wget https://github.com/easybill/openmetrics-udp-agent/releases/latest/download/openmetrics_udpserver_linux_x86_64
chmod +x sopenmetrics_udpserver
mv openmetrics_udpserver /usr/local/bin/
now you can test if the server starts:
./openmetrics_udpserver
open /etc/supervisor/conf.d/openmetrics_udpserver.conf and add:
[program:openmetrics_udpserver]
command=openmetrics_udpserver
user=sd-agent
process_name=%(program_name)s
numprocs=1
directory=/tmp
autostart=true
autorestart=true
startsecs=0
startretries=10
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s_error.log
stopsignal=QUIT
Check the update of the new process
supervisorctl status openmetrics_udpserver
Updating the udp server
wget https://github.com/easybill/openmetrics-udp-agent/releases/latest/download/openmetrics_udpserver_linux_x86_64 chmod +x openmetrics_udpserver supervisorctl stop openmetrics_udpserver rm /usr/local/bin/openmetrics_udpserver mv openmetrics_udpserver /usr/local/bin/ supervisorctl start openmetrics_udpserver supervisorctl status openmetrics_udpserver