aurestclientprometheus

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 10 Imported by: 1

README

go-autumn-restclient-prometheus

Prometheus instrumentation functions for go-autumn-restclient.

About go-autumn

A collection of libraries for enterprise microservices in golang that

  • is heavily inspired by Spring Boot / Spring Cloud
  • is very opinionated
  • names modules by what they do
  • unlike Spring Boot avoids certain types of auto-magical behaviour
  • is not a library monolith, that is every part only depends on the api parts of the other components at most, and the api parts do not add any dependencies.

Fall is my favourite season, so I'm calling it go-autumn.

About go-autumn-restclient

It's a rest client that also supports x-www-form-urlencoded.

About go-autumn-restclient-prometheus

Implements instrumentation callbacks that use prometheus/client_golang.

Usage

Use the provided callbacks while constructing your rest client stack.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheHitMetricsCallback

func CacheHitMetricsCallback(_ context.Context, method string, requestUrl string, status int, _ error, _ time.Duration, _ int)

func CacheInvalidMetricsCallback

func CacheInvalidMetricsCallback(_ context.Context, method string, requestUrl string, status int, _ error, _ time.Duration, _ int)

func CacheMissMetricsCallback

func CacheMissMetricsCallback(_ context.Context, method string, requestUrl string, status int, _ error, _ time.Duration, _ int)

func ClientNameFromRequestUrl

func ClientNameFromRequestUrl(requestUrl string) string

func GivingUpMetricsCallback

func GivingUpMetricsCallback(_ context.Context, method string, requestUrl string, status int, _ error, _ time.Duration, _ int)

func InstrumentCacheClient

func InstrumentCacheClient(client aurestclientapi.Client)

func InstrumentHttpClient

func InstrumentHttpClient(client aurestclientapi.Client)

func InstrumentRetryClient

func InstrumentRetryClient(client aurestclientapi.Client)

func OutcomeFromStatus

func OutcomeFromStatus(status int) string

func RequestMetricsCallback

func RequestMetricsCallback(ctx context.Context, method string, requestUrl string, status int, err error, latency time.Duration, size int)

func ResponseMetricsCallback

func ResponseMetricsCallback(ctx context.Context, method string, requestUrl string, status int, err error, latency time.Duration, size int)

func RetryingMetricsCallback

func RetryingMetricsCallback(_ context.Context, method string, requestUrl string, status int, _ error, _ time.Duration, _ int)

func SetupCacheClientMetrics

func SetupCacheClientMetrics()

func SetupCommon

func SetupCommon()

func SetupHttpClientMetrics

func SetupHttpClientMetrics()

func SetupRetryClientMetrics

func SetupRetryClientMetrics()

Types

This section is empty.

Jump to

Keyboard shortcuts

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