feat: add Mimir (External Endpoint) Prometheus provider#1929
Open
ni-mi wants to merge 1 commit into
Open
Conversation
Author
|
@robertobandini - I am not sure what is the process to get this PR approved or reviewed - I'd appreciate your help with it. |
e552a39 to
9a718b9
Compare
Add support for querying metrics from Grafana Mimir, a Prometheus-compatible remote metrics backend that does not run as an in-cluster Kubernetes service. Changes: - New "Mimir (External Endpoint)" Prometheus provider that uses directUrl to bypass the K8s API service proxy - Support for custom HTTP headers on direct metrics requests, enabling X-Scope-OrgID and other Mimir-specific headers - Dedicated UI section when Mimir is selected: endpoint URL, anonymous tenant checkbox, and arbitrary key-value header editor - Hide irrelevant "service address" and "HTTPS requests" fields for Mimir - Trim whitespace in custom path prefix to prevent malformed URLs - Improved error messages for failed direct metrics requests
9a718b9 to
2402586
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for Grafana Mimir as a Prometheus metrics provider. Mimir is a Prometheus-compatible remote metrics backend that typically runs outside the cluster, so it cannot be accessed through the Kubernetes API service proxy like traditional in-cluster Prometheus deployments.
X-Scope-OrgID(required by multi-tenant Mimir) and arbitrary key-value headers on every metrics requestMotivation
Organizations using Mimir as a centralized metrics backend don't have a Prometheus service running inside each cluster. The existing Freelens Prometheus integration mandates a
<namespace>/<service>:<port>address that gets proxied through the Kubernetes API. This PR adds a first-class option for reaching Mimir (or any external Prometheus-compatible API) directly.Changes
packages/technical-features/prometheus/src/mimir-provider.injectable.tspackages/technical-features/prometheus/src/register-injectables.tspackages/core/src/common/cluster-types.tscustomHeadersfield toClusterPrometheusPreferencespackages/core/src/main/get-metrics.injectable.tsdirectUrlrequests; improve error messages with response bodypackages/core/src/main/cluster/prometheus-handler/prometheus-handler.tspackages/core/src/renderer/components/cluster-settings/prometheus-setting.tsxTest plan
/prometheuscustom path prefixX-Scope-OrgID: anonymousheader is sent