You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(loki.secretfilter): Remove redundant secrets_redacted_by_rule_total and secrets_redacted_by_origin metrics (#5970)
The `loki_secretfilter_secrets_redacted_by_category_total` metric (introduced in #5855) partitions by both `rule` and `origin`, making the two single-dimension metrics redundant. Any query with them can be expressed via `sum by (rule|origin) (...)` on the category metric.
Copy file name to clipboardExpand all lines: docs/sources/reference/components/loki/loki.secretfilter.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ You can use the following arguments with `loki.secretfilter`:
52
52
|`drop_on_timeout`|`bool`| When true, drop entries that exceed `processing_timeout` instead of forwarding them unredacted. |`false`| no |
53
53
|`gitleaks_config`|`string`| Path to a custom Gitleaks TOML config file. If empty, the default Gitleaks config is used. |`""`| no |
54
54
|`label_timed_out`|`bool`| When true, adds `secretfilter="timed-out"` to entries forwarded after a processing timeout. |`false`| no |
55
-
|`origin_label`|`string`| Loki label to use as the `origin` dimension in `secrets_redacted_by_origin` and `secrets_redacted_by_category_total`. If empty, `secrets_redacted_by_origin` is not registered and the `origin` label on `secrets_redacted_by_category_total` is set to `""`.|`""`| no |
55
+
|`origin_label`|`string`| Loki label to use as the `origin` dimension in `secrets_redacted_by_category_total`. |`""`| no |
56
56
|`processing_timeout`|`duration`| Maximum time allowed to process a single log entry. `0` disables the timeout. |`0`| no |
57
57
|`rate`|`float`| Entry sampling rate in `[0.0, 1.0]` where `1` processes all entries. Unsampled entries are forwarded unchanged. |`1.0`| no |
58
58
|`redact_percent`|`uint`| When `redact_with` is not set: percent of the secret to redact (1–100), where 100 is full redaction. |`80`| no |
@@ -67,7 +67,7 @@ The default configuration may change between {{< param "PRODUCT_NAME" >}} versio
67
67
For consistent behavior, use an external configuration file via `gitleaks_config`.
68
68
{{< /admonition >}}
69
69
70
-
If you leave `origin_label` empty, the component doesn't register `secrets_redacted_by_origin` and sets the origin label on `secrets_redacted_by_category_total` to `""`.
70
+
If you leave `origin_label` empty, the component sets the origin label on `secrets_redacted_by_category_total` to `""`.
71
71
72
72
**Redaction behavior:**
73
73
@@ -84,9 +84,9 @@ Entries that {{< param "PRODUCT_NAME" >}} does not select based on the sampling
84
84
Use a value below `1.0`, for example, `0.1` for 10%, to reduce CPU usage when processing high-volume logs.
85
85
Monitor `loki_secretfilter_entries_bypassed_total` to observe how many entries were skipped.
86
86
87
-
**Origin metric:** The `origin_label` argument specifies the Loki label the component uses as the origin dimension in the `secrets_redacted_by_origin` and `secrets_redacted_by_category_total` metrics.
87
+
**Origin metric:** The `origin_label` argument specifies the Loki label the component uses as the origin dimension in `secrets_redacted_by_category_total`.
88
88
You can track how many secrets were redacted per source or environment.
89
-
When `origin_label` isn’t set, the component doesn’t register `secrets_redacted_by_origin`, and the `origin` label on `secrets_redacted_by_category_total` defaults to an empty string.
89
+
When `origin_label` isn’t set, the `origin` label on `secrets_redacted_by_category_total` defaults to an empty string.
90
90
91
91
**Processing timeout:** The `processing_timeout` argument sets a maximum duration for processing each log entry.
92
92
When the timeout is exceeded, the `loki_secretfilter_lines_timed_out_total` metric is incremented.
@@ -133,8 +133,6 @@ The following fields are exported and can be referenced by other components:
133
133
|`loki_secretfilter_lines_timed_out_total`| Counter | Total number of log lines that exceeded the processing timeout, whether dropped or forwarded. |
134
134
|`loki_secretfilter_processing_duration_seconds`| Summary | Time taken to process and redact logs, in seconds. |
135
135
|`loki_secretfilter_secrets_redacted_total`| Counter | Total number of secrets redacted. |
136
-
|`loki_secretfilter_secrets_redacted_by_rule_total`| Counter | Number of secrets redacted, partitioned by rule name. |
137
-
|`loki_secretfilter_secrets_redacted_by_origin`| Counter | Number of secrets redacted, partitioned by origin label, when `origin_label` is set. |
138
136
|`loki_secretfilter_secrets_redacted_by_category_total`| Counter | Number of secrets redacted, partitioned by rule name and origin label value. The `origin` label is empty when `origin_label` is not set or the label is absent on the entry. |
Copy file name to clipboardExpand all lines: internal/component/loki/secretfilter/secretfilter.go
+3-31Lines changed: 3 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -120,8 +120,6 @@ type secretDetector interface {
120
120
// Metrics exposed by this component:
121
121
//
122
122
// - loki_secretfilter_secrets_redacted_total: Total number of secrets that have been redacted.
123
-
// - loki_secretfilter_secrets_redacted_by_rule_total: Number of secrets redacted, partitioned by rule name.
124
-
// - loki_secretfilter_secrets_redacted_by_origin: Number of secrets redacted, partitioned by origin label value (only registered when origin_label is set).
125
123
// - loki_secretfilter_secrets_redacted_by_category_total: Number of secrets redacted, partitioned by rule name and origin label value.
126
124
// - loki_secretfilter_processing_duration_seconds: Summary of time taken to process and redact log entries.
127
125
// - loki_secretfilter_entries_bypassed_total: Total number of entries forwarded without processing due to sampling.
@@ -132,12 +130,6 @@ type metrics struct {
132
130
// Total number of secrets redacted
133
131
secretsRedactedTotal prometheus.Counter
134
132
135
-
// Number of secrets redacted by rule type
136
-
secretsRedactedByRule*prometheus.CounterVec
137
-
138
-
// Number of secrets redacted by specified labels
139
-
secretsRedactedByOrigin*prometheus.CounterVec
140
-
141
133
// Number of secrets redacted by rule and origin (combined)
142
134
secretsRedactedByCategory*prometheus.CounterVec
143
135
@@ -155,7 +147,7 @@ type metrics struct {
155
147
}
156
148
157
149
// newMetrics creates a new set of metrics for the secretfilter component.
0 commit comments