interceptor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TAG_SERVICE_NAME            = "service_name"
	TAG_SERVICE_ID              = "service_id"
	TAG_SERVICE_INSTANCE_IP     = "service_instance_ip"
	TAG_SERVICE_INSTANCE_ID     = "service_instance_id"
	TAG_CLIENT_UUID             = "client_uuid"
	TAG_TERMINUS_KEY            = "terminus_key"
	TAG_IP                      = "ip"
	TAG_HTTP_PATH               = "http_path"
	TAG_HTTP_URL                = "http_url"
	TAG_HTTP_TARGET             = "http_target"
	TAG_INSTRUMENT              = "instrument"
	TAG_INSTRUMENT_VERSION      = "instrument_version"
	TAG_SPAN_KIND               = "span_kind"
	TAG_ORG_NAME                = "org_name"
	TAG_ENV_ID                  = "env_id"
	TAG_ENV_TOKEN               = "env_token"
	TAG_DUBBO_SERVICE           = "dubbo_service"
	TAG_DUBBO_METHOD            = "dubbo_method"
	TAG_RPC_SYSTEM              = "rpc_system"
	TAG_RPC_SERVICE             = "rpc_service"
	TAG_RPC_METHOD              = "rpc_method"
	TAG_RPC_TARGET              = "rpc_target"
	TAG_RPC_SYSTEM_DUBBO        = "dubbo"
	TAG_DB_SYSTEM               = "db_system"
	TAG_DB_TYPE                 = "db_type"
	TAG_DB_NAME                 = "db_name"
	TAG_DB_INSTANCE             = "db_instance"
	TAG_SPAN_LAYER              = "span_layer"
	TAG_SPAN_LAYER_HTTP         = "http"
	TAG_SPAN_LAYER_RPC          = "rpc"
	TAG_SPAN_LAYER_CACHE        = "cache"
	TAG_SPAN_LAYER_DB           = "db"
	TAG_SPAN_LAYER_MQ           = "mq"
	TAG_SPAN_LAYER_LOCAL        = "local"
	TAG_MESSAGE_BUS_DESTINATION = "message_bus_destination"
	TAG_DB_STATEMENT            = "db_statement"
	TAG_DB_TYPE_REDIS           = "redis"
	TAG_JAEGER                  = "jaeger"
	TAG_JAEGER_VERSION          = "jaeger_version"

	//use to compatible the span data from erda java-agent to otlp java-agent
	TAG_IS_FROM_ERDA   = "is_from_erda"
	TAG_TRACE_ID       = "trace_id"
	TAG_PARENT_SPAN_ID = "parent_span_id"

	TAG_ERDA_ENV_ID    = "erda_env_id"
	TAG_ERDA_ENV_TOKEN = "erda_env_token"
	TAG_ERDA_ORG       = "erda_org"
	// C means compatible
	// Separator of tag key compatible with third-party protocols, such as opentracing, opentelemetry
	TAG_ERDA_ENV_ID_C    = "erda.env.id"
	TAG_ERDA_ENV_TOKEN_C = "erda.env.token"
	TAG_ERDA_ORG_C       = "erda.org"

	HEADER_ERDA_ENV_ID    = "x-erda-env-id"
	HEADER_ERDA_ENV_TOKEN = "x-erda-env-token"
	HEADER_ERDA_ORG       = "x-erda-org"

	SCOPE_MSP_ENV = "msp_env"
)
View Source
var (
	INVALID_MSP_ENV_ID    = errors.New("invalid erda.env.id tag")
	INVALID_MSP_ENV_TOKEN = errors.New("invalid erda.env.token tag")
	AUTHENTICATION_FAILED = errors.New("authentication failed, please use the correct accessKey and accessKeySecret")
)
View Source
var InterceptorType = reflect.TypeOf((*Interceptors)(nil)).Elem()

Functions

func Spans

func Spans(ctx context.Context) ([]*trace.Span, bool)

func WithSpans

func WithSpans(ctx context.Context, spans []*trace.Span) context.Context

Types

type Interceptors

type Interceptors interface {
	Authentication(next interceptor.Handler) interceptor.Handler

	SpanTagOverwrite(next interceptor.Handler) interceptor.Handler

	ExtractHttpHeaders(next interceptor.Handler) interceptor.Handler
}

type SpansProvider

type SpansProvider interface {
	GetSpans() []*pb.Span
}

Jump to

Keyboard shortcuts

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