Skip to content

Commit a2f2a30

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

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
@@ -3299,6 +3299,10 @@ otlp:
32993299
# EXPERIMENTAL: If true, delta temporality otlp metrics to be ingested.
33003300
# CLI flag: -distributor.otlp.allow-delta-temporality
33013301
[allow_delta_temporality: <boolean> | default = false]
3302+
3303+
# Deprecated: Use `-distributor.enable-type-and-unit-labels` flag instead.
3304+
# CLI flag: -distributor.otlp.enable-type-and-unit-labels
3305+
[enable_type_and_unit_labels: <boolean> | default = false]
33023306
```
33033307
33043308
### `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
@@ -3861,6 +3861,12 @@
38613861
"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)",
38623862
"type": "boolean",
38633863
"x-cli-flag": "distributor.otlp.disable-target-info"
3864+
},
3865+
"enable_type_and_unit_labels": {
3866+
"default": false,
3867+
"description": "Deprecated: Use `-distributor.enable-type-and-unit-labels` flag instead.",
3868+
"type": "boolean",
3869+
"x-cli-flag": "distributor.otlp.enable-type-and-unit-labels"
38643870
}
38653871
},
38663872
"type": "object"

0 commit comments

Comments
 (0)