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. Adding remote targets in prometheus.yml

Adding remote targets in prometheus.yml

Scheduled Pinned Locked Moved Prometheus
5 Posts 3 Posters 2.4k Views 3 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.
  • F Offline
    F Offline
    feloxxx
    wrote on last edited by
    #1

    hello everyone, I have installed Prometheus and now I want to add more targets to the prometheus.yml.
    To do this, I open the file prometheus.yml in this path:
    /home/yellowtent/appsdata/97a95880-aba9-44ad-bcda-237c3c433880/data/config

    i add this

    • job_name: <SYSTEM-NAMEN>
      scrape_interval: 5s
      static_configs:
      - targets: ['<MY-IP:9100']

    after restart the Prometheus didn't start again. i see the changes in the file manager.

    when I remove the lines again, everything works fine again. What am I doing wrong? Can you please help me?

    Thank you in advance, Felix

    1 Reply Last reply
    1
    • BrutalBirdieB Offline
      BrutalBirdieB Offline
      BrutalBirdie
      Partner
      wrote on last edited by girish
      #2

      Firstly I would advice to edit the file with the Cloudron Filemanager not directly in the root / as root from the system level.

      Like my work? Consider donating a drink. Cheers!

      1 Reply Last reply
      0
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        The Log viewer will tell you why the app is not starting. Probably some yaml error?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          feloxxx
          wrote on last edited by
          #4

          Hello and thank you very much for the quick response from you. Editing the file in the ROOT system as well as with the File Manager has the same effects. Here is the log file: thank you very much felix

          2023-12-18T06:55:40.000Z => Starting Prometheus
          2023-12-18T06:55:40.000Z ts=2023-12-18T06:55:40.840Z caller=main.go:487 level=error msg="Error loading config (--config.file=/app/data/config/prometheus.yml)" file=/app/data/config/prometheus.yml err="parsing YAML file /app/data/config/prometheus.yml: yaml: line 31: did not find expected key"
          2023-12-18T06:55:43.000Z => Source custom variables for cli args
          2023-12-18T06:55:43.000Z => Starting Prometheus
          2023-12-18T06:55:43.000Z ts=2023-12-18T06:55:43.655Z caller=main.go:487 level=error msg="Error loading config (--config.file=/app/data/config/prometheus.yml)" file=/app/data/config/prometheus.yml err="parsing YAML file /app/data/config/prometheus.yml: yaml: line 31: did not find expected key"
          2023-12-18T06:55:47.000Z => Source custom variables for cli args
          2023-12-18T06:55:47.000Z => Starting Prometheus
          2023-12-18T06:55:47.000Z ts=2023-12-18T06:55:47.269Z caller=main.go:487 level=error msg="Error loading config (--config.file=/app/data/config/prometheus.yml)" file=/app/data/config/prometheus.yml err="parsing YAML file /app/data/config/prometheus.yml: yaml: line 31: did not find expected key"

          1 Reply Last reply
          0
          • BrutalBirdieB Offline
            BrutalBirdieB Offline
            BrutalBirdie
            Partner
            wrote on last edited by
            #5

            please post your yaml with removed / redacted sensitive information in a code block and not plain.
            You can also always use

            e.g. :

            job_name: <SYSTEM-NAMEN>
            scrape_interval: 5s
            static_configs:
              - targets: ['<MY-IP:9100']
            

            yamllint is also a great to to check if you yaml file is valid.

            Like my work? Consider donating a drink. Cheers!

            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