Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Configuration or Disabling of Prometheus Metrics Port #499

Open
ywkim92 opened this issue Feb 20, 2025 · 0 comments
Open

Allow Configuration or Disabling of Prometheus Metrics Port #499

ywkim92 opened this issue Feb 20, 2025 · 0 comments

Comments

@ywkim92
Copy link

ywkim92 commented Feb 20, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant