Giter VIP home page Giter VIP logo

Comments (8)

seoester avatar seoester commented on June 25, 2024

The preparation and installation required for the worker are the same as for the web app.

Then you register and start like this:

# Register prometheus server
# Syntax: promgen register <shard name> <prometheus host> <prometheus port>
promgen register default localhost 9090
# Start worker
# Syntax: celery -A promgen worker -l <log level> -Q <queues>
celery -A promgen worker -l info -Q localhost

The worker needs to subscribe to the queue with the host name of the prometheus server.

You can also have a look at #57, it includes documentation on how to setup the web app and the worker using docker.

from promgen.

hmmxp avatar hmmxp commented on June 25, 2024

i believe the above is for push model if promgen and promethues is installed on the same server.

But my Prometheus and promgen is on different server, how can i configure pull model?

Update:

I saw this article
https://github.com/kfdm/promgen/blob/5baa8fe44e6f5bac78f4f33989990d0101c5b40b/docs/worker.rst

But how should i register my Prometheus server to promgen? Or are there any missing steps?

from promgen.

kfdm avatar kfdm commented on June 25, 2024

The celery worker is installed the same way as the web app and as long as they can reach the same database and redis instance, it doesn't matter if the web app and workers are on different servers.

Apparently I forgot to merge some docs updates but you should be able to see some illustrations here
https://github.com/line/promgen/pull/46/files
I'll try to go through the PRs on Monday.

from promgen.

hmmxp avatar hmmxp commented on June 25, 2024

Dear Paul & Seoster,

Will await the documents and finish testing in my linux environment and if i have spare time will test on docker

My other question is are the below run once:

Register prometheus server

Syntax: promgen register

promgen register default localhost 9090

Start worker

Syntax: celery -A promgen worker -l -Q

celery -A promgen worker -l info -Q localhost

As i am running promgen in a virtual env, and if the above is run once and upon my server reboot it is still in effect?

thank you all for the wonderful job

from promgen.

kfdm avatar kfdm commented on June 25, 2024

Correct. Those commands register the worker in Promgen's database so the data is saved between reboots and anything else :)

The worker flags you need to add to your startup command so that it knows which queue to run from.

from promgen.

hmmxp avatar hmmxp commented on June 25, 2024

Dear Paul,

If i am running uWSGI to launch the application where should i add the worker flag?

from promgen.

kfdm avatar kfdm commented on June 25, 2024

uWSGI would be used to run the Promgen worker, so there are no worker flags required.

Something like systemd or another process manager would run the worker on the same node as Prometheus. I use something like this when deployed from Ansible

[Unit]
Description=Daemon for Celery
After=network.target

[Service]
Type=simple
ExecStart={{ promgen_virutalenv }}/bin/celery -A promgen worker -l info --queues {{ ansible_host }}
Restart=on-failure
User=prometheus

[Install]
WantedBy=multi-user.target

from promgen.

hmmxp avatar hmmxp commented on June 25, 2024

Dear Paul,

Noted on this let me test it out and feedback and update the document as needed

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.