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

feat(grafana): add providers configuration #211

Merged
merged 4 commits into from
Jun 6, 2024
Merged

feat(grafana): add providers configuration #211

merged 4 commits into from
Jun 6, 2024

Conversation

alexpearce
Copy link
Contributor

Addresses #210.

I've tested this by hand with configuration:

services.grafana."grafana" = {
  enable = true;
  providers = [
    {
      name = "Databases";
      type = "file";
      options = {
        path = ./dashboards;
        foldersFromFilesStructure = true;
      };
    }
  ];
};

I haven't looked into it, but it might be possible to extend the existing Grafana test to check that a folder of dashboards is loaded.

Copy link
Member

@shivaraj-bh shivaraj-bh left a comment

Choose a reason for hiding this comment

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

It would be nice to also see a test for this option!

nix/grafana.nix Outdated Show resolved Hide resolved
@alexpearce
Copy link
Contributor Author

I'm not sure how best to run the tests locally. test/flake.nix refers services-flake as juspay/services-flake so it won't pick up changes in my local repo.

@shivaraj-bh
Copy link
Member

I'm not sure how best to run the tests locally. test/flake.nix refers services-flake as juspay/services-flake so it won't pick up changes in my local repo.

Once in the devShell you can run just test grafana to run the test locally

@alexpearce
Copy link
Contributor Author

Nice, thanks!

I had to modify the tests to use nixos-24.05 to work around the Grafana-on-macOS issue, but with my latest commit the tests pass.

nix/grafana_test.nix Outdated Show resolved Hide resolved
@shivaraj-bh shivaraj-bh merged commit eb3bac5 into juspay:main Jun 6, 2024
4 checks passed
@alexpearce alexpearce deleted the grafana-dashboard-provisioning branch June 6, 2024 16:10
@shivaraj-bh
Copy link
Member

Thanks @alexpearce

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