telbootstrap

package module
v0.0.0-...-2d719dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

README

Helper for telemetry bootstrap

Opinionated config for open telemetry and prometheus, for use in main().

  • traces go to zpages or OTel collector if env is set.
  • prometheus, expvar and otel metrics supported in libraries for metrics

Accessing metrics and traces programmatically

For tests and debug tools it is useful to be able to access local telemetry. Even in regular code it helps to know the current status.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitOTel

func InitOTel(ctx context.Context, serviceName string) (func(), error)

func InitOTelHost

func InitOTelHost()

Should be called only if another main function didn't already initialize this.

func InitTracing

func InitTracing(ctx context.Context, r *resource.Resource) func()

Types

type OTel

type OTel struct {
	Registry *prom.Registry
}

OTel is the struct containing the bootstrapped telemetry This is called from main() to setup the SDKs and providers in a particular way.

func (*OTel) InitProm

func (ot *OTel) InitProm()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL