-
Notifications
You must be signed in to change notification settings - Fork 478
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
Agent Flow Convert Issues - Issues with Dashes in Job Name and Incorrect Scrape Targets #5077
Comments
Another issue I noticed was that the Is this an issue with the conversion or an option that should be available? |
There's a bunch here so I will do this in multiple comments
Critical failures mean that the converter cannot move forward and cannot be bypassed. This specific error indicates that the prometheus config provided is not valid to run with the version of prometheus we are using. This failure occurs before any of the converter specific code executes. Would you be able to share your input for this? |
This is an issue with the exact workaround you came up with that will be resolved with v0.37.0. Here are the PRs for River and Agent that resolve it To fix it properly this work was necessary since River identifiers are fairly strict in how they are constructed. https://grafana.com/docs/agent/next/flow/config-language/syntax/#identifiers |
I will need another PR to fix the valid identifier issue everywhere for prometheus (missed a couple spots in the above PR). For the repeating targets rather than the correct targets I have a working fix and will create a PR for this. |
|
Here's the PR with the fixes discussed above: #5102 I tested the config you provided here: https://github.com/grafana/mimir/blob/main/development/mimir-microservices-mode/config/prometheus.yaml Please let me know if the below output matches your expectation after my code changes.
The river output is:
|
It should be the same config file; In particular line 41. |
Yeah, that matches roughly what I was expecting, tested it here, and it works, no obvious issues etc. That is great, Thanks for the assistance here, much appreciated. |
I tested the new file with histograms and needed to add a couple more unsupported checks for histograms so they don't silently get ignored. #5117 Both fixes will be released today along with a v0.36.1 patch. |
What's wrong?
When using Grafana Agent (Flow) to convert a Prometheus Config File to a Flow Config File, the outcome is not what I would expect and there are several issues.
The first is if the config file contains
scrape_classic_histograms
, it fails with the below error;I would have expected the
--bypass-errors
would have skipped this if its not supported in Flow.The next is that it fails due to an issue with the Job Name containing a
-
(dash/hypen) while valid in Prometheus (the config works) it fails in Flow with the below error;Upon further testing, I found that changing the Scrape Job Name from
- job_name: mimir-microservices
to- job_name: mimir_microservices
(replacing the Dash/Hypen with an Underscore) resolved this and the Flow Config was then generated.However, finally, in my Flow Config that was outputted the Discovery section contains the same host for all items, when there were multiple unique hosts in the original Config, example
Original Prometheus Config;
Output Flow Config;
The
load-generator:9900
is the last value in the original Prometheus Configuration.Steps to reproduce
Download this Prometheus Configuration;
https://github.com/grafana/mimir/blob/main/development/mimir-microservices-mode/config/prometheus.yaml
Verify that it works in Prometheus.
Try to convert the config to Agent Flow
System information
Linux, Manjaro
Software version
grafana-agent --version ─╯
agent, version 0.35.4 (branch: , revision: unknown)
build user:
build date: 2023-08-24T12:01:47Z
go version: go1.21.0
platform: linux/amd64
tags: builtinassets,promtail_journal_enabled
Configuration
Output Configuration;
Logs
No response
The text was updated successfully, but these errors were encountered: