Documentation ¶
Overview ¶
Package tm enables (or not) Open Telemetry at the package level.
Index ¶
- func Enabled() bool
- func MapVerboseLevel(l VerboseLevel) logrus.Level
- func MapVerboseLevelList(l VerboseLevel) []logrus.Level
- func NewLogger(domain string) *logrus.Entry
- func SetUpLocal(l VerboseLevel)
- func SetUpTelemetry(args OtelProviderArgs)
- func Shutdown(ctx context.Context) error
- type OtelProviderArgs
- type Provider
- type VerboseLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enabled ¶
func Enabled() bool
Enabled indicates that Open Telemetry global provider is enabled at the package level.
func MapVerboseLevel ¶
func MapVerboseLevel(l VerboseLevel) logrus.Level
MapVerboseLevel maps a verbose level to a given logrus.Level
func MapVerboseLevelList ¶
func MapVerboseLevelList(l VerboseLevel) []logrus.Level
MapVerboseLevelLiss maps a verbose level to a given list of logrus.Level that should be enabled.
func SetUpLocal ¶
func SetUpLocal(l VerboseLevel)
Sets up the package to only log locally at a given level. Open Telemetry global provider will not be enabled. You should call this at the very beginning of your program, before instantiating any log.
func SetUpTelemetry ¶
func SetUpTelemetry(args OtelProviderArgs)
Sets up the package telemetry to use a given OpenTelemetry Endpoint. You should call this at the very beginning of your program, before instantiating any log.
Types ¶
type OtelProviderArgs ¶
type OtelProviderArgs struct { // The Collector URL CollectorURL string // The Service Name ServiceName string // Its deployed version ServiceVersion string // Its verbose level for logs Level VerboseLevel // Force a Flush before Shutdown ForceFlushOnShutdown bool }
Arguments needed for Open Telemetry
type Provider ¶
type Provider interface { // Shutdown the telemetry engine Shutdown(context.Context) error // Creates a new logger associated with domain. NewLogger(domain string) *logrus.Entry // Indicates if telemetry is enabled. If not, do not // instrumentalize thrid party libs. Enabled() bool }
A Provider provides Logger in regards to a given telemetry scheme