gin_exporter

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

README

gin_exporter

gin_exporter

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GinAppInfo = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "gin_app_info",
			Help: "The Gin Run info",
		},
		[]string{
			"group",
			"type",
			"system",
			"instance",
			"version",
			"commit_id",
			"started_at",
			"platform",
		},
	)

	GinRequestCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "gin_request_total",
			Help: "Number of hello requests in total",
		},
		[]string{"method", "endpoint"},
	)

	GinRequestGauge = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "gin_request_total2",
			Help: "Number of hello requests in total",
		},
		[]string{"method", "endpoint"},
	)

	GinRequestHistogram = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "gin_request_total3",
			Help:    "Number of hello requests in total",
			Buckets: []float64{},
		},
		[]string{"method", "endpoint"},
	)

	GinRequestSummary = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name:       "gin_request_time_millisecond",
			Help:       "Number of hello requests in total",
			Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
		},
		[]string{"method", "endpoint"},
	)
)

Functions

func Default

func Default(app *gin.Engine)

Types

type Config

type Config struct {
	Group     string `json:"group"`
	Type      string `json:"type"`
	System    string `json:"system"`
	Instance  string `json:"instance"`
	Version   string `json:"version"`
	CommitId  string `json:"commit_id"`
	StartedAt string `json:"started_at"`
	Platform  string `json:"platform"`
}

type GinRoutesInfo

type GinRoutesInfo struct {
	Method  string
	Path    string
	Handler string
}

Jump to

Keyboard shortcuts

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