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

Promtail: Remove promtail_log_entries_bytes_bucket histogram #5377

Merged
merged 1 commit into from
Feb 17, 2022
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
16 changes: 4 additions & 12 deletions clients/pkg/promtail/targets/file/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -69,7 +62,6 @@ func NewMetrics(reg prometheus.Registerer) *Metrics {
m.totalBytes,
m.readLines,
m.filesActive,
m.logLengthHistogram,
m.failedTargets,
m.targetsActive,
)
Expand Down
2 changes: 0 additions & 2 deletions clients/pkg/promtail/targets/file/tailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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)
}
1 change: 0 additions & 1 deletion docs/sources/operations/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
8 changes: 8 additions & 0 deletions docs/sources/upgrading/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,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.
Expand Down