Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that string fields do not produce prometheus metrics #7644

Merged
merged 2 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions plugins/outputs/prometheus_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
This plugin starts a [Prometheus](https://prometheus.io/) Client, it exposes
all metrics on `/metrics` (default) to be polled by a Prometheus server.

## Configuration
### Configuration

```toml
# Publish all metrics to /metrics for Prometheus to scrape
[[outputs.prometheus_client]]
## Address to listen on.
listen = ":9273"
Expand Down Expand Up @@ -52,3 +51,9 @@ all metrics on `/metrics` (default) to be polled by a Prometheus server.
## Export metric collection time.
# export_timestamp = false
```

### Metrics

Prometheus metrics are produced in the same manner as the [prometheus serializer][].

[prometheus serializer]: /plugins/serializers/prometheus/README.md#Metrics
15 changes: 14 additions & 1 deletion plugins/serializers/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ somewhat, but not fully, mitigated by using outputs that support writing in
"batch format". When using histogram and summary types, it is recommended to
use only the `prometheus_client` output.

## Configuration
### Configuration

```toml
[[outputs.file]]
Expand All @@ -35,6 +35,19 @@ use only the `prometheus_client` output.
data_format = "prometheus"
```

### Metrics

A Prometheus metric is created for each integer, float, boolean or unsigned
field. Boolean values are converted to *1.0* for true and *0.0* for false.

The Prometheus metric names are produced by joining the measurement name with
the field key. In the special case where the measurement name is `prometheus`
it is not included in the final metric name.

Prometheus labels are produced for each tag.

**Note:** String fields are ignored and do not produce Prometheus metrics.

### Example

**Example Input**
Expand Down