remove promtail_log_entries_bytes_bucket (#5377)

Signed-off-by: Edward Welch <edward.welch@grafana.com>
pull/5429/head
Ed Welch 4 years ago committed by GitHub
parent 776d5c41c7
commit 91b0bcf36a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      clients/pkg/promtail/targets/file/metrics.go
  2. 2
      clients/pkg/promtail/targets/file/tailer.go
  3. 1
      docs/sources/operations/observability.md
  4. 8
      docs/sources/upgrading/_index.md

@ -8,11 +8,10 @@ type Metrics struct {
reg prometheus.Registerer
// File-specific metrics
readBytes *prometheus.GaugeVec
totalBytes *prometheus.GaugeVec
readLines *prometheus.CounterVec
filesActive prometheus.Gauge
logLengthHistogram *prometheus.HistogramVec
readBytes *prometheus.GaugeVec
totalBytes *prometheus.GaugeVec
readLines *prometheus.CounterVec
filesActive prometheus.Gauge
// Manager metrics
failedTargets *prometheus.CounterVec
@ -45,12 +44,6 @@ func NewMetrics(reg prometheus.Registerer) *Metrics {
Name: "files_active_total",
Help: "Number of active files.",
})
m.logLengthHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "promtail",
Name: "log_entries_bytes",
Help: "the total count of bytes",
Buckets: prometheus.ExponentialBuckets(16, 2, 8),
}, []string{"path"})
m.failedTargets = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: "promtail",
@ -69,7 +62,6 @@ func NewMetrics(reg prometheus.Registerer) *Metrics {
m.totalBytes,
m.readLines,
m.filesActive,
m.logLengthHistogram,
m.failedTargets,
m.targetsActive,
)

@ -150,7 +150,6 @@ func (t *tailer) readLines() {
}
t.metrics.readLines.WithLabelValues(t.path).Inc()
t.metrics.logLengthHistogram.WithLabelValues(t.path).Observe(float64(len(line.Text)))
entries <- api.Entry{
Labels: model.LabelSet{},
Entry: logproto.Entry{
@ -225,5 +224,4 @@ func (t *tailer) cleanupMetrics() {
t.metrics.readLines.DeleteLabelValues(t.path)
t.metrics.readBytes.DeleteLabelValues(t.path)
t.metrics.totalBytes.DeleteLabelValues(t.path)
t.metrics.logLengthHistogram.DeleteLabelValues(t.path)
}

@ -60,7 +60,6 @@ Promtail exposes these metrics:
| `promtail_encoded_bytes_total` | Counter | Number of bytes encoded and ready to send. |
| `promtail_file_bytes_total` | Gauge | Number of bytes read from files. |
| `promtail_files_active_total` | Gauge | Number of active files. |
| `promtail_log_entries_bytes` | Histogram | The total count of bytes read. |
| `promtail_request_duration_seconds_count` | Histogram | Number of send requests. |
| `promtail_sent_bytes_total` | Counter | Number of bytes sent. |
| `promtail_sent_entries_total` | Counter | Number of log entries sent to the ingester. |

@ -116,6 +116,14 @@ The response body has the following schema:
e.g. if you previously used `__project_id` then you'll need to update your relabel config to use `__gcp_resource_labels_project_id`.
- `resource_type` has been moved to `__gcp_resource_type`
#### `promtail_log_entries_bytes_bucket` histogram has been removed.
This histogram reports the distribution of log line sizes by file. It has 8 buckets for every file being tailed.
This creates a lot of series and we don't think this metric has enough value to offset the amount of series genereated so we are removing it.
While this isn't a direct replacement, two metrics we find more useful are size and line counters configured via pipeline stages, an example of how to configure these metrics can be found in the [metrics pipeline stage docs](https://grafana.com/docs/loki/latest/clients/promtail/stages/metrics/#counter)
## 2.4.0
The following are important changes which should be reviewed and understood prior to upgrading Loki.

Loading…
Cancel
Save