Giter VIP home page Giter VIP logo

Comments (12)

kfdm avatar kfdm commented on June 25, 2024

promgen.json is generated from Promgen when you save changes (add a new exporter, delete a host, or anything else that affects your monitoring targets). Typically the Promgen worker would run next to Prometheus (on the same server or as a container with a shared volume) so that Promgen can write a promgen.json file that Prometheus can then read.

There are docs here ( https://promgen.readthedocs.io/en/latest/conf/index.html ) but it's possible there are parts that are difficult to understand.

from promgen.

momoco530 avatar momoco530 commented on June 25, 2024

promgen.json was not generated from Promgen when i save changes
[2019-03-18 15:38:49 +0800] [1] [CRITICAL] WORKER TIMEOUT (pid:9)
[2019-03-18 07:38:49 +0000] [9] [INFO] Worker exiting (pid: 9)

from promgen.

momoco530 avatar momoco530 commented on June 25, 2024

Is it related to time zone?

from promgen.

kfdm avatar kfdm commented on June 25, 2024

Hmm. Timezone settings should not have anything to do with it.
Are you running with docker directly or are you using docker-compose? I think I would need to know a little more about how it is configured, and more logs from the worker, to understand where the problem might be.

from promgen.

momoco530 avatar momoco530 commented on June 25, 2024

I'm running with docker

promgen.yml
  prometheus:
    url: http://192.168.137.128:9090/
    version: 2
    promtool: /usr/local/bin/promtool
    rules: /etc/prometheus/promgen.rule.yml

  alertmanager:
    url: http://alertmanager:9093

  alert_blacklist:
    severity: ["debug", "blackhole"]

  config_writer:
    path: /etc/prometheus/promgen.json

  url_writer:
    path: /etc/prometheus/blackbox.json

from promgen.

momoco530 avatar momoco530 commented on June 25, 2024

celery worker logs

-------------- celery@b5e0c5e95264 v4.1.1 (latentcall)
---- **** ----- 
--- * ***  * -- Linux-3.10.0-327.el7.x86_64-x86_64-with 2019-03-18 09:26:46
-- * - **** --- 
- ** ---------- [config]
- ** ---------- .> app:         promgen:0x7f2a591829e8
- ** ---------- .> transport:   redis://192.168.137.128:6380/0
- ** ---------- .> results:     disabled://
- *** --- * --- .> concurrency: 24 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> b5e0c5e95264     exchange=(direct) key=b5e0c5e95264
                .> celery           exchange=celery(direct) key=celery

[2019-03-18 09:26:48,985: WARNING/ForkPoolWorker-14] Request: <Context: {'lang': 'py', 'task': 'promgen.celery.debug_task', 'id': 'd86dc6f4-6fae-4af9-a038-e07ec6b5dd71', 'eta': None, 'expires': None, 'group': None, 'retries': 0, 'timelimit': [None, None], 'root_id': 'd86dc6f4-6fae-4af9-a038-e07ec6b5dd71', 'parent_id': None, 'argsrepr': '()', 'kwargsrepr': '{}', 'origin': 'gen1@b5e0c5e95264', 'reply_to': '95d08a4a-87a5-33a6-8939-fdef1f5532de', 'correlation_id': 'd86dc6f4-6fae-4af9-a038-e07ec6b5dd71', 'delivery_info': {'exchange': '', 'routing_key': 'b5e0c5e95264', 'priority': 0, 'redelivered': None}, 'args': [], 'kwargs': {}, 'hostname': 'celery@b5e0c5e95264', 'is_eager': False, 'callbacks': None, 'errbacks': None, 'chain': None, 'chord': None, 'called_directly': False, '_protected': 1}>

from promgen.

kfdm avatar kfdm commented on June 25, 2024

Can you look over the instructions here ?

https://promgen.readthedocs.io/en/latest/conf/prometheus.html

Judging by the celery output, it's only listening to the default queue celery but not listing to any specific Prometheus queue. Promgen writes to each Prometheus server's queue when it triggers a configuration change.

docker run --rm \
    -v ~/.config/promgen:/etc/promgen/ \
    -v /etc/prometheus:/etc/prometheus \
    line/promgen worker -l info --queues prometheus001

would tell the worker to listen to the queue for our server prometheus001

from promgen.

momoco530 avatar momoco530 commented on June 25, 2024

Thanks very much

from promgen.

liuzh-sa avatar liuzh-sa commented on June 25, 2024

Can you look over the instructions here ?

https://promgen.readthedocs.io/en/latest/conf/prometheus.html

Judging by the celery output, it's only listening to the default queue celery but not listing to any specific Prometheus queue. Promgen writes to each Prometheus server's queue when it triggers a configuration change.

docker run --rm \
    -v ~/.config/promgen:/etc/promgen/ \
    -v /etc/prometheus:/etc/prometheus \
    line/promgen worker -l info --queues prometheus001

would tell the worker to listen to the queue for our server prometheus001

Hi Paul, is "prometheus001" a fixed name or the hostname of the prometheus server?

from promgen.

momoco530 avatar momoco530 commented on June 25, 2024

from promgen.

liuzh-sa avatar liuzh-sa commented on June 25, 2024

Hi I use the Prometheus server IP [email protected] From: liuzh-sa Date: 2021-01-15 15:57 To: line/promgen CC: momoco530; State change Subject: Re: [line/promgen] How to create promgen.json file? (#138) Can you look over the instructions here ? https://promgen.readthedocs.io/en/latest/conf/prometheus.html Judging by the celery output, it's only listening to the default queue celery but not listing to any specific Prometheus queue. Promgen writes to each Prometheus server's queue when it triggers a configuration change. docker run --rm \ -v ~/.config/promgen:/etc/promgen/ \ -v /etc/prometheus:/etc/prometheus \ line/promgen worker -l info --queues prometheus001 would tell the worker to listen to the queue for our server prometheus001 Hi Paul, is "prometheus001" a fixed name or the hostname of the prometheus server? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

HI,i ran promgen by docker as follows:
sudo docker run --rm -d -p 8000:8000 -v /etc/promgen/:/etc/promgen/ -e DEBUG=1 -e ALLOWED_HOSTS=* 10.200.10.11:5000/line/promgen
sudo docker run --rm -d -v /etc/promgen/:/etc/promgen/ -v /etc/prometheus:/etc/prometheus 10.200.10.11:5000/line/promgen worker --queues prometheus001 -l debug

I added rules, but no configuration file was generated on the backend server "/etc/prometheus/"

from promgen.

liuzh-sa avatar liuzh-sa commented on June 25, 2024

Hi I use the Prometheus server IP [email protected] From: liuzh-sa Date: 2021-01-15 15:57 To: line/promgen CC: momoco530; State change Subject: Re: [line/promgen] How to create promgen.json file? (#138) Can you look over the instructions here ? https://promgen.readthedocs.io/en/latest/conf/prometheus.html Judging by the celery output, it's only listening to the default queue celery but not listing to any specific Prometheus queue. Promgen writes to each Prometheus server's queue when it triggers a configuration change. docker run --rm \ -v ~/.config/promgen:/etc/promgen/ \ -v /etc/prometheus:/etc/prometheus \ line/promgen worker -l info --queues prometheus001 would tell the worker to listen to the queue for our server prometheus001 Hi Paul, is "prometheus001" a fixed name or the hostname of the prometheus server? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

HI,i ran promgen by docker as follows:
sudo docker run --rm -d -p 8000:8000 -v /etc/promgen/:/etc/promgen/ -e DEBUG=1 -e ALLOWED_HOSTS=* 10.200.10.11:5000/line/promgen
sudo docker run --rm -d -v /etc/promgen/:/etc/promgen/ -v /etc/prometheus:/etc/prometheus 10.200.10.11:5000/line/promgen worker --queues prometheus001 -l debug

I added rules, but no configuration file was generated on the backend server "/etc/prometheus/"

Hi,momoco,can you show your configuration as follows:
prometheus.yml promgen.yml alertmanager.yml

from promgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.