Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Prometheus
  3. Prometheus + Grafana actually working

Prometheus + Grafana actually working

Scheduled Pinned Locked Moved Solved Prometheus
10 Posts 7 Posters 2.0k Views 7 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • cadornC Offline
    cadornC Offline
    cadorn
    wrote on last edited by
    #1

    Has anyone actually hooked up Grafana to Promtheus (both installed using cloudron)?

    When I try and add the prometheus server I get CORS errors and it is preventing the page from redirecting (to authenticate I guess).

    It says it needs a Access-Control-Allow-Origin header on the prometheus side to allow grafana hostname.

    What is odd is that I have it set the access mode set to Server yet is it still trying to connect to it from the browser.

    Any tips would be welcome. This would be great to get working.

    BrutalBirdieB 1 Reply Last reply
    1
    • cadornC cadorn

      Has anyone actually hooked up Grafana to Promtheus (both installed using cloudron)?

      When I try and add the prometheus server I get CORS errors and it is preventing the page from redirecting (to authenticate I guess).

      It says it needs a Access-Control-Allow-Origin header on the prometheus side to allow grafana hostname.

      What is odd is that I have it set the access mode set to Server yet is it still trying to connect to it from the browser.

      Any tips would be welcome. This would be great to get working.

      BrutalBirdieB Offline
      BrutalBirdieB Offline
      BrutalBirdie
      Partner
      wrote on last edited by BrutalBirdie
      #2

      @cadorn Yes I do.

      8990d28a-bc19-4922-922b-9a29678a7d39-image.png

      022e436e-caca-4336-a7e8-c14ca48a2aff-image.png

      cff74892-caf9-4b08-810d-7eefacd1ebc0-image.png

      b5e90bf5-1c6a-4516-84e1-a52566a602dc-image.png

      (alt: multiple screenshots showing grafana and prometheus hooked up in cloudron with data in a dashboard)

      Like my work? Consider donating a drink. Cheers!

      andreasduerenA cadornC 2 Replies Last reply
      2
      • BrutalBirdieB BrutalBirdie

        @cadorn Yes I do.

        8990d28a-bc19-4922-922b-9a29678a7d39-image.png

        022e436e-caca-4336-a7e8-c14ca48a2aff-image.png

        cff74892-caf9-4b08-810d-7eefacd1ebc0-image.png

        b5e90bf5-1c6a-4516-84e1-a52566a602dc-image.png

        (alt: multiple screenshots showing grafana and prometheus hooked up in cloudron with data in a dashboard)

        andreasduerenA Offline
        andreasduerenA Offline
        andreasdueren
        wrote on last edited by
        #3

        @BrutalBirdie Nice! Would you mind sharing setup instructions for absolute grafana noobs? I tried to set things up but failed completely with the documentation.

        BrutalBirdieB 1 Reply Last reply
        0
        • andreasduerenA andreasdueren

          @BrutalBirdie Nice! Would you mind sharing setup instructions for absolute grafana noobs? I tried to set things up but failed completely with the documentation.

          BrutalBirdieB Offline
          BrutalBirdieB Offline
          BrutalBirdie
          Partner
          wrote on last edited by BrutalBirdie
          #4

          @andreasdueren well Grafana is only a view source, it does not provide any data it self.
          I am collecting data from servers via prometheus and I am displaying this in grafana.

          ps: up the retention_time in your /app/data/prometheus_variables.sh

          #!/bin/bash
          
          # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
          export retention_time="180d"
          

          Default is 15 days which is... well useless for long term analytics.
          https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects

          What exactly do you mean by setup instructions?
          Building a dashboard? Adding Datasources?

          Like my work? Consider donating a drink. Cheers!

          andreasduerenA L 2 Replies Last reply
          1
          • BrutalBirdieB BrutalBirdie

            @cadorn Yes I do.

            8990d28a-bc19-4922-922b-9a29678a7d39-image.png

            022e436e-caca-4336-a7e8-c14ca48a2aff-image.png

            cff74892-caf9-4b08-810d-7eefacd1ebc0-image.png

            b5e90bf5-1c6a-4516-84e1-a52566a602dc-image.png

            (alt: multiple screenshots showing grafana and prometheus hooked up in cloudron with data in a dashboard)

            cadornC Offline
            cadornC Offline
            cadorn
            wrote on last edited by
            #5

            @BrutalBirdie Ah thanks! Got it working now.

            The browser trying to connect threw me off. Once I supplied Basic Auth credentials it works!

            1 Reply Last reply
            3
            • BrutalBirdieB BrutalBirdie

              @andreasdueren well Grafana is only a view source, it does not provide any data it self.
              I am collecting data from servers via prometheus and I am displaying this in grafana.

              ps: up the retention_time in your /app/data/prometheus_variables.sh

              #!/bin/bash
              
              # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
              export retention_time="180d"
              

              Default is 15 days which is... well useless for long term analytics.
              https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects

              What exactly do you mean by setup instructions?
              Building a dashboard? Adding Datasources?

              andreasduerenA Offline
              andreasduerenA Offline
              andreasdueren
              wrote on last edited by
              #6

              @BrutalBirdie Yes, adding data sources. I wasn't able to get prometheus integrated 😬

              1 Reply Last reply
              1
              • nebulonN nebulon marked this topic as a question on
              • nebulonN nebulon has marked this topic as solved on
              • Jan MacenkaJ Offline
                Jan MacenkaJ Offline
                Jan Macenka
                wrote on last edited by
                #7

                just had the same issue and wanted to add something here as a documentation:

                If both Grafana and Prometheus are running as a cloudron-app, you can add Prometheus as a data-source in Grafana by inputting http://<PROMETHEUS-SERVICE-UUID>:9090 in the URL-field where PROMETHEUS-SERVICE-UUID can be found form the prometheus container either by looking up its installation location in the Storage-Tab or by connecting via terminal and copying the hostname.

                Cheers,
                Jan

                jdaviescoatesJ 1 Reply Last reply
                4
                • Jan MacenkaJ Jan Macenka

                  just had the same issue and wanted to add something here as a documentation:

                  If both Grafana and Prometheus are running as a cloudron-app, you can add Prometheus as a data-source in Grafana by inputting http://<PROMETHEUS-SERVICE-UUID>:9090 in the URL-field where PROMETHEUS-SERVICE-UUID can be found form the prometheus container either by looking up its installation location in the Storage-Tab or by connecting via terminal and copying the hostname.

                  Cheers,
                  Jan

                  jdaviescoatesJ Offline
                  jdaviescoatesJ Offline
                  jdaviescoates
                  wrote on last edited by
                  #8

                  @Jan-Macenka said in Prometheus + Grafana actually working:

                  just had the same issue and wanted to add something here as a documentation:

                  If both Grafana and Prometheus are running as a cloudron-app, you can add Prometheus as a data-source in Grafana by inputting http://<PROMETHEUS-SERVICE-UUID>:9090 in the URL-field where PROMETHEUS-SERVICE-UUID can be found form the prometheus container either by looking up its installation location in the Storage-Tab or by connecting via terminal and copying the hostname.

                  Cheers,
                  Jan

                  @staff sounds like something that belongs in the docs 🙂

                  I use Cloudron with Gandi & Hetzner

                  1 Reply Last reply
                  2
                  • BrutalBirdieB BrutalBirdie

                    @andreasdueren well Grafana is only a view source, it does not provide any data it self.
                    I am collecting data from servers via prometheus and I am displaying this in grafana.

                    ps: up the retention_time in your /app/data/prometheus_variables.sh

                    #!/bin/bash
                    
                    # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
                    export retention_time="180d"
                    

                    Default is 15 days which is... well useless for long term analytics.
                    https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects

                    What exactly do you mean by setup instructions?
                    Building a dashboard? Adding Datasources?

                    L Offline
                    L Offline
                    lcd_official
                    wrote on last edited by
                    #9

                    @BrutalBirdie said in Prometheus + Grafana actually working:

                    ps: up the retention_time in your /app/data/prometheus_variables.sh

                    #!/bin/bash
                    
                    # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
                    export retention_time="180d"
                    

                    Default is 15 days which is... well useless for long term analytics.
                    https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects

                    Just FYI, I noticed that /app/data/prometheus_variables.sh did not exist anymore - and in fact the app at startup will actually take prometheus_variables.sh if it DOES exist, and mv (replace) over /app/data/env.sh, which isn't good...

                    You can edit /app/data/env.sh itself though, and update the storage.tsdb.retention.time CLI option. Here is my env.sh for reference:

                    #!/bin/bash
                    
                    # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
                    # edit this variable to change startup options
                    export cli_options="--storage.tsdb.retention.time=180d --storage.tsdb.path=/app/data/storage"
                    

                    Thanks 🙂

                    girishG 1 Reply Last reply
                    2
                    • L lcd_official

                      @BrutalBirdie said in Prometheus + Grafana actually working:

                      ps: up the retention_time in your /app/data/prometheus_variables.sh

                      #!/bin/bash
                      
                      # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
                      export retention_time="180d"
                      

                      Default is 15 days which is... well useless for long term analytics.
                      https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects

                      Just FYI, I noticed that /app/data/prometheus_variables.sh did not exist anymore - and in fact the app at startup will actually take prometheus_variables.sh if it DOES exist, and mv (replace) over /app/data/env.sh, which isn't good...

                      You can edit /app/data/env.sh itself though, and update the storage.tsdb.retention.time CLI option. Here is my env.sh for reference:

                      #!/bin/bash
                      
                      # https://prometheus.io/docs/prometheus/latest/storage/#operational-aspects
                      # edit this variable to change startup options
                      export cli_options="--storage.tsdb.retention.time=180d --storage.tsdb.path=/app/data/storage"
                      

                      Thanks 🙂

                      girishG Offline
                      girishG Offline
                      girish
                      Staff
                      wrote on last edited by
                      #10

                      @lcd_official indeed, prometheus_variables.sh is obsolete by now. Use env.sh instead.

                      1 Reply Last reply
                      1
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Bookmarks
                      • Search