-
Notifications
You must be signed in to change notification settings - Fork 487
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
[Request] Supporting multiple .river
files for Grafana Agent Flow
#2560
Comments
We've been thinking of a way to support including other River files to support code reuse (e.g., something similar to Terraform modules). It feels like this could fit into those plans a little bit (cc @mattdurham). One of the things we have to decide is what the behavior of loading multiple River files is:
It sounds like you're suggesting the first approach, right? |
My solely personal opinion is that in general other files are loaded as subgraphs with dedicated arguments and exports to interact with the parent graph. This is something the team has talked about loosely and I plan on doing a more formal RFC soon(tm). @payparain if you have some time would love to get more details about your specific use case and to see how modules (name subject to change) can help with those. There is also a side use case of dynamic components that are a bit further down the line, but I think it is a different use case than the one your are suggesting. |
Hey @rfratto, correct, when writing this I was imagining extra files forming subgraphs that eventually all link into one large graph, which would mandate unique labels globally. The alternative isn't as suitable for what I was hoping as the ability to support multiple files writing to the same
Hey @mattdurham, sure! The specific use case I find myself in is coordinating monitoring across a micro-services architecture where different services are developed by different teams. The hope was to have a core set of exporters ( This set up would allow development teams to customise the data coming out of their services without colliding with other teams due to working on the same file across multiple branches. Obviously, there are other ways around this problem; we could for example standardise the instrumentation and relabel at the application level, but as the end goal is to have each team "own" their observability giving the teams the ability to relabel and format their data as required would be a big boon. This additionally allows the flexibility for working around pieces of the architecture that are still worked on that don't fit into a standard mold, where relabelling is the only way forward (for example, if we used an off the shelf prometheus exporter). Thanks for the replies on this, hopefully what I'm saying makes sense :) |
Modules are meant to handle the use case of Agent-as-a-service, where you run a central set of Agents and teams can submit configs and load dynamically. The below is what we are envisioning (this is entirely in design phase so its all subject to change)
The modular array instantiates a subgraph for each file input, and each input would use the same set of arguments (there is further discussion around on if it needs to, if it can be a subset, optional vs required etc). Keys, secrets, etc could be passed in as an argument so that individual teams dont have access. |
As a solution that seems ideal for the use case I envisioned. Great to see it's on the board somewhere, and times being taken to get it right. Thanks for the update! |
cc @mattdurham do you think we should close this issue with the introduction of module.file? |
Yes, modules are our answer to this and are being released so this feels safe to close. |
|
Currently Grafana Agent Flow can only accept a single file for configuration of the Agent when first started (i.e.
agent run <file>
). It would be great if either River could support importing other.river
files into a single entrypoint, or if Agent could accept multiple.river
files on start up.The use case for this is when using Agent Flow in a multi-user organisation, different teams or individuals work on disparate pieces of a single deployment, and it becomes unwieldy to develop against a single file for defining how to scrape all metrics for a deployment. By supporting the ability to use multiple
.river
files, these teams can each maintain their own.river
configuration that can individually be provided to the Agent on a deployment, where each team might point their metrics to a common exporter block. This lowers the impact of a single team potentially having a bad config, as it only takes out their stream of data and not the whole graph.The text was updated successfully, but these errors were encountered: