Skip to content

Commit

Permalink
Documentation streamlining (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed May 5, 2020
1 parent 2f66bb4 commit f60622c
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ These metrics are exported:
Additional labels can be configured in the configuration file (see below).
<namespace> can be ommited or overrided - see <<Namespace-as-labels>>
`<namespace>` can be omitted or overridden - see <<Namespace-as-labels>> for
more information.
== Configuration file
Expand Down Expand Up @@ -272,8 +273,9 @@ namespace "app1" {
"/var/log/nginx/app1/access.log"
]
}
#metrics_override = { prefix = "myprefix" }
#namespace_label = "vhost"

# metrics_override = { prefix = "myprefix" }
# namespace_label = "vhost"

labels {
app = "application-one"
Expand Down Expand Up @@ -321,9 +323,9 @@ namespaces:
source:
files:
- /var/log/nginx/app1/access.log
#metrics_override:
# prefix: "myprefix"
#namespace_label: "vhost"
# metrics_override:
# prefix: "myprefix"
# namespace_label: "vhost"
labels:
app: "application-one"
environment: "production"
Expand All @@ -340,7 +342,9 @@ Advanced features
-----------------
### Namespace as labels

It's more convinient to have same metrics across different
For historic reasons, this exporter exports separate metrics for different
namespaces (because the namespace is part of the metric name). However, in many
(most) cases, it's more convenient to have the same metric name across different
namespaces (with different log formats and names).

This can be done in two steps:
Expand Down Expand Up @@ -374,11 +378,12 @@ myprefix_http_response_count_total{vhost="app2", ...}
----

* `prefix` can be set to `""`, resulting metrics like `http_response_count_total{...}`
* `namespace_label` can be ommited - so you have full control on metric format
* `namespace_label` can be omitted - so you have full control on metric format

Some details and history: https://github.com/martin-helmich/prometheus-nginxlog-exporter/issues/13[Issue #13]
Some details and history on this can be found in https://github.com/martin-helmich/prometheus-nginxlog-exporter/issues/13[issue #13].

### Custom labels pass-through

Partial case of <<Dynamic-re-labeling>>:

[source,hcl]
Expand Down

0 comments on commit f60622c

Please sign in to comment.