Grafana Agent support for scraping custom metrics from github.com/kubernetes-sigs/prometheus-adapter #2646
Unanswered
aengusrooneygrafana
asked this question in
Q&A
Replies: 2 comments
-
I don't think there's anything for Grafana Agent to do here. Prometheus Adapter can be configured with credentials to connect to Prometheus. From its code, I see the following flags:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@DWebb0, registering his interest here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My first assumption is that I would like to stick with the Grafana Agent only to send Prom metrics to Grafana Cloud, as I understood we do not need to manage any other Prometheus components in this case.
I was able to successfully install the Grafana Agent Operator + Grafana Agent
Logs and metrics were flowing properly to the Grafana Cloud test stack
I was able to add/remove the ServiceMonitor's and the automation seems to work fine
The issue I hit was the fact we are using https://github.com/kubernetes-sigs/prometheus-adapter for custom metrics
This service requires to have Prometheus as a source of information: https://github.com/kubernetes-sigs/prometheus-adapter/blob/master/deploy/manifests/deployment.yaml#L34
Currently, we have it working with in-cluster Prometheus like this:
--prometheus-url=https://prometheus.monitoring.svc:9090/
Even though the Grafana Cloud exposes the endpoint to pull aggregated data from it as it is password protected, this prometheus-adapter does not seem to support it
My second choice and test was to use both the Grafana Agent and on-cluster Prometheus with configured remoteWrite to Grafana Cloud
I was able to successfully install the Grafana Agent Operator + Grafana Agent
I was able to successfully setup the Prometheus Operator + Prometheus + remoteWrite to Grafana Cloud
Logs and metrics were flying properly to the Grafana Cloud test stack I have
I was able to add/remove the ServiceMonitor's and the automation seems to work fine
Grafana Agent in this setup is actually handling only the LogsInstance and pushing logs to the Grafana Cloud.
To summarise:
The only solution I was able to come up with to make existing stuck preserves it functionality and supports sending logs to Grafana Cloud is:
Grafana Agent Operator + Grafana Agent (for logs)
Prometheus Operator + Prometheus (for metrics)
Driver: We would like to avoid the need to manage the Prometheus servers for the clusters on our side, but I do not know any other solution to make it happen than the one I have described.
Could you please provide some advice on this topic?
Beta Was this translation helpful? Give feedback.
All reactions