-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
Description
Component(s)
connector/count
What happened?
Description
running otel collector with this config:
exporters:
debug:
verbosity: basic
prometheus:
endpoint: "0.0.0.0:1234"
connectors:
count:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
cors:
allowed_origins:
- http://*
service:
telemetry:
logs:
level: "info"
pipelines:
traces:
exporters:
- debug
- count
receivers:
- otlp
metrics:
exporters:
- prometheus
receivers:
- count
After sending some spans to this collector. No count metrics are generated from countconnector
I found that the Unmarshal function isn't executed when the collector starts.
opentelemetry-collector-contrib/connector/countconnector/config.go
Lines 150 to 177 in 7bf3615
| func (c *Config) Unmarshal(componentParser *confmap.Conf) error { | |
| if componentParser == nil { | |
| // Nothing to do if there is no config given. | |
| return nil | |
| } | |
| if err := componentParser.Unmarshal(c, confmap.WithIgnoreUnused()); err != nil { | |
| return err | |
| } | |
| if !componentParser.IsSet("spans") { | |
| c.Spans = defaultSpansConfig() | |
| } | |
| if !componentParser.IsSet("spanevents") { | |
| c.SpanEvents = defaultSpanEventsConfig() | |
| } | |
| if !componentParser.IsSet("metrics") { | |
| c.Metrics = defaultMetricsConfig() | |
| } | |
| if !componentParser.IsSet("datapoints") { | |
| c.DataPoints = defaultDataPointsConfig() | |
| } | |
| if !componentParser.IsSet("logs") { | |
| c.Logs = defaultLogsConfig() | |
| } | |
| if !componentParser.IsSet("profiles") { | |
| c.Profiles = defaultProfilesConfig() | |
| } | |
| return nil | |
| } |
Steps to Reproduce
Expected Result
The countconnector works as the doc said:
The
countconnector may be used without any configuration settings. The following table describes the
default behavior of the connector.
Collector version
main
Environment information
Environment
dev
OpenTelemetry Collector configuration
Log output
Additional context
No response
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
kuiperda, schmikei and ucpr