Documentation ¶
Index ¶
- Variables
- func AddAttrKeysContext(ctx context.Context) context.Context
- func AddKeysContext(ctx context.Context, ops ...AddKeyContexFunc) context.Context
- func AddMetricKeysContext(ctx context.Context) context.Context
- func AppendAttrsContext(ctx context.Context, values ...string) context.Context
- func AppendMetricCountContext(ctx context.Context, values ...string) context.Context
- func Attrs(dim Dimension) []attribute.KeyValue
- func ExtractAttrsWithContext(ctx context.Context) []attribute.KeyValue
- func GlobalMeter() metric.Meter
- func ReportBusinessMetric(ctx context.Context, attrs []attribute.KeyValue)
- func ReportMetric(ctx context.Context, dim Dimension, costTime time.Duration)
- func UpdateAttrsContext(ctx context.Context, values map[string]interface{}) error
- func UpdateMetricContext(ctx context.Context, values map[string]interface{}) error
- type AddKeyContexFunc
- type Dimension
- type HandlerWithContext
- type MetricMonitor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CallerMethodKey = attribute.Key("caller_method") // caller method CalleeMethodKey = attribute.Key("callee_method") // callee method PodIpKey = attribute.Key("pod_ip") // pod ip ServerNameKey = attribute.Key("server_name") // server name ErrorCodeKey = attribute.Key("error_code") // error code )
dims
View Source
var (
DefaultMetricMonitor = NewMetricMonitor()
)
View Source
var OpentelemetryDimsKey = "opentelemetry_dims_key"
View Source
var OpentelemetryMetricsKey = "opentelemetry_metrics_key"
Functions ¶
func AddAttrKeysContext ¶ added in v0.0.124
func AddKeysContext ¶ added in v0.0.124
func AddKeysContext(ctx context.Context, ops ...AddKeyContexFunc) context.Context
func AddMetricKeysContext ¶ added in v0.0.124
func AppendAttrsContext ¶ added in v0.0.124
func AppendMetricCountContext ¶ added in v0.0.124
func ExtractAttrsWithContext ¶ added in v0.0.124
func GlobalMeter ¶ added in v0.0.124
func ReportBusinessMetric ¶ added in v0.0.124
func ReportMetric ¶ added in v0.0.102
func UpdateAttrsContext ¶ added in v0.0.124
Types ¶
type AddKeyContexFunc ¶ added in v0.0.124
type HandlerWithContext ¶ added in v0.0.105
type MetricMonitor ¶
type MetricMonitor struct { TotalReqCounter syncint64.Counter FailCntCounter syncint64.Counter CostTimeHistogram syncfloat64.Histogram BusinessCounters map[string]syncint64.Counter BusinessHistogram map[string]syncfloat64.Histogram // contains filtered or unexported fields }
func NewMetricMonitor ¶
func NewMetricMonitor() *MetricMonitor
func (*MetricMonitor) GetOrNewBusinessCounter ¶ added in v0.0.124
func (m *MetricMonitor) GetOrNewBusinessCounter(key string) (syncint64.Counter, error)
func (*MetricMonitor) GetOrNewBusinessHistogram ¶ added in v0.0.124
func (m *MetricMonitor) GetOrNewBusinessHistogram(key string) (syncfloat64.Histogram, error)
Click to show internal directories.
Click to hide internal directories.