otelutils

package
v0.0.0-...-267b159 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 19 Imported by: 12

Documentation

Index

Constants

View Source
const (
	AdminClientTracer       = "admin-client"
	AdminGormTracer         = "admin-gorm"
	AdminServerTracer       = "admin-server"
	BlobstoreClientTracer   = "blobstore-client"
	DataCatalogClientTracer = "datacatalog-client"
	DataCatalogGormTracer   = "datacatalog-gorm"
	DataCatalogServerTracer = "datacatalog-server"
	NebulaPropellerTracer   = "nebulapropeller"
	K8sClientTracer         = "k8s-client"
)

Variables

View Source
var (
	ConfigSection = config.MustRegisterSection(configSectionKey, defaultConfig)
)

Functions

func GetTracerProvider

func GetTracerProvider(serviceName string) rawtrace.TracerProvider

func NewSpan

func NewSpan(ctx context.Context, serviceName string, spanName string) (context.Context, rawtrace.Span)

func RegisterTracerProvider

func RegisterTracerProvider(serviceName string, config *Config) error

func WrapK8sCache

func WrapK8sCache(c cache.Cache) cache.Cache

func WrapK8sClient

func WrapK8sClient(c client.Client) client.Client

Types

type Config

type Config struct {
	ExporterType ExporterType `json:"type" pflag:",Sets the type of exporter to configure [noop/file/jaeger]."`
	FileConfig   FileConfig   `json:"file" pflag:",Configuration for exporting telemetry traces to a file"`
	JaegerConfig JaegerConfig `json:"jaeger" pflag:",Configuration for exporting telemetry traces to a jaeger"`
}

func GetConfig

func GetConfig() *Config

func (Config) GetPFlagSet

func (cfg Config) GetPFlagSet(prefix string) *pflag.FlagSet

GetPFlagSet will return strongly types pflags for all fields in Config and its nested types. The format of the flags is json-name.json-sub-name... etc.

type ExporterType

type ExporterType = string
const (
	NoopExporter   ExporterType = "noop"
	FileExporter   ExporterType = "file"
	JaegerExporter ExporterType = "jaeger"
)

type FileConfig

type FileConfig struct {
	Filename string `json:"filename" pflag:",Filename to store exported telemetry traces"`
}

type JaegerConfig

type JaegerConfig struct {
	Endpoint string `json:"endpoint" pflag:",Endpoint for the jaeger telemtry trace ingestor"`
}

type K8sCacheWrapper

type K8sCacheWrapper struct {
	cache.Cache
}

func (*K8sCacheWrapper) Get

func (*K8sCacheWrapper) List

func (c *K8sCacheWrapper) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error

type K8sClientWrapper

type K8sClientWrapper struct {
	client.Client
	// contains filtered or unexported fields
}

func (*K8sClientWrapper) Create

func (c *K8sClientWrapper) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error

func (*K8sClientWrapper) Delete

func (c *K8sClientWrapper) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error

func (*K8sClientWrapper) DeleteAllOf

func (c *K8sClientWrapper) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

func (*K8sClientWrapper) Get

func (*K8sClientWrapper) List

func (*K8sClientWrapper) Patch

func (c *K8sClientWrapper) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

func (*K8sClientWrapper) Status

func (c *K8sClientWrapper) Status() client.StatusWriter

func (*K8sClientWrapper) Update

func (c *K8sClientWrapper) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error

type K8sStatusWriterWrapper

type K8sStatusWriterWrapper struct {
	client.StatusWriter
}

func (*K8sStatusWriterWrapper) Patch

func (*K8sStatusWriterWrapper) Update

Jump to

Keyboard shortcuts

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