Skip to content

Conversation

sd2k
Copy link
Collaborator

@sd2k sd2k commented Jun 10, 2025

This commit consolidates all Grafana-related configuration into a single GrafanaConfig struct that includes URL, API key, and debug flag. This simplifies the configuration management and provides a cleaner API for programmatic usage.

Changes:

  • Introduce GrafanaConfig struct containing Debug, URL, and APIKey fields
  • Update all context functions to use the consolidated config
  • Update CLI main.go to use GrafanaConfig
  • Update tests to use the new configuration approach
  • Keep existing WithGrafanaURL/GrafanaURLFromContext functions for compatibility

This makes it easier to pass configuration around and provides a foundation for future configuration options. For example, if we are to add custom TLS certs (#164) then we can include it on the config, rather than having to add a whole new set of context management functions.

@sd2k sd2k force-pushed the config-consolidation branch 4 times, most recently from 42ed424 to c7b68fa Compare June 11, 2025 13:52
@sd2k sd2k marked this pull request as ready for review June 11, 2025 13:55
@sd2k sd2k requested a review from a team as a code owner June 11, 2025 13:55
This commit consolidates all Grafana-related configuration into a single
GrafanaConfig struct that includes URL, API key, and debug flag. This
simplifies the configuration management and provides a cleaner API for
programmatic usage.

Changes:
- Introduce GrafanaConfig struct containing Debug, URL, and various auth
  fields
- Update all context functions to use the consolidated config
- Update tests to use the new configuration approach

This makes it easier to pass configuration around and provides a foundation
for future configuration options.
@sd2k sd2k force-pushed the config-consolidation branch from c7b68fa to a02d814 Compare June 12, 2025 08:42
Copy link
Contributor

@ioanarm ioanarm left a comment

Choose a reason for hiding this comment

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

This is great Ben 🚀

@sd2k sd2k enabled auto-merge (squash) June 12, 2025 09:23
@sd2k sd2k merged commit 1a7f9c7 into main Jun 12, 2025
12 checks passed
@sd2k sd2k deleted the config-consolidation branch June 12, 2025 09:24
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