-
Notifications
You must be signed in to change notification settings - Fork 812
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
Change otlp attribute conversion to be consistent with prometheus #6272
Change otlp attribute conversion to be consistent with prometheus #6272
Conversation
a42d813
to
633baf5
Compare
@yeya24 |
CHANGELOG.md
Outdated
@@ -9,6 +9,7 @@ | |||
* [FEATURE] Ruler: Minimize chances of missed rule group evaluations that can occur due to OOM kills, bad underlying nodes, or due to an unhealthy ruler that appears in the ring as healthy. This feature is enabled via `-ruler.enable-ha-evaluation` flag. #6129 | |||
* [FEATURE] Store Gateway: Add an in-memory chunk cache. #6245 | |||
* [FEATURE] Chunk Cache: Support multi level cache and add metrics. #6249 | |||
* [ENHANCEMENT] OTLP: Change otlp handler to consist with the Prometheus otlp handler. #6272 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be more specific about the change. I can see 3 main changes:
- By default we don't convert all attributes to labels. This is a change
- Target info will be behind a FF. Enabled by default.
- New config to specify
promote_resource_attributes
per tenant
@yeya24 |
I think it needs to be consistent with the disable convert all attributes flag. If that flag is not per tenant then target info shouldn't be per tenant. If our intended behavior is to be consistent with Prometheus then I think it makes more sense to be global and not per tenant. Only resource attribute promotion is per tenant and it should be only valid if all attributes conversion is disabled |
77f9e92
to
878f14e
Compare
3bc34b2
to
0230822
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I like the implementation. Thanks for updating the tests!
Just some nits.
pkg/distributor/distributor.go
Outdated
@@ -188,6 +196,9 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) { | |||
|
|||
f.Float64Var(&cfg.InstanceLimits.MaxIngestionRate, "distributor.instance-limits.max-ingestion-rate", 0, "Max ingestion rate (samples/sec) that this distributor will accept. This limit is per-distributor, not per-tenant. Additional push requests will be rejected. Current ingestion rate is computed as exponentially weighted moving average, updated every second. 0 = unlimited.") | |||
f.IntVar(&cfg.InstanceLimits.MaxInflightPushRequests, "distributor.instance-limits.max-inflight-push-requests", 0, "Max inflight push requests that this distributor can handle. This limit is per-distributor, not per-tenant. Additional requests will be rejected. 0 = unlimited.") | |||
|
|||
f.BoolVar(&cfg.OTLPConfig.ConvertAllAttributes, "distributor.otlp-config.convert-all-attributes", false, "If enabled, all resource attributes are converted to labels.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just simplify the flag name to be distributor.otlp.xxx
?
pkg/distributor/distributor.go
Outdated
@@ -188,6 +196,9 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) { | |||
|
|||
f.Float64Var(&cfg.InstanceLimits.MaxIngestionRate, "distributor.instance-limits.max-ingestion-rate", 0, "Max ingestion rate (samples/sec) that this distributor will accept. This limit is per-distributor, not per-tenant. Additional push requests will be rejected. Current ingestion rate is computed as exponentially weighted moving average, updated every second. 0 = unlimited.") | |||
f.IntVar(&cfg.InstanceLimits.MaxInflightPushRequests, "distributor.instance-limits.max-inflight-push-requests", 0, "Max inflight push requests that this distributor can handle. This limit is per-distributor, not per-tenant. Additional requests will be rejected. 0 = unlimited.") | |||
|
|||
f.BoolVar(&cfg.OTLPConfig.ConvertAllAttributes, "distributor.otlp-config.convert-all-attributes", false, "If enabled, all resource attributes are converted to labels.") | |||
f.BoolVar(&cfg.OTLPConfig.DisableTargetInfo, "distributor.otlp-config.disable-target-info", false, "If enabled, a target_info metric is not ingested.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about If true, target_info metric is not ingested.
?
If enabled
might be a bit confusing to users.
I suggest we describe what target_info
metric does or put some relevant links to Opentelemetry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Adding a link explaining what target_info is would be good.
CHANGELOG.md
Outdated
@@ -12,6 +12,7 @@ | |||
* [ENHANCEMENT] S3 Bucket Client: Add a list objects version configs to configure list api object version. #6280 | |||
* [ENHANCEMENT] Query Frontend: Add new query stats metrics `cortex_query_samples_scanned_total` and `cortex_query_peak_samples` to track scannedSamples and peakSample per user. #6228 | |||
* [ENHANCEMENT] Ingester: Disable chunk trimming. #6270 | |||
* [ENHANCEMENT] OTLP: Change otlp handler to consist with the Prometheus otlp handler. Enable `target_info` metric and disable convert all attributes to labels by default. Add a config to specify promote resource attributes for tenants. #6272 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a change instead of an enhancement.
0230822
to
2942e00
Compare
@yeya24 |
6f53a03
to
c04f607
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment about changelog. We can merge this after!
18dad00
to
4f43226
Compare
Signed-off-by: SungJin1212 <[email protected]>
4f43226
to
fcd9f51
Compare
…rtexproject#6272) Signed-off-by: SungJin1212 <[email protected]>
Change otlp handler to consist with the prometheus otlp handler.
Changes are as follows:
target_info
metric by default, it is only disabled whendistributor.otlp-config.disable-target-info
istrue
.-distributor.otlp-config.convert-all-attributes
flag to retain the existing behavior (always convert all metric attributes)distributor.promote-resource-attributes
to specify promte resource attributes for each tenants. It works only ifdistributor.otlp-config.convert-all-attributes
isfalse
.Which issue(s) this PR fixes:
Fixes #6236
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]