Coder Social home page Coder Social logo

prometheus-mdns-sd's Introduction

Prometheus mDNS service discovery

Discovers mDNS (a.k.a. ZeroConf, a.k.a. Bonjour) service announcements under _prometheus-http._tcp and _prometheus-https._tcp for ad-hoc discovery of devices on LAN networks.

Install & running

go install github.com/msiebuhr/prometheus-mdns-sd

Run it

prometheus-mdns-sd -out /etc/prometheus/mdns-sd.json

And in prometheus.yml something along these lines:

- job_name: mdns-sd
  scrape_interval: 30s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  file_sd_configs:
  - files:
    - /etc/prometheus/mdns-sd.json
    refresh_interval: 5m

It resolves the raw IP's (the Go DNS resolver doesn't always understand RFC6762/RFC6763's .local names) and captures the port-number and hostname for later re-labeling.

Clients

Manually create service announcement (OS X):

dns-sd -R "My test server with metrics-endpoint" _prometheus-http._tcp. . 9000 path=/metrics

And there's some code for arduino/esp8266.

Related reading

prometheus-mdns-sd's People

Contributors

msiebuhr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

prometheus-mdns-sd's Issues

Client code

Make a client implementation, so it'll be easy to advertise programs to be scraped.

(Bonus feature: Make a CLI program that can advertise any service, possibly as a wrapper: prometheus-mdns-advertise ./my-program-with-metrics).

No LICENSE file

What's the project license? It does not come with a LICENSE file.

Sometimes has double entries

[
	{
		"targets": [
			"192.168.2.22:8080"
		],
		"labels": {
			"__meta_foo": "bar",
			"__metrics_path__": "/other/metrics",
			"__scheme__": "https",
			"instance": "Mortens-MacBook-Pro-2.local"
		}
	},
	{
		"targets": [
			"192.168.2.22:8080"
		],
		"labels": {
			"__meta_foo": "bar",
			"__metrics_path__": "/other/metrics",
			"__scheme__": "https",
			"instance": "Mortens-MacBook-Pro-2.local"
		}
	}
]

With only one publisher running on the network...

Document full setup

Document a full setup

  • Getting the file dumped correctly
  • Setting up Prometheus to listen for changes on that file

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.