Skip to content

Prometheus service type doesn't apply basic_auth credentials #1008

@psaghelyi

Description

@psaghelyi

Description

The Prometheus service type doesn't include the Authorization header when making API requests, even when basic_auth is configured. This differs from the Traefik service type which correctly applies basic_auth.

Homer version

v25.11.1

Configuration

- name: "Prometheus"
  type: "Prometheus"
  url: "https://prometheus.example.com"
  basic_auth: "admin:password"

- name: "Traefik Dashboard"
  type: "Traefik"
  url: "https://traefik.example.com"
  basic_auth: "admin:password"

Observed behavior

Network requests show:

  • Traefik: Sends OPTIONS preflight → GET with Authorization header → ✅ 200 OK
  • Prometheus: Sends GET without Authorization header → ❌ 401 Unauthorized

Expected behavior

Both service types should include the Authorization header when basic_auth is configured.

Additional context

  • Server correctly returns CORS headers on 401 responses (Access-Control-Allow-Origin, Access-Control-Allow-Credentials: true)
  • This is NOT the CORS preflight issue documented in PR Fix prometheous inactive alerts and print version #949 - the problem is that the Authorization header is never sent at all for the Prometheus type
  • The Traefik component correctly triggers a CORS preflight by including the Authorization header

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions