observability

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AsyncTaskDurationSeconds = promauto.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:    "asynctask_task_duration_seconds",
		Help:    "Time spent processing an asynctask message",
		Buckets: taskDurationBuckets,
	},
	[]string{"task_name", "queue", "status"},
)

AsyncTaskDurationSeconds 与 Python coast 库的 ASYNC_TASK_DURATION_SECONDS 同名同 label,可以在同一个 Prometheus/Grafana 查询里合并两边的数据; 两边 buckets 不同,跨语言做 histogram_quantile 时需要留意分位数偏差。 包级 var,Go 保证进程内只初始化一次——即便同一个 extension 类型有多个实例 (如 one_asynctask_/two_asynctask_)反复 Init 也不会重复 promauto 注册导致 panic。

View Source
var BusTaskDurationSeconds = promauto.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:    "bus_task_duration_seconds",
		Help:    "Time spent processing a bus message",
		Buckets: taskDurationBuckets,
	},
	[]string{"task_name", "queue", "status"},
)

BusTaskDurationSeconds 与 Python coast 库的 BUS_TASK_DURATION_SECONDS 同名同 label。

Functions

func ApmTracer added in v1.2.5

func ApmTracer() *apm.Tracer

func GetApmEnable added in v1.2.5

func GetApmEnable() bool

func GetOtelEnable added in v1.2.5

func GetOtelEnable() bool

func Initialize added in v1.2.5

func Initialize() func(ctx context.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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