Skip to content

regression in service telemetry metrics configuration #12254

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

Closed
codeboten opened this issue Feb 3, 2025 · 1 comment · Fixed by #12258
Closed

regression in service telemetry metrics configuration #12254

codeboten opened this issue Feb 3, 2025 · 1 comment · Fixed by #12258
Assignees
Labels
release:blocker The issue must be resolved before cutting the next release

Comments

@codeboten
Copy link
Contributor

The following configuration causes errors in the current version in main:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: localhost:5317
      http:
        endpoint: localhost:5318

exporters:
  debug:
    verbosity: detailed

service:
  telemetry:
    metrics:
      level: detailed
      readers:
        - periodic:
            interval: 10000
            exporter:
              otlp:
                protocol: http/protobuf
                endpoint: localhost:4318
  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [debug]

With this config, if I wait a few seconds, I get this error message (no need to send any telemetry):

2025/02/03 10:13:45 failed to upload metrics: Post "https:///v1/metrics": http: no Host in request URL

Originally posted by @mx-psi in #12252 (comment)

@codeboten codeboten added the release:blocker The issue must be resolved before cutting the next release label Feb 3, 2025
@codeboten
Copy link
Contributor Author

The issue is that the following code is no longer present in the configuration code:

func normalizeEndpoint(endpoint string) string {
	if !strings.HasPrefix(endpoint, "https://") && !strings.HasPrefix(endpoint, "http://") {
		return "http://" + endpoint
	}
	return endpoint
}

This is causing the URL (localhost:4318) to be parsed incorrectly.

@codeboten codeboten self-assigned this Feb 3, 2025
codeboten added a commit to codeboten/opentelemetry-collector that referenced this issue Feb 3, 2025
Users can enter the OTLP endpoint w/o a scheme in the prefix. This causes
issues with the URL parsing code in the config package.

Fixes open-telemetry#12254

Signed-off-by: Alex Boten <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Feb 3, 2025
#### Description

Users can enter the OTLP endpoint w/o a scheme in the prefix. This
causes issues with the URL parsing code in the config package.

Fixes
#12254

---------

Signed-off-by: Alex Boten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:blocker The issue must be resolved before cutting the next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant