Jtomsa-node-exporter - Classic confinement request


#1

Hi,
I’d like to request an approval for the classic confinement of jtomsa-node-exporter snap.
https://dashboard.snapcraft.io/snaps/jtomsa-node-exporter/revisions/3/

The reason behind the classic confinement is that the Prometheus node exporter (https://github.com/prometheus/node_exporter/tree/v0.17.0#collectors) requires access to many parts of the system in order to export relevant information. The number of metrics it can provide without the classic confinement is greatly reduced.

Thanks!


#2

Hello,
may I please ask for either approval or rejection of the classic confinement for this snap?

Thanks a lot!
Jan.

The snapcraft.yaml for this snap is as follows

name: jtomsa-node-exporter
version: '0.17.0'
summary: Prometheus Node Exporter
description: |
  The Node Exporter is a monitoring agent for Prometheus.
  It exposes a wide variety of hardware- and kernel-related metrics.
  The classic confinement ensures it will be able to export all the metrics it can

grade: stable # must be 'stable' to release into candidate/stable channels
confinement: classic

apps:
  node-exporter:
    command: 'bin/node-exporter.wrapper'
    daemon: simple
    stop-timeout: 900s

parts:
  node-exporter:
    plugin: dump
    source: https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
    source-type: tar
    source-checksum: sha256/d2e00d805dbfdc67e7291ce2d2ff151f758dd7401dd993411ff3818d0e231489
    organize:
      node_exporter: bin/node_exporter
    stage:
      - bin/node_exporter
    prime:
      - bin/node_exporter
  snap-wrappers:
    plugin: dump
    source: .
    organize:
      node-exporter.wrapper: bin/node-exporter.wrapper
      daemon_arguments: etc/node-exporter/daemon_arguments.example
    stage:
      - bin/node-exporter.wrapper
      - etc/node-exporter/daemon_arguments.example
    prime:
      - bin/node-exporter.wrapper
      - etc/node-exporter/daemon_arguments.example

The wrapper:

#!/bin/bash

test -e ${SNAP_DATA}/daemon_arguments || cp ${SNAP}/etc/node-exporter/daemon_arguments.example ${SNAP_DATA}/daemon_arguments

source ${SNAP_DATA}/daemon_arguments
${SNAP}/bin/node_exporter ${ARGS}

daemon_arguments

# Set the command-line arguments to pass to the daemon.
ARGS=""

#3

Which accesses specifically? There are quite a few different interfaces that might help here.