@@ -236,7 +236,8 @@ These metrics are exported:
236
236
237
237
Additional labels can be configured in the configuration file (see below).
238
238
239
- <namespace> can be ommited or overrided - see <<Namespace-as-labels>>
239
+ `<namespace>` can be omitted or overridden - see <<Namespace-as-labels>> for
240
+ more information.
240
241
241
242
== Configuration file
242
243
@@ -272,8 +273,9 @@ namespace "app1" {
272
273
"/var/log/nginx/app1/access.log"
273
274
]
274
275
}
275
- #metrics_override = { prefix = "myprefix" }
276
- #namespace_label = "vhost"
276
+
277
+ # metrics_override = { prefix = "myprefix" }
278
+ # namespace_label = "vhost"
277
279
278
280
labels {
279
281
app = "application-one"
@@ -321,9 +323,9 @@ namespaces:
321
323
source:
322
324
files:
323
325
- /var/log/nginx/app1/access.log
324
- #metrics_override:
325
- # prefix: "myprefix"
326
- #namespace_label: "vhost"
326
+ # metrics_override:
327
+ # prefix: "myprefix"
328
+ # namespace_label: "vhost"
327
329
labels:
328
330
app: "application-one"
329
331
environment: "production"
@@ -340,7 +342,9 @@ Advanced features
340
342
-----------------
341
343
### Namespace as labels
342
344
343
- It's more convinient to have same metrics across different
345
+ For historic reasons, this exporter exports separate metrics for different
346
+ namespaces (because the namespace is part of the metric name). However, in many
347
+ (most) cases, it's more convenient to have the same metric name across different
344
348
namespaces (with different log formats and names).
345
349
346
350
This can be done in two steps:
@@ -374,11 +378,12 @@ myprefix_http_response_count_total{vhost="app2", ...}
374
378
----
375
379
376
380
* `prefix` can be set to `""`, resulting metrics like `http_response_count_total{...}`
377
- * `namespace_label` can be ommited - so you have full control on metric format
381
+ * `namespace_label` can be omitted - so you have full control on metric format
378
382
379
- Some details and history: https://github.com/martin-helmich/prometheus-nginxlog-exporter/issues/13[Issue #13]
383
+ Some details and history on this can be found in https://github.com/martin-helmich/prometheus-nginxlog-exporter/issues/13[issue #13].
380
384
381
385
### Custom labels pass-through
386
+
382
387
Partial case of <<Dynamic-re-labeling>>:
383
388
384
389
[source,hcl]
0 commit comments