Giter Club home page Giter Club logo

Comments (5)

elliots avatar elliots commented on May 5, 2024 1

I ended up getting this working great using dns-sd... if its useful to put in, add to in the docs (or for anyone googling..)

Before starting dockprom I add a little extra to the config

    echo "
  - job_name: 'services'
    scrape_interval: 5s
    dns_sd_configs:
      - names:
          - scrape.me.prometheus
        type: 'A'
        port: 9999
    " >> prometheus/prometheus.yml

Then, on each of my services in docker-compose that I want to be monitored i provide the metrics at ":9999/metrics" and add the right alias...

  my-service:
    image: "super-special-service:latest"
    networks:
      default:
        aliases:
         - scrape.me.prometheus

And add prometheus to the network docker-compose made for my app....

docker network connect myapp_default prometheus

And, done!

from dockprom.

albertorm95 avatar albertorm95 commented on May 5, 2024 1

Hello, I have a question, I have multiple services from the same web application but each is a different environments, I'm using this config:

  - job_name: 'app'
    metrics_path: /services/app/metrics
    scheme: https
    scrape_interval:  5s
    tls_config:
      insecure_skip_verify: true
    dns_sd_configs:
    - names:
      - 'tasks.app'
      type: 'A'
      port: 443

How can I get like a Swarm Service Label || Container Label || Task Label in order to differentiate each task?

from dockprom.

stefanprodan avatar stefanprodan commented on May 5, 2024

Your config is similar to what I've used for Docker Swarm in this project swarmprom.

How will you differentiate the services since the job name will be the same for all? The containers IPs will change after each deploy.

from dockprom.

elliots avatar elliots commented on May 5, 2024

Hmm. I... don't know. Something fun to play with next.

from dockprom.

stefanprodan avatar stefanprodan commented on May 5, 2024

My approche was this https://github.com/stefanprodan/swarmprom#monitoring-applications-and-backend-services

from dockprom.

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.