metrics

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package metrics 提供 Prometheus 格式的监控指标端点。 实现不依赖 prometheus/client_golang,手动生成文本格式以避免额外依赖。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler 提供 GET /metrics 端点(Prometheus text format)

func NewHandler

func NewHandler(logger *zap.Logger, usageRepo *db.UsageRepo, userRepo *db.UserRepo) *Handler

NewHandler 创建 metrics Handler

func (*Handler) RegisterRoutes

func (h *Handler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes 注册 /metrics 路由(无需认证,供 Prometheus 抓取)

Jump to

Keyboard shortcuts

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