immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
47.33k stars 2.4k forks source link

Metrics generation error for microservice #9759

Closed zigarn closed 3 months ago

zigarn commented 4 months ago

The bug

When calling the metrics endpoint on microservices, instead of metrics we get

# failed to export metrics: Error: MetricReader is not bound to a MetricProducer

The OS that Immich Server is running on

Ubuntu 24.04

Version of Immich Server

v1.105.1

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

# Immich provided one + this compose.override.yml

services:
  immich-server:
    volumes:
      - ${EXTERNAL_PATH}:/usr/src/app/external:ro
    ports: !override
      - 127.0.0.1:2283:3001
      - 127.0.0.1:2284:8081

  immich-microservices:
    volumes:
      - ${EXTERNAL_PATH}:/usr/src/app/external:ro
    ports:
      - 127.0.0.1:2285:8081

networks:
  default:
    enable_ipv6: true
    ipam:
      config:
        - subnet: 2001:0db8::/112

Your .env content

# Immich provided one +

# Custom
###################################################################################
# External library path
EXTERNAL_PATH=/home/user/Images/Photos

# Connection secret for postgres
DB_PASSWORD='...'

# Monitoring
IMMICH_METRICS=true

Reproduction steps

1. `curl http://localhost:2285/metrics`
2. Get no metrics but error message

Relevant log output

Nothing about metrics in the logs

Additional information

Metrics endpoint for server is OK.

zigarn commented 4 months ago

I think it's related to #9169

michelheusschen commented 4 months ago

Can confirm that metrics are not working on v1.105.1, as far as I can tell it's caused by #9426

bo0tzz commented 4 months ago

cc @zackpollard @mertalev

roschaefer commented 3 months ago

The microservices service is gone from the docker-compose.yml after #9551.

I was able to reproduce this on main just by following the documentation.

Here is the commit to reproduce it: https://github.com/roschaefer/immich/commit/7128923e5939016046eb5932e545e9cb70c001dc

zackpollard commented 3 months ago

I'm taking a quick look into a fix for this to see if we can get it in before the next release