opentelCore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMeterCount

func AddMeterCount(action, description, unit string, value uint64, attributes ...attribute.KeyValue)

func AddMeterUpDownCount

func AddMeterUpDownCount(action, description, unit string, value int64, attributes ...attribute.KeyValue)

Add meter up/down count

func ErrorWithCtx

func ErrorWithCtx(ctx context.Context, err error)

func ErrorWithSpan

func ErrorWithSpan(span trace.Span, err error)

func GrpcClientHandler

func GrpcClientHandler() grpc.DialOption

func GrpcServerHandler

func GrpcServerHandler() grpc.ServerOption

func NewServerTrace

func NewServerTrace(ctx context.Context, traceName string) (context.Context, trace.Span)

func NewTrace

func NewTrace(ctx context.Context, traceName string) (context.Context, trace.Span)

func NewTraceFromHTTP

func NewTraceFromHTTP(r *http.Request, traceName string) (*http.Request, trace.Span)

func Shutdown

func Shutdown(ctx context.Context) error

func Start

func Start(startContext context.Context) (err error)

初始化 opentelmetery

func UnaryInterceptor

func UnaryInterceptor() grpc.ServerOption

Types

type Config

type Config struct {
	OpenTel struct {
		URL         string  `yaml:"url"`
		MetricPort  *string `yaml:"metricPort"`
		MetricPath  *string `yaml:"metricPath"`
		ServiceName string  `yaml:"serviceName"`
	} `yaml:"openTel"`
}

type Int64Guage

type Int64Guage struct {
	metr.Int64ObservableGauge
}

type Int64UpCounter

type Int64UpCounter struct {
	metr.Int64Counter
}

type Int64UpDownCounter

type Int64UpDownCounter struct {
	metr.Int64UpDownCounter
}

type Protocol

type Protocol uint

Jump to

Keyboard shortcuts

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