middleware

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package middleware provides HTTP tracing middleware for gorp framework. Creates spans for each HTTP request, extracts/injects trace context. Records method, URL, status code, latency as span attributes.

中间件包提供 HTTP 追踪中间件,用于 gorp 框架。 为每个 HTTP 请求创建 Span,提取/注入追踪上下文。 记录方法、URL、状态码、延迟作为 Span 属性。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseTraceParent

func ParseTraceParent(traceparent string) (traceID, spanID string, flags string, ok bool)

func TracingMiddleware

func TracingMiddleware(tracer observabilitycontract.Tracer, serviceName string) transportcontract.Middleware

TracingMiddleware creates HTTP middleware for distributed tracing. Core logic: Extract trace context, create span, record attributes, inject trace ID.

TracingMiddleware 创建用于分布式追踪的 HTTP 中间件。 核心逻辑:提取追踪上下文、创建 Span、记录属性、注入 Trace ID。

func WithAttributes

func WithAttributes(attrs map[string]any) observabilitycontract.SpanOption

Types

This section is empty.

Directories

Path Synopsis
Package grpc provides gRPC tracing middleware for gorp framework.
Package grpc provides gRPC tracing middleware for gorp framework.

Jump to

Keyboard shortcuts

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