Skip to content
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

Add ability to pass MeterProvider, TraceProvider to otelcol.CollectorSettings #6888

Closed
rfratto opened this issue Jan 4, 2023 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@rfratto
Copy link

rfratto commented Jan 4, 2023

grafana/agent imports OpenTelemetry Collector as a library, where it's possible to spawn many OpenTelemetry Collectors in-memory from the same process.

Previously, this was done through a fork of OpenTelemetry Collector which exported all internal packages. As of v0.67.0, the internal APIs we were previously using were made completely internal (e.g., no longer exposed even at the package level), so we have to migrate to using the public APIs.

As far as I can tell, the only thing we're missing is the ability to pass a custom MeterProvider and TraceProvider to the otelcol package (which would eventually get propagated to service.Service). We need to pass custom MeterProviders and TraceProviders to be able to distinguish which in-memory OpenTelemetry Collector component metrics are coming from.

Would adding this capability be accepted so we can upgrade to the latest release?

// CollectorSettings holds configuration for creating a new Collector.
type CollectorSettings struct {
// Factories service factories.
Factories Factories
// BuildInfo provides collector start information.
BuildInfo component.BuildInfo
// DisableGracefulShutdown disables the automatic graceful shutdown
// of the collector on SIGINT or SIGTERM.
// Users who want to handle signals themselves can disable this behavior
// and manually handle the signals to shutdown the collector.
DisableGracefulShutdown bool
// ConfigProvider provides the service configuration.
// If the provider watches for configuration change, collector may reload the new configuration upon changes.
ConfigProvider ConfigProvider
// LoggingOptions provides a way to change behavior of zap logging.
LoggingOptions []zap.Option
// SkipSettingGRPCLogger avoids setting the grpc logger
SkipSettingGRPCLogger bool
}

@mx-psi
Copy link
Member

mx-psi commented Jan 4, 2023

I think this is a duplicate of #4970. There was some work by @bogdandrutu on this and (I think!) the end goal is to have the pipelines from https://github.com/open-telemetry/opentelemetry-collector/blob/v0.68.0/service/pipelines.go be exposed for this kind of use case.

@jpkrohling jpkrohling added the enhancement New feature or request label Jan 11, 2023
@rfratto
Copy link
Author

rfratto commented Jan 18, 2023

Thanks! I'll close this in favor of #4970 and keep an eye on that.

@rfratto rfratto closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants