info

package
v0.0.0-...-34e0b2d Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Unknown = "Unknown"

	ClientRequestIDKey = "client_request_id"
)
View Source
const (
	ContextUsername      = "username"
	ContextReturnCode    = "code"
	ContextReturnMessage = "message"
	ContextRequest       = "request"
)

Variables

View Source
var ClusterPrefix atomic.String
View Source
var MetricFuncMap = map[string]getMetricFunc{
	"$method_name":       getMethodName,
	"$method_status":     getMethodStatus,
	"$trace_id":          getTraceID,
	"$user_addr":         getAddr,
	"$user_name":         getUserName,
	"$response_size":     getResponseSize,
	"$error_code":        getErrorCode,
	"$error_msg":         getErrorMsg,
	"$error_type":        getErrorType,
	"$database_name":     getDbName,
	"$collection_name":   getCollectionName,
	"$partition_name":    getPartitionName,
	"$time_cost":         getTimeCost,
	"$time_now":          getTimeNow,
	"$time_start":        getTimeStart,
	"$time_end":          getTimeEnd,
	"$method_expr":       getExpr,
	"$output_fields":     getOutputFields,
	"$sdk_version":       getSdkVersion,
	"$cluster_prefix":    getClusterPrefix,
	"$consistency_level": getConsistencyLevel,
}

supported metrics

Functions

func Get

func Get(i AccessInfo, keys ...string) []any

Types

type AccessInfo

type AccessInfo interface {
	TimeCost() string
	TimeNow() string
	TimeStart() string
	TimeEnd() string
	MethodName() string
	Address() string
	TraceID() string
	MethodStatus() string
	UserName() string
	ResponseSize() string
	ErrorCode() string
	ErrorMsg() string
	ErrorType() string
	DbName() string
	CollectionName() string
	PartitionName() string
	Expression() string
	OutputFields() string
	SdkVersion() string
	ConsistencyLevel() string
}

type BaseResponse

type BaseResponse interface {
	GetStatus() *commonpb.Status
}

type GrpcAccessInfo

type GrpcAccessInfo struct {
	// contains filtered or unexported fields
}

func NewGrpcAccessInfo

func NewGrpcAccessInfo(ctx context.Context, grpcInfo *grpc.UnaryServerInfo, req interface{}) *GrpcAccessInfo

func (*GrpcAccessInfo) Address

func (i *GrpcAccessInfo) Address() string

func (*GrpcAccessInfo) CollectionName

func (i *GrpcAccessInfo) CollectionName() string

func (*GrpcAccessInfo) ConsistencyLevel

func (i *GrpcAccessInfo) ConsistencyLevel() string

func (*GrpcAccessInfo) DbName

func (i *GrpcAccessInfo) DbName() string

func (*GrpcAccessInfo) ErrorCode

func (i *GrpcAccessInfo) ErrorCode() string

func (*GrpcAccessInfo) ErrorMsg

func (i *GrpcAccessInfo) ErrorMsg() string

func (*GrpcAccessInfo) ErrorType

func (i *GrpcAccessInfo) ErrorType() string

func (*GrpcAccessInfo) Expression

func (i *GrpcAccessInfo) Expression() string

func (*GrpcAccessInfo) MethodName

func (i *GrpcAccessInfo) MethodName() string

func (*GrpcAccessInfo) MethodStatus

func (i *GrpcAccessInfo) MethodStatus() string

func (*GrpcAccessInfo) OutputFields

func (i *GrpcAccessInfo) OutputFields() string

func (*GrpcAccessInfo) PartitionName

func (i *GrpcAccessInfo) PartitionName() string

func (*GrpcAccessInfo) ResponseSize

func (i *GrpcAccessInfo) ResponseSize() string

func (*GrpcAccessInfo) SdkVersion

func (i *GrpcAccessInfo) SdkVersion() string

func (*GrpcAccessInfo) SetResult

func (i *GrpcAccessInfo) SetResult(resp interface{}, err error)

func (*GrpcAccessInfo) TimeCost

func (i *GrpcAccessInfo) TimeCost() string

func (*GrpcAccessInfo) TimeEnd

func (i *GrpcAccessInfo) TimeEnd() string

func (*GrpcAccessInfo) TimeNow

func (i *GrpcAccessInfo) TimeNow() string

func (*GrpcAccessInfo) TimeStart

func (i *GrpcAccessInfo) TimeStart() string

func (*GrpcAccessInfo) TraceID

func (i *GrpcAccessInfo) TraceID() string

func (*GrpcAccessInfo) UpdateCtx

func (i *GrpcAccessInfo) UpdateCtx(ctx context.Context)

update context for more info

func (*GrpcAccessInfo) UserName

func (i *GrpcAccessInfo) UserName() string

type RestfulInfo

type RestfulInfo struct {
	// contains filtered or unexported fields
}

func NewRestfulInfo

func NewRestfulInfo() *RestfulInfo

func (*RestfulInfo) Address

func (i *RestfulInfo) Address() string

func (*RestfulInfo) CollectionName

func (i *RestfulInfo) CollectionName() string

func (*RestfulInfo) ConsistencyLevel

func (i *RestfulInfo) ConsistencyLevel() string

func (*RestfulInfo) DbName

func (i *RestfulInfo) DbName() string

func (*RestfulInfo) ErrorCode

func (i *RestfulInfo) ErrorCode() string

func (*RestfulInfo) ErrorMsg

func (i *RestfulInfo) ErrorMsg() string

func (*RestfulInfo) ErrorType

func (i *RestfulInfo) ErrorType() string

func (*RestfulInfo) Expression

func (i *RestfulInfo) Expression() string

func (*RestfulInfo) InitReq

func (i *RestfulInfo) InitReq()

func (*RestfulInfo) MethodName

func (i *RestfulInfo) MethodName() string

func (*RestfulInfo) MethodStatus

func (i *RestfulInfo) MethodStatus() string

func (*RestfulInfo) OutputFields

func (i *RestfulInfo) OutputFields() string

func (*RestfulInfo) PartitionName

func (i *RestfulInfo) PartitionName() string

func (*RestfulInfo) ResponseSize

func (i *RestfulInfo) ResponseSize() string

func (*RestfulInfo) SdkVersion

func (i *RestfulInfo) SdkVersion() string

func (*RestfulInfo) SetParams

func (i *RestfulInfo) SetParams(p *gin.LogFormatterParams)

func (*RestfulInfo) TimeCost

func (i *RestfulInfo) TimeCost() string

func (*RestfulInfo) TimeEnd

func (i *RestfulInfo) TimeEnd() string

func (*RestfulInfo) TimeNow

func (i *RestfulInfo) TimeNow() string

func (*RestfulInfo) TimeStart

func (i *RestfulInfo) TimeStart() string

func (*RestfulInfo) TraceID

func (i *RestfulInfo) TraceID() string

func (*RestfulInfo) UserName

func (i *RestfulInfo) UserName() string

type SizeResponse

type SizeResponse interface {
	XXX_Size() int
}

Jump to

Keyboard shortcuts

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