Skip to content

Allow Configuration or Disabling of Prometheus Metrics Port #499

@ywkim92

Description

@ywkim92

Feature request

  • Description:
    Currently, the ghcr.io/huggingface/text-embeddings-inference:1.6-grpc container always binds to port 9000 for Prometheus metrics, and there is no apparent way to modify or disable this behavior. This causes port conflicts when running multiple containers inside the same Kubernetes pod, as all instances attempt to bind to the same port.

  • Problem Statement:

    • The container exposes port 9000 by default for Prometheus metrics.
    • When deploying multiple containers in the same pod, they all try to bind to port 9000, leading to an "address already in use" error.
    • Since Kubernetes pods share the same network namespace, this issue cannot be mitigated without modifying the container.
  • Proposed Solution:
    I would like to request a feature enhancement to allow users to:

  1. Modify the Prometheus metrics port via an environment variable, e.g.:
env:
  - name: PROMETHEUS_PORT
    value: "9001"
  1. Disable Prometheus metrics entirely via an environment variable, e.g.:
env:
  - name: ENABLE_PROMETHEUS
    value: "false"

If ENABLE_PROMETHEUS=false, the container should not start the Prometheus metrics server at all.

  • Expected Benefits:
    • Increased flexibility for Kubernetes users and multi-container deployments.
    • Avoids unnecessary container modifications or requiring separate pods for each instance.
    • Improves adoption and scalability for users integrating this container into complex deployments.

Would it be possible to introduce this configuration in a future release? I’d be happy to contribute if needed! 🚀

Thank you for your work on this great project! 🙌

Motivation

  • Problem Statement:
    • The container exposes port 9000 by default for Prometheus metrics.
    • When deploying multiple containers in the same pod, they all try to bind to port 9000, leading to an "address already in use" error.
    • Since Kubernetes pods share the same network namespace, this issue cannot be mitigated without modifying the container.

Your contribution

  • Proposed Solution:
    I would like to request a feature enhancement to allow users to:
  1. Modify the Prometheus metrics port via an environment variable, e.g.:
env:
  - name: PROMETHEUS_PORT
    value: "9001"
  1. Disable Prometheus metrics entirely via an environment variable, e.g.:
env:
  - name: ENABLE_PROMETHEUS
    value: "false"

If ENABLE_PROMETHEUS=false, the container should not start the Prometheus metrics server at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions