You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
break: Improve startup time of the prometheus application
This means that by default prometheus won't try to find all loaded
modules implementing a behaviour, as this can be a very expensive
operation (taking many seconds as has been seen in the field). If such
behaviour was desired, it'd require explicitly setting `all_loaded` for
instrumeters and collectors. The default is the most sane behaviour.
Copy file name to clipboardExpand all lines: README.md
+17-19Lines changed: 17 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -182,12 +182,12 @@ Histogram also accepts `buckets` option. Please refer to respective modules docs
182
182
183
183
### Advanced
184
184
185
-
You will need these modules only if you're writing custom collector for app/lib that can't be instrumented directly.
185
+
You will need these modules only if you're writing a custom collector for an app/lib that can't be instrumented directly.
186
186
187
187
-[`prometheus_collector`](https://github.com/deadtrickster/prometheus.erl/blob/master/doc/prometheus_collector.md) - common interface for collectors;
188
188
-[`prometheus_format`](https://github.com/deadtrickster/prometheus.erl/blob/master/doc/prometheus_format.md) - common interface for exposition formats;
189
189
-[`prometheus_model_helpers`](https://github.com/deadtrickster/prometheus.erl/blob/master/doc/prometheus_model_helpers.md) - provides API for working with underlying Prometheus models.
190
-
You'll use that if you want to create custom collector.
190
+
You'll use that if you want to create a custom collector.
191
191
192
192
## Build
193
193
@@ -198,29 +198,27 @@ You'll use that if you want to create custom collector.
198
198
## Configuration
199
199
200
200
Prometheus.erl supports standard Erlang app configuration.
201
-
-`collectors` - List of custom collectors modules to be registered automatically. If undefined list of all modules implementing `prometheus_collector` behaviour will be used.
202
-
-`default_metrics` - List of metrics to be registered during app startup. Metric format: `{Type, Spec}` where `Type` is a metric type (counter, gauge, etc), `Spec` is a list to be passed to `Metric:declare/1`. Deprecated format `{Registry, Metric, Spec}` also supported.
203
-
204
-
Collectors config also supports "alias" option `default`. When used these collectors will be registered:
205
-
<pre>
206
-
prometheus_boolean,
207
-
prometheus_counter,
208
-
prometheus_gauge,
209
-
prometheus_histogram,
210
-
prometheus_mnesia_collector,
211
-
prometheus_summary,
212
-
prometheus_vm_memory_collector,
213
-
prometheus_vm_statistics_collector,
214
-
prometheus_vm_system_info_collector
215
-
</pre>
201
+
-`collectors` - List of custom collectors modules to be registered automatically.
202
+
Can be `all_loaded` in order to find all modules implementing the `prometheus_collector` behaviour.
203
+
Supports an "alias" option `default`, which will append all default collectors implemented in this library.
204
+
If undefined, the default collectors implemented in this library will be used.
205
+
-`instrumenters` - List of custom instrumenter modules to be registered automatically.
206
+
Can be `all_loaded` in order to find all modules implementing the `prometheus_instrumenter` behaviour.
207
+
If undefined, none will be loaded.
208
+
-`default_metrics` - List of metrics to be registered during app startup.
209
+
Metric format: `{Type, Spec}` where `Type` is a metric type (counter, gauge, etc),
210
+
`Spec` is a list to be passed to `Metric:declare/1`.
211
+
Deprecated format `{Registry, Metric, Spec}` also supported.
212
+
216
213
## Collectors & Exporters Conventions
217
214
218
215
### Configuration
219
216
220
217
All 3d-party libraries should be configured via `prometheus` app env.
221
218
222
-
Exproters are responsible for maintianing scrape endpoint.
223
-
Exporters usually tightly coupled with web server and are singletons. They should understand these keys:
219
+
Exporters are responsible for maintaining scrape endpoint.
220
+
Exporters are usually tightly coupled with the web server and are singletons.
221
+
They should understand these keys:
224
222
-`path` - url for scraping;
225
223
-`format` - scrape format as module name i.e. `prometheus_text_format` or `prometheus_protobuf_format`.
226
224
Exporter-specific options should be under `<exporter_name>_exporter` for erlang or `<Exporter_name>Exporter` for Elixir i.e. `PlugsExporter` or `elli_exporter`
0 commit comments