prometheus_exporter 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c77ede3528c6008266620498f698c8a0e9e17bfa0c0691fedf5a3c4c3bdb8ebd
4
- data.tar.gz: 62f8b159f68036f05b785fea4eebef48df66606b083136eda5c37e4d3c294132
3
+ metadata.gz: 4855e62023cc91a24d7f604765a4c34c3cc652421e2f60d6041b8b87376dd74f
4
+ data.tar.gz: 9772f78ab97d6ae4218afefc353660f1c162df5c801aca60f326e0eeda1894c9
5
5
  SHA512:
6
- metadata.gz: 2c0699014753102b514f1bd6fa965cd82f6d83c34084daf4a3b07537b9224295a1df02aedce3082588e44f4c001e71ea83178456bd7efd8a8eae836b2fc6e9a7
7
- data.tar.gz: df738517c22422ba9e4e2e7cfd6ea6bbcf7542175a827b1632e7ff69af4651d4acf45bcec9693c4dd899b9b305b952fac989999ebea23013f3ddad0d3c396e00
6
+ metadata.gz: 2e1450823b8b770a2538891a4315451e5be4dbe6bc3ffe77ba0b0081c6f436b5a2cfe189c4e4c77442bad72180f0ba6144c074378b55c266d5e6c33b4aa40f42
7
+ data.tar.gz: 62457c9bdfaedfc02acbdfd0e472790a4ba5b5c124778f8f58173fc0b98f442d7d23e71fd16345334fe71778e46096559e7c2ae32c94255f155abb0dc3a92619
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.5.1 - 25-02-2019
2
+
3
+ - FEATURE: Allow configuring the default client's host and port via environment variables
4
+
1
5
  0.5.0 - 14-02-2019
2
6
 
3
7
  - Breaking change: listen only to localhost by default to prevent unintended insecure configuration
data/README.md CHANGED
@@ -24,6 +24,7 @@ To learn more see [Instrumenting Rails with Prometheus](https://samsaffron.com/a
24
24
  * [GraphQL support](#graphql-support)
25
25
  * [Metrics default prefix / labels](#metrics-default-prefix--labels)
26
26
  * [Client default labels](#client-default-labels)
27
+ * [Client default host](#client-default-host)
27
28
  * [Transport concerns](#transport-concerns)
28
29
  * [JSON generation and parsing](#json-generation-and-parsing)
29
30
  * [Contributing](#contributing)
@@ -195,7 +196,7 @@ This collects activerecord connection pool metrics.
195
196
 
196
197
  It supports injection of custom labels and the connection config options (`username`, `database`, `host`, `port`) as labels.
197
198
 
198
- For Puma single mode
199
+ For Puma single mode
199
200
  ```ruby
200
201
  #in puma.rb
201
202
  require 'prometheus_exporter/instrumentation'
@@ -560,6 +561,9 @@ Will result in:
560
561
  http_requests_total{controller="home","action"="index",service="app-server-01",app_name="app-01"} 2
561
562
  http_requests_total{service="app-server-01",app_name="app-01"} 1
562
563
  ```
564
+ ### Client default host
565
+
566
+ By default, `PrometheusExporter::Client.default` connects to `localhost:9394`. If your setup requires this (e.g. when using `docker-compose`), you can change the default host and port by setting the environment variables `PROMETHEUS_EXPORTER_HOST` and `PROMETHEUS_EXPORTER_PORT`.
563
567
 
564
568
  ## Transport concerns
565
569
 
@@ -53,7 +53,14 @@ module PrometheusExporter
53
53
  MAX_SOCKET_AGE = 25
54
54
  MAX_QUEUE_SIZE = 10_000
55
55
 
56
- def initialize(host: 'localhost', port: PrometheusExporter::DEFAULT_PORT, max_queue_size: nil, thread_sleep: 0.5, json_serializer: nil, custom_labels: nil)
56
+ def initialize(
57
+ host: ENV.fetch('PROMETHEUS_EXPORTER_HOST', 'localhost'),
58
+ port: ENV.fetch('PROMETHEUS_EXPORTER_PORT', PrometheusExporter::DEFAULT_PORT),
59
+ max_queue_size: nil,
60
+ thread_sleep: 0.5,
61
+ json_serializer: nil,
62
+ custom_labels: nil
63
+ )
57
64
  @metrics = []
58
65
 
59
66
  @queue = Queue.new
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrometheusExporter
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus_exporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-14 00:00:00.000000000 Z
11
+ date: 2020-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop