canonical / grafana-agent-snap

Snap of Grafana Agent, a telemetry collector for sending metrics, logs and traces to the Grafana's LGTM stack.
https://snapcraft.io/grafana-agent
Apache License 2.0
1 stars 5 forks source link

Additional interface needed for systemd prometheus.exporter.unix #50

Closed Guillaumebeuzeboc closed 1 month ago

Guillaumebeuzeboc commented 7 months ago

Enabling systemd in the prometheus.exporter.unix generates the following AppArmor output:

= AppArmor = Time: Jan 3 11:17:46 Log: apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/systemd1" interface="org.freedesktop.DBus.Properties" member="Get" mask="send" name="org.freedesktop.systemd1" pid=28996 label="snap.grafana-agent.grafana-agent" peer_pid=1 peer_label="unconfined" DBus access
= AppArmor = Time: Jan 3 11:17:46 Log: apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/systemd1" interface="org.freedesktop.systemd1.Manager" member="ListUnits" mask="send" name="org.freedesktop.systemd1" pid=28996 label="snap.grafana-agent.grafana-agent" peer_pid=1 peer_label="unconfined" DBus access

For the exporter to work, an additional interface is necessary in order to call ListUnits on /org/freedesktop/systemd1 via Dbus.

I tried to add the following interfaces without success:

A search in the snapd code seems to show that no interface satifies the need.

This might require the creation of a new snapd interface.

Guillaumebeuzeboc commented 1 month ago

The ListUnits on /org/freedesktop/systemd1 is now part of snapd 2.63 system-observe: https://github.com/canonical/snapd/commit/597501deccdc3c5f22632db9c88cb5ae3bf609ba