uptrace / opentelemetry-go-extra

OpenTelemetry instrumentations for Go
https://uptrace.dev/get/instrument/
BSD 2-Clause "Simplified" License
314 stars 72 forks source link

Allow set of min log level for otelzap #113

Closed Ecostack closed 12 months ago

Ecostack commented 12 months ago

Hey all,

currently, it is not possible to change the minLevel at https://github.com/uptrace/opentelemetry-go-extra/blob/main/otelzap/otelzap.go#L53. If I were to use Uptrace also as a log collector, I might wanna make use of at least info. Such as it is done in the documentation here https://uptrace.dev/get/instrument/opentelemetry-zap.html#sugared-logger.

Would it make sense to be able to change this field?

vmihailenco commented 12 months ago

Hi,

Perhaps you've missed this option. otelzap.WithMinLevel(zap.WarnLevel) sets the minimal zap logging level on which the log message is recorded on the span.

Ecostack commented 12 months ago

Hey @vmihailenco, thanks, indeed, I totally missed that one. This ticket can be closed!