metric

package module
v0.0.0-...-be7e627 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 7 Imported by: 0

README

Go-rpcx-prometheus

go rpcx prometheus plugin

rpcx + prometheus 监控指标
主要提供 http 服务 /metrics 路由让 prometheus 采集

import (
    prom "github.com/caiwp/rpcx-prometheus"
)

s.Plugins.Add(prom.NewPrometheusPlugin("service", "demoTag", "/metrics"))

Documentation

Index

Constants

View Source
const (
	Success = "Success"
	Failure = "Failure"
)

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics(name, pattern string)

Types

type Metrics

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

type Plugin

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

func NewPlugin

func NewPlugin(tag string) *Plugin

func (*Plugin) PostReadRequest

func (p *Plugin) PostReadRequest(ctx context.Context, r *protocol.Message, e error) error

func (*Plugin) PostWriteResponse

func (p *Plugin) PostWriteResponse(ctx context.Context, req *protocol.Message, res *protocol.Message, e error) error

Jump to

Keyboard shortcuts

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