Skip to content
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

Permit invocation without configuration file, for promoting ad hoc operations #9

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

amotl
Copy link
Contributor

@amotl amotl commented Apr 23, 2024

About

The idea of this patch is to make it possible to invoke grafana-import without needing to use a configuration file, in order to promote ad hoc use. We hope it will be received well.

Usage

Instead of defining Grafana connectivity settings within the configuration file, the program now also supports defining it through the command line argument --grafana_url, and the environment variable GRAFANA_URL, in the same way like grafana-client is doing it.

Details

In this spirit, this feature expands into quite the opposite direction what the program was originally conceived for, using a configuration file which can store multiple Grafana connection profiles. We think the program can well be used for both use cases, so this patch relaxes the must-have constraint about having a configuration file.

Trivia

This is a stacked PR, based on GH-8. It can be reviewed independently, but please do not merge prematurely.

References

grafana_import/grafana.py Show resolved Hide resolved
grafana_import/util.py Outdated Show resolved Hide resolved
@amotl amotl force-pushed the noconfig branch 2 times, most recently from 91d4a0f to 2cef059 Compare April 23, 2024 20:11
@amotl amotl requested a review from peekjef72 April 23, 2024 20:13
@amotl amotl marked this pull request as ready for review April 23, 2024 20:13
@amotl amotl changed the title Permit invocation without configuration file for ad hoc operations Permit invocation without configuration file, for promoting ad hoc operations Apr 23, 2024
@amotl amotl force-pushed the tests branch 4 times, most recently from 0cb2462 to a333ab6 Compare April 23, 2024 21:52
@peekjef72
Copy link
Collaborator

The feature is a good idea.
I build the tool from the grafana-snapshoot "core" program that was using a config file too... a quick and dirty implementation so I didn't even think about it!
But it ise a good idea.

Copy link
Collaborator

@peekjef72 peekjef72 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.
Everything is fine for me.
You can merge if you are ready.

@amotl amotl mentioned this pull request Apr 24, 2024
Base automatically changed from tests to main April 24, 2024 22:33
@amotl amotl merged commit d4e26e0 into main Apr 24, 2024
2 checks passed
@amotl amotl deleted the noconfig branch April 24, 2024 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants