Skip to content

Commit 4ee94c3

Browse files
committed
keep distributor.otlp.enable-type-and-unit-labels as Deprecated
Signed-off-by: SungJin1212 <[email protected]>
1 parent 3882871 commit 4ee94c3

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

docs/configuration/config-file-reference.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3274,6 +3274,10 @@ otlp:
32743274
# EXPERIMENTAL: If true, delta temporality otlp metrics to be ingested.
32753275
# CLI flag: -distributor.otlp.allow-delta-temporality
32763276
[allow_delta_temporality: <boolean> | default = false]
3277+
3278+
# Deprecated: Use `-distributor.enable-type-and-unit-labels` flag instead.
3279+
# CLI flag: -distributor.otlp.enable-type-and-unit-labels
3280+
[enable_type_and_unit_labels: <boolean> | default = false]
32773281
```
32783282
32793283
### `etcd_config`

docs/configuration/v1-guarantees.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ Currently experimental features are:
116116
- `alertmanager-sharding-ring.final-sleep` (duration) CLI flag
117117
- OTLP Receiver
118118
- Ingest delta temporality OTLP metrics (`-distributor.otlp.allow-delta-temporality=true`)
119-
- Add `__type__` and `__unit__` labels (`-distributor.otlp.enable-type-and-unit-labels`)
120119
- Persistent tokens in the Ruler Ring:
121120
- `-ruler.ring.tokens-file-path` (path) CLI flag
122121
- Native Histograms
@@ -133,3 +132,4 @@ Currently experimental features are:
133132
- `-store-gateway.query-protection.rejection`
134133
- Distributor/Ingester: Stream push connection
135134
- Enable stream push connection between distributor and ingester by setting `-distributor.use-stream-push=true` on Distributor.
135+
- Add `__type__` and `__unit__` labels to OTLP and remote write v2 requests (`-distributor.enable-type-and-unit-labels`)

pkg/distributor/distributor.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,10 @@ type InstanceLimits struct {
197197
}
198198

199199
type OTLPConfig struct {
200-
ConvertAllAttributes bool `yaml:"convert_all_attributes"`
201-
DisableTargetInfo bool `yaml:"disable_target_info"`
202-
AllowDeltaTemporality bool `yaml:"allow_delta_temporality"`
200+
ConvertAllAttributes bool `yaml:"convert_all_attributes"`
201+
DisableTargetInfo bool `yaml:"disable_target_info"`
202+
AllowDeltaTemporality bool `yaml:"allow_delta_temporality"`
203+
EnableTypeAndUnitLabels bool `yaml:"enable_type_and_unit_labels"`
203204
}
204205

205206
// RegisterFlags adds the flags required to config this to the given FlagSet
@@ -228,6 +229,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
228229
f.BoolVar(&cfg.OTLPConfig.ConvertAllAttributes, "distributor.otlp.convert-all-attributes", false, "If true, all resource attributes are converted to labels.")
229230
f.BoolVar(&cfg.OTLPConfig.DisableTargetInfo, "distributor.otlp.disable-target-info", false, "If true, a target_info metric is not ingested. (refer to: https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#supporting-target-metadata-in-both-push-based-and-pull-based-systems)")
230231
f.BoolVar(&cfg.OTLPConfig.AllowDeltaTemporality, "distributor.otlp.allow-delta-temporality", false, "EXPERIMENTAL: If true, delta temporality otlp metrics to be ingested.")
232+
f.BoolVar(&cfg.OTLPConfig.EnableTypeAndUnitLabels, "distributor.otlp.enable-type-and-unit-labels", false, "Deprecated: Use `-distributor.enable-type-and-unit-labels` flag instead.")
231233
}
232234

233235
// Validate config and returns error on failure

schemas/cortex-config-schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,6 +3822,12 @@
38223822
"description": "If true, a target_info metric is not ingested. (refer to: https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#supporting-target-metadata-in-both-push-based-and-pull-based-systems)",
38233823
"type": "boolean",
38243824
"x-cli-flag": "distributor.otlp.disable-target-info"
3825+
},
3826+
"enable_type_and_unit_labels": {
3827+
"default": false,
3828+
"description": "Deprecated: Use `-distributor.enable-type-and-unit-labels` flag instead.",
3829+
"type": "boolean",
3830+
"x-cli-flag": "distributor.otlp.enable-type-and-unit-labels"
38253831
}
38263832
},
38273833
"type": "object"

0 commit comments

Comments
 (0)