Move telemetry initialization logic to service/telemetry
#8170
Labels
area:service
collector-telemetry
healthchecker and other telemetry collection issues
enhancement
New feature or request
priority:p2
Medium
Milestone
Telemetry initialization is currently split between the
service/telemetry
package and theservice
package in thetelemetry.go
package. This causes some issues:telemetry.TracerProvider
method returns a tracer provider that is never used in practice. It is used hereopentelemetry-collector/service/service.go
Line 103 in 3089ea8
opentelemetry-collector/service/service.go
Line 115 in 3089ea8
opentelemetry-collector/service/telemetry.go
Lines 101 to 111 in 3089ea8
telemetry.TracerProvider
. I believe because of this the sampling configuration set onservice/telemetry
is ignored.opentelemetry-collector/service/telemetry/telemetry.go
Lines 47 to 50 in 3089ea8
service/telemetry
, while others are initialized inservice
. In particular, the logger is initialized inservice/telemetry
, the tracer provider can be initialized in both but only theservice
one is used, and the metrics provider is only initialized inservice
.I think we should consolidate telemetry initialization to the
service/telemetry
package and have methods to generate the telemetry providers from config as part of the public API. This would mean adding a new method totelemetry.Telemetry
to handle registration of process metrics, currently done in the service via the telemetry initializeropentelemetry-collector/service/service.go
Lines 210 to 211 in 3089ea8
One challenge here is that
proctelemetry
depends onservice/telemetry
for the generated configuration; if we don't want to expose the OpenCensus registry we need to refactor the current package structure (e.g. by having a newservice/telemetry/config
package).cc @codeboten since this may overlap with the work on #7532
The text was updated successfully, but these errors were encountered: