Coder Social home page Coder Social logo

discovery's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

discovery's Issues

Cli panics when config file is not readable

The following happens if a config file is not readable:

discovery --help
panic: ~/.config/discovery/config.yaml: open /home/user/.config/discovery/config.yaml: permission denied

goroutine 1 [running]:
github.com/alecthomas/kong.Parse(0xacf6c0, 0xc000260000, 0xc000184b00, 0x8, 0x8, 0x22)
        /home/rz/golang/pkg/mod/github.com/alecthomas/[email protected]/global.go:11 +0x145
main.main()

Created upstream pull request: alecthomas/kong#163

[exporter] create directories on startup

Otherwise prometheus is not happy:

Mar 15 16:37:53 example.com  prometheus[54858]: level=error ts=2021-03-15T15:37:53.780Z caller=file.go:237 component="discovery manager scrape" discovery=file msg="Error adding file watch" path=/appl/prometheus/service-discovery/p1-example.com/systemd err="no such file or directory"

Option "--selector-filter" does not work for command "service list"

The option "--selector-filter" does not work as the match is executed against labels and not against the selector field of the service:

// ServiceBySelector filters Services by Selector.
func ServiceBySelector(selector labels.Selector) FilterFunc {
	return func(s Service) bool {
                return selector.Matches(s.Labels)
	}
}

Exporter Directory Structure

<configured-directory>/servers/<servername>/<namespace>/default/<jobname>.json
<configured-directory>/servers/<servername>/<namespace>/blackbox/<jobname>.json

Für prometheus mit namen p1-prom-alsu001.pnet.ch gibt es dann folgende Konfig:

scrape_configs:
  - job_name: 'default'
    scrape_interval: 15s
    file_sd_configs:
      - files: ['/appl/prometheus/etc/service-discovery/p1-prom-alsu001.pnet.ch/default/*']
  - job_name: 'k8s_kubelet'
    scrape_interval: 15s
    file_sd_configs:
      - files: ['/appl/prometheus/etc/service-discovery/p1-prom-alsu001.pnet.ch/blackbox/*']

Es gibt zwei Registrierungsarten:

  • default
  • blackbox

Feature: distribute endpoints based on samples count

example situation: 2 prometheus instances promA and promB, 4 endpoints. Endpoints A, B and C have 400 samples, while endpoint D has 3'000.

Currently, endpoints will be distributed to something like this:

promA: A + B = 800 samples
promB: C + D = 3'400 samples

ideally, endpoints will be distributed to better distribute samples instead of endpoints...

promA: A + B + C = 1'200 samples
promB: D = 3'000 samples

...or a reasonable mix thereof

Writer

  • ratelimiter on write
  • wenn limit erreicht in writeChan channel schreiben und write ignorieren
  • atomic pending write setzen
  • lesen von pendingWrite und rate.Wait ausführen -> wenn erreicht: write
  • atomic pending write entfernen

[exporter] logs 'not found' errors

When a service is unregistered, the exporter logs the following error:

2021-05-18T10:43:37.913+0200        ERROR        exporter/exporter.go:188        failed to delete service        {"namespace": "systemd", "id": "190196c8-5ba9-5a4c-a6db-8a017d88180b", "err": "not found"

for services which the exporter is not configured for. This error occurs, when the exporter wants to delete a service form its cache. But since the exporter only caches services it one prometheus server, this service never existed in this cache.

Trim leading space from labels

Trim leading (and trailing?) spaces from labels while registering (or correctly tokenize input).

E.g. following register command has a label ("label2") which has a leading space after registering with prometheus:

discovery service register -e http://example.com/metrics example --labels=label1=value1, label2=value2

Scraping in Prometheus won't work and logs the following error:

Apr 20 11:11:40 foobar prometheus[536382]: level=error ts=2021-04-20T09:11:40.078Z caller=file.go:344 component="discovery manager scrape" discovery=file msg="Error reading file" path=/appl/prometheus/service-discovery/foobar/appl/MY_APP.json err="\" label2\" is not a valid label name"

Maybe, the same issue also applies to label values.

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.