Open chc5 opened 1 month ago
Pinging code owners:
receiver/prometheus: @Aneurysm9 @dashpole
See Adding Labels via Comments if you do not have permissions to add labels yourself.
@mx-psi I haven't been following the configuration work closely enough to answer this. Do you know what prometheus users should do going forward?
I am unable to reproduce, with the original file I get the following errors:
With a fixed file:
The config validates (I get a different error but it's just wrong setup):
@TylerHelmuth could you also take a look? Could this be operator-specific? (Unclear what the environment we are talking about here)
I believe the error that you're seeing could be related to googlecloudexporter not having the right credentials. I've trimmed down the config to only use prometheus receiver along with other basic processors and exporters. I hope this config works for you to reproduce the main error on your end:
After adding the health_check
extension it works fine for me.
I tested this with the following steps (Linux amd64 machine):
❯ curl -L -o contrib0.111.tar.gz https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.111.0/otelcol-contrib_0.111.0_linux_amd64.tar.gz
❯ tar pfx contrib0.111.tar.gz
❯ ./otelcol-contrib --config config.yaml
and it seems to run fine. So again, I think this may be something specific to how you are running your Collector. Are you using the operator?
Component(s)
receiver/prometheus
What happened?
Description
OpenTelemetry collector from v0.105.0 and onwards does not work for my set of configurations that relies on appending the port number to the address to scrape metrics from other Kubernetes pods with Prometheus receiver. It previously works for version 0.104.0 and below, but I saw changes that went in like
confmap.strictlyTypedInput
andconfmap.unifyEnvVarExpansion
that may have caused my set of configurations to be incompatible and it doesn't seem like there's any alternative solution to address this from further research.Steps to Reproduce
Create a prometheus receiver that uses relabel_configs and use match group references in
replacement
substituted by their value. : https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_configFor example, in OpenTelemetry I would set this to
$$1:$$2
to escape environment variable resolution: ReferenceExpected Result
OpenTelemetry collector should continue to support
$$1:$$2
or provide an alternate solution to allow named variables to be passed in like$${__address__}:$${__meta_kubernetes_pod_annotation_prometheus_io_port}
.Actual Result
OpenTelemetry fails to boot up with the following error with
$$1:$$2
:Collector version
v0.104.0 works, but any version higher than 0.104.0 produces this bug.
Environment information
Environment
OS: Compiler(if manually compiled): golang:1.22
OpenTelemetry Collector configuration
Log output
Additional context
https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/env-vars.md#issues-of-current-behavior https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/9984