-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Renaming metrics with prometheus receiver produces unknown-type metrics #5001
Comments
Given the metadata cache (and prometheus' target metadata endpoint) is intended to be used to attach metadata to samples, I opened an issue with upstream prometheus to see if they are interested in changing the name that is included in metadata. In the mean time, we should probably validate the prometheus configuration to ensure users don't set |
Re-linking open-telemetry/opentelemetry-collector#3410, which is related, and the issue transfer seems to have dropped the link |
Discussed this at the 9/22 meeting: The prometheus server will also produce untyped metrics if you rename the metric, so we aren't necessarily out of compliance for producing untyped metrics when a metric was renamed. Given that, to "fix" this, we just need to:
|
I believe step 1 would be fixed by #4743. |
I don't think we have proper support for untyped metrics right now. There is some discussion here about how best to accomplish that: open-telemetry/prometheus-interoperability-spec#69 |
…emetry#5001) * Remove "Attribute" part from common pdata collections names All of the pdata wrappers for collections include Attribute part in its name because the fields used to be part of the attributes fields only. But it's not the case anymore since `pdata.LogRecord.Body` uses AnyValue that can contain any common collection. This change renames AttributeMap and AttributeValueSlice collections by removing Attribute part from their names and making them consistent. * Change NewMapFromRaw to take interface{} Co-authored-by: Bogdan Drutu <[email protected]>
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
Push, Edit: push again? |
Hi, is any progress? |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
Push |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
@dashpole should we continue to push this or let it go stale? Seems to be low prio. Too bad there is no |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
Bump |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping |
I don't think we can fix the underlying issue. But we can at least not fail when users try and do this. We convert unknown-typed metrics to gauges (without unit or description) today, which is better than failing entirely. |
Pinging code owners for receiver/prometheus: @Aneurysm9 @dashpole. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
…nfigs (#25888) **Description:** Fixes #5001 When that issue was filed, we dropped unknown-typed metrics. Now that we convert them to gauges, users may want to use metric_relabel_configs to rename metrics, even if they lose metadata. In the future, we have other enhancements planned to better-support unknown-typed metrics. Change the error to a warning. It is still likely not a best practice to use relabel configs for this purpose, but for users copy-pasting prometheus configs, it is best not to fail if we can help it.
…nfigs (open-telemetry#25888) **Description:** Fixes open-telemetry#5001 When that issue was filed, we dropped unknown-typed metrics. Now that we convert them to gauges, users may want to use metric_relabel_configs to rename metrics, even if they lose metadata. In the future, we have other enhancements planned to better-support unknown-typed metrics. Change the error to a warning. It is still likely not a best practice to use relabel configs for this purpose, but for users copy-pasting prometheus configs, it is best not to fail if we can help it.
…nfigs (open-telemetry#25888) **Description:** Fixes open-telemetry#5001 When that issue was filed, we dropped unknown-typed metrics. Now that we convert them to gauges, users may want to use metric_relabel_configs to rename metrics, even if they lose metadata. In the future, we have other enhancements planned to better-support unknown-typed metrics. Change the error to a warning. It is still likely not a best practice to use relabel configs for this purpose, but for users copy-pasting prometheus configs, it is best not to fail if we can help it.
Describe the bug
If the
__name__
label is changed using prometheus relabel configs, the prometheus receiver fails to populate metric metadata.The root cause is that the prometheus receiver looks up metric metadata using the final metric name. However, the prometheus server updates the metadata cache before applying relabel rules, meaning the metadata cache stores metadata based on the initial metric name. The metadata lookup fails, and it is left empty.
Steps to reproduce
Run a collector with the config below.
The collector produces the logs:
Note the empty Name, Description, Unit, and DataType.
What did you expect to see?
I expected metrics to be renamed, and otherwise emitted normally.
What did you see instead?
Metrics are dropped during conversion from OpenCensus format to OpenTelemetry format because the metric descriptor type is Unknown.
What version did you use?
Version: otel/opentelemetry-collector-contrib-dev@sha256:0dbc61590cc04678997173fb378c875e2733ff2e443d75a7957a340d4b2bb9ef (latest)
What config did you use?
Config: (e.g. the yaml config file)
Additional context
I was able to determine the root cause above by adding additional debug statements and rebuilding the collector.
The text was updated successfully, but these errors were encountered: