cortex icon indicating copy to clipboard operation
cortex copied to clipboard

Change otlp attribute conversion to consist with prometheus

Open SungJin1212 opened this issue 1 year ago • 3 comments

Change otlp handler to consist with the prometheus otlp handler.

Changes are as follows:

  • Enable target_info metric
  • Add -distributor.otlp-config.convert-all-attributes flag to retain the existing behavior (always convert all metric attributes)
  • Add -distributor.otlp-config.promote-resource-attributes flag to selectly convert resource attributes to Prometheus labels

Which issue(s) this PR fixes: Fixes #6236

Checklist

  • [x] Tests updated
  • [ ] Documentation added
  • [x] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

SungJin1212 avatar Oct 16 '24 07:10 SungJin1212

@yeya24 Could you review it when you time have?

SungJin1212 avatar Oct 18 '24 02:10 SungJin1212

@yeya24 Thanks for the review. Doesn't the DisableTargetInfo flag need to be set per user?

SungJin1212 avatar Oct 20 '24 00:10 SungJin1212

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

yeya24 avatar Oct 20 '24 02:10 yeya24

@yeya24 Thanks for the review and good comments. I have applied your comments.

SungJin1212 avatar Nov 04 '24 09:11 SungJin1212