gin

package
v2.16.21 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gin defines a set of basic building blocks for instrumenting KrakenD gateways built using the gin router

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPHandlerFactory

NewHTTPHandlerFactory wraps a handler factory adding some simple instrumentation to the generated handlers

Types

type Metrics

type Metrics struct {
	*metrics.Metrics
}

Metrics is the component that manages all the metrics for the gin-based gateways

func New

New creates a new metrics producer with support for the gin router

func (*Metrics) NewEngine

func (m *Metrics) NewEngine() *gin.Engine

NewEngine returns a *gin.Engine with some defaults and the stats endpoint (no logger)

func (*Metrics) NewExpHandler

func (m *Metrics) NewExpHandler() gin.HandlerFunc

NewExpHandler creates an http.Handler ready to expose all the collected metrics as a JSON

func (*Metrics) NewHTTPHandlerFactory

func (m *Metrics) NewHTTPHandlerFactory(hf krakendgin.HandlerFactory) krakendgin.HandlerFactory

NewHTTPHandlerFactory wraps a handler factory adding some simple instrumentation to the generated handlers

func (*Metrics) RunEndpoint

func (m *Metrics) RunEndpoint(ctx context.Context, e *gin.Engine, l logging.Logger)

RunEndpoint runs the *gin.Engine (that should have the stats endpoint) with the logger

Jump to

Keyboard shortcuts

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