Skip to content

[receivercreator] Annotations discovery adds endpoint by default even if config is provided #40712

Closed
@ChrsMark

Description

@ChrsMark

Component(s)

receiver/receivercreator

Describe the issue you're reporting

Description

Today, the annotations' based discovery adds the endpoint setting by default even if a configuration is provided. This might be problematic if we want to enable scrapers that don't support an endpoint setting.

I suggest we only set the endpoint by default, as a convenience, only if configuration is not provided at all.

Otherwise, scrapers/receivers that don't support the endpoint setting would fail to get started even if users provide a valid configuration for them through hints:

2025-06-13T10:38:56.309Z	error	[email protected]/observerhandler.go:217	failed to start receiver	{"receiver": "customnginx/b9927881-6594-4842-90d2-7f3e38d7fece_80", "error": "decoding failed due to the following error(s):\n\n'' has invalid keys: endpoint"}

Code ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/receivercreator/discovery.go#L184-L186

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions