Change otlp attribute conversion to consist with prometheus
Change otlp handler to consist with the prometheus otlp handler.
Changes are as follows:
- Enable
target_infometric - Add
-distributor.otlp-config.convert-all-attributesflag to retain the existing behavior (always convert all metric attributes) - Add
-distributor.otlp-config.promote-resource-attributesflag to selectly convert resource attributes to Prometheus labels
Which issue(s) this PR fixes: Fixes #6236
Checklist
- [x] Tests updated
- [ ] Documentation added
- [x]
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]
@yeya24 Could you review it when you time have?
@yeya24
Thanks for the review. Doesn't the DisableTargetInfo flag need to be set per user?
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 Thanks for the review and good comments. I have applied your comments.