Skip to content

Support for multihost and status for alerts - #76

Open
Vity01 wants to merge 1 commit into
K-Phoen:mainfrom
Vity01:multihost
Open

Support for multihost and status for alerts#76
Vity01 wants to merge 1 commit into
K-Phoen:mainfrom
Vity01:multihost

Conversation

@Vity01

@Vity01 Vity01 commented Sep 18, 2023

Copy link
Copy Markdown

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

dtemir commented Sep 21, 2023

Copy link
Copy Markdown

@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

Vity01 commented Sep 21, 2023

Copy link
Copy Markdown
Author

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

@higor-duarte-oliveira

Copy link
Copy Markdown

@Vity01 Any updates on this PR?

@ekrucio ekrucio left a comment

Copy link
Copy Markdown

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