observability

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(opts ...Option) middleware.Middleware

Client 返回一个客户端可观测性中间件 组合了日志、指标和跟踪功能

func Server

func Server(opts ...Option) middleware.Middleware

Server 返回一个服务端可观测性中间件 组合了日志、指标和跟踪功能

Types

type Option

type Option func(*options)

Option 是可观测性中间件的选项

func WithLogRequestBody

func WithLogRequestBody(enabled bool) Option

WithLogRequestBody 设置是否记录请求体

func WithLogResponseBody

func WithLogResponseBody(enabled bool) Option

WithLogResponseBody 设置是否记录响应体

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger 设置日志记录器

func WithMetrics

func WithMetrics(m metrics.Metrics) Option

WithMetrics 设置指标收集器

func WithTracer

func WithTracer(t tracing.Tracer) Option

WithTracer 设置跟踪器

Jump to

Keyboard shortcuts

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