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

Support for multihost and status for alerts #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vity01
Copy link

@Vity01 Vity01 commented Sep 18, 2023

I present my solution for multihost Grafanas. It's easy to use and the code should be backwards compatible with current implementation. Use can choose whether to use multihost setting or a simple one.

Example of usage:

# app-config.yaml
proxy:
  '/grafana/api':
    # Maybe a public or an internal DNS
    target: https://grafana.host/
    headers:
      Authorization: Bearer ${GRAFANA_TOKEN}
  '/grafana2/api':
    # Maybe a public or an internal DNS
    target: https://grafana2.host/
    headers:
      Authorization: Bearer ${GRAFANA2_TOKEN}

grafana:
  hosts:                
    - id: 'default' #unique host identifier used in Catalog Yaml annotation `grafana/source-id`

      # Publicly accessible domain
      domain: https://monitoring.company.com

      # Path to use for requests via the proxy, defaults to /grafana/api        
      proxyPath: '/grafana/api'

      # Is unified alerting enabled in Grafana?
      # See: https://grafana.com/blog/2021/06/14/the-new-unified-alerting-system-for-grafana-everything-you-need-to-know/
      # Optional. Default: false
      unifiedAlerting: false

    - id: 'my-second-instance' #unique host identifier used in Catalog Yaml annotation `grafana/source-id`     

      # Publicly accessible domain
      domain: https://monitoring2.company.com 

      # Path to use for requests via the proxy, defaults to /grafana/api        
      proxyPath: '/grafana2/api'      

      # Is unified alerting enabled in Grafana?
      # See: https://grafana.com/blog/2021/06/14/the-new-unified-alerting-system-for-grafana-everything-you-need-to-know/
      # Optional. Default: false
      unifiedAlerting: false

I also integrated support for getting status for Alerts (sorry I had to mix it, it would be a mess to separate it).
#65 and #70

@dtemir
Copy link

dtemir commented Sep 21, 2023

@Vity01 This is great. Do you have any advice on how this can be approached without manually defining Grafanas in app-config.yaml? We want to allow developers bring their own Grafanas to Backstage with Resource kind

@Vity01
Copy link
Author

Vity01 commented Sep 21, 2023

@dtemir I don't think it is a good idea. Think about secrets, proxies...

@higor-duarte-oliveira
Copy link

@Vity01 Any updates on this PR?

Copy link

@ekrucio ekrucio left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants