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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Prometheus + Grafana actually working

    Prometheus
    5
    8
    299
    Loading More Posts
    • 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.
    • cadorn
      cadorn last edited by

      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.

      BrutalBirdie 1 Reply Last reply Reply Quote 1
      • BrutalBirdie
        BrutalBirdie Staff @cadorn last edited by 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)

        Like my work? Consider donating a beer 🍻 Cheers!

        andreasdueren cadorn 2 Replies Last reply Reply Quote 2
        • andreasdueren
          andreasdueren @BrutalBirdie last edited by

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

          BrutalBirdie 1 Reply Last reply Reply Quote 0
          • BrutalBirdie
            BrutalBirdie Staff @andreasdueren last edited by 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?

            Like my work? Consider donating a beer 🍻 Cheers!

            andreasdueren 1 Reply Last reply Reply Quote 1
            • cadorn
              cadorn @BrutalBirdie last edited by

              @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 Reply Quote 3
              • andreasdueren
                andreasdueren @BrutalBirdie last edited by

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

                1 Reply Last reply Reply Quote 1
                • Topic has been marked as a question  nebulon nebulon 
                • Topic has been marked as solved  nebulon nebulon 
                • J
                  Jan Macenka last edited by

                  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

                  jdaviescoates 1 Reply Last reply Reply Quote 3
                  • jdaviescoates
                    jdaviescoates @Jan Macenka last edited by

                    @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 Reply Quote 2
                    • First post
                      Last post
                    Powered by NodeBB