nixos/prometheus-exporters/ebpf: init

Changed files
+68
nixos
doc
manual
release-notes
modules
services
monitoring
prometheus
tests
+4
nixos/doc/manual/release-notes/rl-2505.section.md
···
- [CookCLI](https://cooklang.org/cli/) Server, a web UI for cooklang recipes.
+
- [Prometheus eBPF Exporter](https://github.com/cloudflare/ebpf_exporter),
+
Prometheus exporter for custom eBPF metrics. Available as
+
[services.prometheus.exporters.ebpf](#opt-services.prometheus.exporters.ebpf.enable).
+
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
## Backward Incompatibilities {#sec-release-25.05-incompatibilities}
+1
nixos/modules/services/monitoring/prometheus/exporters.nix
···
"dnssec"
"domain"
"dovecot"
+
"ebpf"
"fastly"
"flow"
"fritz"
+49
nixos/modules/services/monitoring/prometheus/exporters/ebpf.nix
···
+
{
+
config,
+
lib,
+
pkgs,
+
options,
+
...
+
}:
+
+
let
+
cfg = config.services.prometheus.exporters.ebpf;
+
inherit (lib)
+
mkOption
+
types
+
concatStringsSep
+
;
+
in
+
{
+
port = 9435;
+
extraOpts = {
+
names = mkOption {
+
type = types.listOf types.str;
+
default = [ ];
+
example = [ "timers" ];
+
description = ''
+
List of eBPF programs to load
+
'';
+
};
+
};
+
serviceOpts = {
+
serviceConfig = {
+
AmbientCapabilities = [
+
"CAP_BPF"
+
"CAP_DAC_READ_SEARCH"
+
"CAP_PERFMON"
+
];
+
CapabilityBoundingSet = [
+
"CAP_BPF"
+
"CAP_DAC_READ_SEARCH"
+
"CAP_PERFMON"
+
];
+
ExecStart = ''
+
${pkgs.prometheus-ebpf-exporter}/bin/ebpf_exporter \
+
--config.dir=${pkgs.prometheus-ebpf-exporter}/examples \
+
--config.names=${concatStringsSep "," cfg.names} \
+
--web.listen-address ${cfg.listenAddress}:${toString cfg.port}
+
'';
+
};
+
};
+
}
+14
nixos/tests/prometheus-exporters.nix
···
'';
};
+
ebpf = {
+
exporterConfig = {
+
enable = true;
+
names = [ "timers" ];
+
};
+
exporterTest = ''
+
wait_for_unit("prometheus-ebpf-exporter.service")
+
wait_for_open_port(9435)
+
succeed(
+
"curl -sSf http://localhost:9435/metrics | grep 'ebpf_exporter_enabled_configs{name=\"timers\"} 1'"
+
)
+
'';
+
};
+
fastly = {
exporterConfig = {
enable = true;