package mirage-monitoring

  1. Overview
  2. Docs
Monitoring of MirageOS unikernels

Install

Dune Dependency

Authors

Maintainers

Sources

mirage-monitoring-0.0.3.tbz
sha256=89b588f8100dcb8791a898454eaf80bdbb1732bbf4050d7434f90ba242fabe20
sha512=821b6bf9f8c3c530e3e3f730cca813caefe53614145ec6b4c99099159ccc08d5633517d17a02c12a18d5bd427c09e9d483e9ff28d6494228ed9df40f6b8e5fd4

Description

Reporting metrics to Influx, Telegraf. Dynamic adjusting log level and metrics sources, memprof profiling.

Published: 26 Sep 2022

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 provided ip:port in create is used to send every interval seconds gathered metrics to, using the Influx wire protocol.

Dynamic adjustments of Log level and Metrics reporting

The create function has a listener_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 (prefix L) is specified, the same as the command-line argument -l:

  • L*:debug all log sources are enabled on the debug level.

  • Lmonitoring-experiments:error the log source monitoring-experiments is set to the error level.

  • L*:info,monitoring-experiments:debug all log sources are enabled on the info level, and the log source monitoring-experiments is set to the debug level.

The metrics (prefix M) 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 enables memory and net-solo5.

  • Mnet-solo5:disable disables the net-solo5 metrics source.

  • Mtag:http:enable enables all metrics with the http 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

The create function has a memtrace_port argument (defualts to 4242). On this port, when a TCP client connects, OCaml memory profiling is started and dumped to the client. The sampling_rate (defaults to 1e-4) is used. This uses the memprof-mirage package.

The output trace is best being viewed with memtrace_viewer.

Dependencies (12)

  1. mirage-clock >= "4.0.0"
  2. memtrace-mirage >= "0.2.1.2.2"
  3. mirage-runtime >= "4.3.0" & < "4.5.0"
  4. mirage-solo5 >= "0.9.0"
  5. tcpip >= "7.0.0"
  6. mirage-time >= "2.0.0"
  7. metrics-influx >= "0.2.0"
  8. metrics-lwt >= "0.2.0"
  9. metrics >= "0.4.0"
  10. logs >= "0.6.3"
  11. dune
  12. ocaml >= "4.11.0"

Dev Dependencies

None

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.