packagemirage-monitoring
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=0e574eb8ff65c3dddc38d0ec8c89e1be73d2e2bb62869a62da0a559578ec7537
sha512=7b3b065ec04981b6c9ece925ab43ea9a95baabb6174492eb11a67c7678ee1a9ec90662001ae157bc2565230b0df1a45dda2e61883267392883c521805e5a5492
Description
Reporting metrics to Influx, Telegraf. Dynamic adjusting log level and metricssources, memprof profiling.
Published:27 Feb 2025
README
Grafana MirageOS Unikernel monitoring
Using Influx, Telegraf, etc.
Best used on a private network interface for your unikernel.
Output metrics to influx / telegraf
The providedip:port
increate
is used to send everyinterval
seconds gathered metrics to, using the Influx wire protocol.
Dynamic adjustments of Log level and Metrics reporting
Thecreate
function has alistener_port argument (defaulting to 2323). On the customizable port TCP connections to the unikernel are possible. Each connection can transmit a command (as text) to adjust log level and enable or disable metrics sources:
The log level (prefixL
) is specified, the same as the command-line argument-l
:
L*:debug
all log sources are enabled on thedebug level.Lmonitoring-experiments:error
the log source monitoring-experiments is set to theerror level.L*:info,monitoring-experiments:debug
all log sources are enabled on theinfo level, and the log source monitoring-experiments is set to thedebug level.
The metrics (prefixM
) sources can be enabled and disabled based on source name. First, if present, the all command is executed, then the tags, then specific sources:
M*:disable,memory:enable,net-solo5:enable
disables all metrics sources, and then enablesmemory andnet-solo5.Mnet-solo5:disable
disables thenet-solo5 metrics source.Mtag:http:enable
enables all metrics with thehttp tag.
The log levels for the log sources can be inspected:
l
reports the default log level and the log level for all log sources with a different log level.l*
reports the default log level and the log level for all log sources.lmonitoring-experiments,dns
reports the log level for monitoring-experiments and dns respectively.
Likewise, metrics status can be similarly inspected:
m
reports the default metrics status and the metrics status for all metrics sources with a different status.m*
reports the default metrics status, all enabled tags, and the metrics status of all metrics sources.mmemory,net-solo5
reports the metrics status for memory and net-solo5 respectively.
Memprof tracing
Thecreate
function has amemtrace_port
argument (defualts to 4242). On this port, when a TCP client connects,OCaml memory profiling is started and dumped to the client. Thesampling_rate
(defaults to 1e-4) is used. This uses thememprof-mirage package.
The output trace is best being viewed withmemtrace_viewer.
Dependencies (10)
- memtrace-mirage
>= "0.2.1.2.3"
- mirage-runtime
>= "4.5.0"
- tcpip
>= "7.0.0"
- mirage-sleep
>= "4.0.0"
- metrics-influx
>= "0.2.0"
- metrics-lwt
>= "0.2.0"
- metrics
>= "0.4.0"
- logs
>= "0.6.3"
- dune
- ocaml
>= "4.11.0"
Dev Dependencies
None
Used by
None
Conflicts (2)
- mirage-xen
< "8.0.2"
- mirage-solo5
< "0.9.2"