Commit graph

28 commits

Author SHA1 Message Date
Kubernetes Prow Robot
b1c2812dc5
Merge pull request #3849 from trnl/master
Use Gauge instead of Counter for connections_active Prometheus metric
2019-03-05 03:09:00 -08:00
Uladzimir Mihura
13d0f0ddab Use Gauge instead of Counter for connections_active Prometheus metric 2019-03-04 22:35:45 +01:00
Thibault Jamet
27a98f2920
Fix race condition in metric process collector test
There was a goroutine started to log things upon a test that could be
ended at the time `cmd.Wait()` ends.

To solve the problem, when the sub-test ends, ensure we wait until the
command ends when ending the test

The output of `make test` before the fix shows:

```
=== RUN   TestNewUDPLogListener
==================
WARNING: DATA RACE
Read at 0x00c0002a8643 by goroutine 74:
  testing.(*common).logDepth()
      /usr/local/go/src/testing/testing.go:629 +0x132
  testing.(*common).Logf()
      /usr/local/go/src/testing/testing.go:614 +0x90
  k8s.io/ingress-nginx/internal/ingress/metric/collectors.TestProcessCollector.func1.1()
      /go/src/k8s.io/ingress-nginx/internal/ingress/metric/collectors/process_test.go:54 +0x140

Previous write at 0x00c0002a8643 by goroutine 72:
  testing.tRunner.func1()
      /usr/local/go/src/testing/testing.go:856 +0x33e
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:869 +0x17f

Goroutine 74 (running) created at:
  k8s.io/ingress-nginx/internal/ingress/metric/collectors.TestProcessCollector.func1()
      /go/src/k8s.io/ingress-nginx/internal/ingress/metric/collectors/process_test.go:50 +0x218
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:865 +0x163

Goroutine 72 (finished) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:916 +0x699
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1157 +0xa8
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:865 +0x163
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1155 +0x523
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:1072 +0x2eb
  main.main()
      _testmain.go:52 +0x222
==================
--- PASS: TestNewUDPLogListener (0.00s)
```

after the patch:

```
=== RUN   TestNewUDPLogListener
--- PASS: TestNewUDPLogListener (0.01s)
```

Change-Id: I8ea246d14f5f80b330be19dd5b8299c6762f6d6b
2019-03-04 21:54:42 +01:00
Manuel Alejandro de Brito Fontes
34b0580225
Replace Status port using a socket 2019-02-06 18:00:10 -03:00
Bryan Boreham
f33a2090dd Add a flag to make per-host metrics optional
When serving many hosts from one nginx, the metrics may become too
numerous for Prometheus.  Add a flag to disable the host label, so
that metrics are totalled across all hosts.
2018-12-21 17:31:54 +00:00
Manuel Alejandro de Brito Fontes
68f344233b Fix lint issues 2018-12-05 13:28:28 -03:00
Manuel Alejandro de Brito Fontes
1fed943b3d Update process-exporter methods 2018-12-05 13:28:10 -03:00
Manuel Alejandro de Brito Fontes
2fa55eabf6 Replace glog with klog 2018-12-05 13:27:55 -03:00
Manuel Alejandro de Brito Fontes
06d33c16b5
Allow to disable NGINX metrics 2018-12-05 10:14:35 -03:00
Elvin Efendi
d8b928f501 remove already unused endpoint metric 2018-11-21 20:05:44 +04:00
Elvin Efendi
068d633e81 fix Status key conflic, fixes https://github.com/kubernetes/ingress-nginx/issues/3451 2018-11-21 20:03:15 +04:00
SataQiu
76aae20b64 fix the typos 2018-11-07 17:53:17 +08:00
mooncake
4b518ec03c Fix some typos
Signed-off-by: mooncake <xcoder@tenxcloud.com>
2018-11-05 22:10:11 +08:00
xichengliudui
ed107a489a Delete some extra words 2018-10-29 02:48:56 -04:00
Manuel de Brito Fontes
5cca38304e Fix tests 2018-09-22 15:09:54 -03:00
Manuel de Brito Fontes
55ccaf4be3 Update prometheus methods 2018-09-22 14:54:11 -03:00
Manuel de Brito Fontes
9766ad8f4b Filter hostnames before creation of metrics 2018-09-22 14:25:57 -03:00
Manuel de Brito Fontes
91ae204f6c Replace standard json encoding with jsoniter 2018-09-22 14:25:01 -03:00
Elvin Efendi
2207d7694d batch metrics and flush periodically 2018-08-18 13:17:21 -04:00
Manuel de Brito Fontes
b148f113ae
Use authbind to bind privileged ports 2018-08-05 11:18:50 -04:00
Manuel de Brito Fontes
5e13de4a65
Delay initial prometheus status metric 2018-07-30 10:24:51 -04:00
Manuel de Brito Fontes
4a316045a8 Fix inconsistent metric labels 2018-07-27 12:41:37 -04:00
Manuel de Brito Fontes
010342aa58 Do not allow invalid latency values in metrics 2018-07-24 10:53:46 -04:00
Manuel de Brito Fontes
4c1e501074 Update prometheus labels 2018-07-16 15:52:17 -04:00
Manuel de Brito Fontes
1542a12764
Refactor controller metrics interface 2018-07-12 12:46:34 -04:00
Manuel de Brito Fontes
6c8647a27d
Remove prometheus labels with high cardinality 2018-06-25 09:43:56 -04:00
Manuel Alejandro de Brito Fontes
c4ec773966
Use a unix socket instead udp for reception of metrics (#2652) 2018-06-17 11:04:03 -04:00
Francisco Mejia
2cd2da7c3f Create UDP collector that listens to UDP messages from monitor.lua and exposes them on /metrics endpoint 2018-06-13 21:31:51 -04:00