mkuf / prind

print in docker - Deploy a containerized Klipper Stack for your 3D Printer
GNU General Public License v3.0
324 stars 82 forks source link

[Feature] Add support for monitoring the containers #109

Closed zackbcom closed 7 months ago

zackbcom commented 7 months ago

Add support for monitoring performance on device

I have added support for monitoring the docker stack and host. I am using glances docker container.

Doesn't have support for monitoring the pi gpu yet.

Need to have the last slash to get the page to load. I havn't looked at what the fix is yet. ex: http://192.168.2.109/glances/

  monitoring:
    image: nicolargo/glances:latest-full 
    restart: always
    pid: host
    ports:
      - 61208:61208
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - "GLANCES_OPT=-w"
    labels:
      traefik.enable: true
      traefik.http.services.glances.loadbalancer.server.port: 61208
      traefik.http.routers.glances.rule: PathPrefix(`/glances`)
      traefik.http.routers.glances.entrypoints: web
      traefik.http.middlewares.glances.stripprefix.prefixes: /glances
      traefik.http.routers.glances.middlewares: glances

Screenshots

mkuf commented 7 months ago

Hi there, thanks for reaching out.

While this may be useful for some, monitoring and metrics are very specific to the users needs, so they are out of scope for this project.
That said, I really like the minimal approach glances takes to display metrics, so I created a custom file in https://github.com/mkuf/prind/commit/f88e65f91eb06fb68a9d5b9bb8d0860ceb4750f7, that may be used to add this service to the stack. This also adds an additional middleware in traefik which takes care of the trailing slash.

-Markus