package
1.0.0
Repository: https://github.com/phanitejak/kptgolib.git
Documentation: pkg.go.dev

# README

Go Metrics

# Packages

No description provided by the author
Package metrics v2 provides unified functions to expose application level metrics from the NEO services.

# Functions

BuildRulesFromSwaggerSpec builds rules from the paths unmarshaled from swagger json.
CrossRegisterGoMetrics registers given go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library as-is.
CrossRegisterGoMetricsWithPrefix registers given go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library by adding given prefix for metric name.
CrossRegisterKafkaConsumerGoMetrics registers given Kafka consumer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_consumer.
CrossRegisterKafkaConsumerGoMetricsPrefix registers given Kafka consumer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_consumer_<prefixPostfix>.
CrossRegisterKafkaConsumerMetrics registers given Kafka consumer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_consumer.
CrossRegisterKafkaConsumerMetricsPrefix registers given Kafka consumer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_consumer_<prefixPostfix>.
CrossRegisterKafkaProducerGoMetrics registers given Kafka producer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_producer.
CrossRegisterKafkaProducerGoMetricsPrefix registers given Kafka producer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_producer_<prefixPostfix>.
CrossRegisterKafkaProducerMetrics registers given Kafka producer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_producer.
CrossRegisterKafkaProducerMetricsPrefix registers given Kafka producer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_producer_<prefixPostfix>.
CrossRegisterMetrics registers given go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library as-is.
CrossRegisterGoMetricsWithPrefix registers given go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library by adding given prefix for metric name.
GetMetricsHandler gets metric handler in case you want embed metrics endpoint to your existing HTTP server.
InstrumentHTTPHandler instruments HTTP handler to expose metrics related to request/response count, size and times.
InstrumentHTTPHandlerUsingSwaggerSpec instruments HTTP handler to expose metrics related to request/response count, size and times.
InstrumentHTTPHandlerWithRules instruments HTTP handler to expose metrics related to request/response count, size and times.
InstrumentHTTPHandlerWithSwaggerSpec instruments HTTP handler to expose metrics related to request/response count, size and times.
InstrumentWithPprof instruments given Router with pprof profiling endpoints.
MustCrossRegisterKafkaConsumerMetrics registers given Kafka consumer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_consumer.
MustCrossRegisterKafkaConsumerMetricsPrefix registers given Kafka consumer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_consumer_<prefixPostfix>.
MustCrossRegisterKafkaProducerMetrics registers given Kafka producer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_producer.
MustCrossRegisterKafkaProducerMetricsPrefix registers given Kafka producer go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library using prefix kafka_producer_<prefixPostfix>.
MustCrossRegisterMetrics registers given go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library as-is.
MustCrossRegisterGoMetricsWithPrefix registers given go-metrics (https://github.com/rcrowley/go-metrics) registry metrics to NEO metrics library by adding given prefix for metric name.
MustInstrumentHTTPHandlerWithSwaggerSpec instruments HTTP handler to expose metrics related to request/response count, size and times.
NewHttpRequestTemplate returns a new HttpRequestTemplate given a method, URL, optional body and urlVariables.
NewHttpRequestTemplateFromRequest returns a new HttpRequestTemplate given request and urlVariables.
NewInstrumentedDefaultHttpClient returns default http client with instrumentation capabilities.
NewInstrumentedHttpClient returns given http client with instrumentation capabilities.
NewPrometheusProvider returns a Provider that produces Prometheus metrics.
NewPusher creates a new Pusher to push to the provided URL with the provided job name.
RegisterCounter registers given counter metric by using given subsystem name and metric description.
RegisterCounterVec registers given counter vector metric by using given keys, subsystem name and metric description.
RegisterGauge registers given gauge metric by using given subsystem name and metric description.
RegisterGaugeVec registers given gauge vector metric by using given keys, subsystem name and metric description.
RegisterSummary registers given summary metric by using given subsystem name and metric description.
RegisterSummaryVec registers given summary vector metric by using given keys, subsystem name and metric description.
RegisterSummaryWithObjectives registers given summary metric by using given subsystem name , metric description and the quantile rank.
StartManagementServer starts HTTP server for metric endpoint, pprof endpoints and optionally for health-check endpoint.
UnregisterKafkaConsumerMetrics unregisters given Kafka consumer metrics registered by CrossRegisterKafkaConsumerGoMetrics.
UnregisterKafkaConsumerMetrics unregisters given Kafka consumer metrics registered by CrossRegisterKafkaConsumerGoMetricsPrefix.
UnregisterKafkaProducerMetrics unregisters given Kafka consumer metrics registered by CrossRegisterKafkaProducerGoMetrics.
UnregisterKafkaProducerMetrics unregisters given Kafka consumer metrics registered by CrossRegisterKafkaProducerGoMetricsPrefix.
UnregisterMetrics unregisters all cross-registered metrics from NEO metrics registry (prometheus).
UnregisterMetricsWithPrefix unregisters all cross-registered metrics using given prefix from NEO metrics registry (prometheus).

# Constants

DefaultEndPoint is the default endpoint for the exposed metrics.
KafkaConsumerPrefix is a common prefix for Kafka consumer metrics.
KafkaProducerPrefix is a common prefix for Kafka producer metrics.
PUSH_ENDPOINT is push endpoint's environment variable name.

# Structs

CustomCounter is type for business logic specific 1-dimension counter metrics (no custom labels).
CustomCounterVec is type for business logic specific 2-n dimension counter metrics (1-n custom labels).
CustomGauge is type for business logic specific 1-dimension gauge metrics.
CustomGaugeVec is type for business logic specific 2-n dimension gauge metrics (1-n custom labels).
CustomSummary is type for business logic specific 1-dimension summary metrics.
CustomSummaryVec is type for business logic specific 2-n dimension summary metrics (1-n custom labels).
A HttpRequestTemplate represents standard http.Request with URL templating capabilities.
A InstrumentedHttpClient represents standard http.Client with metrics instrumentation capabilities.
InstrumentRule combines regexp trigger condition and matching value,.
ManagementServer type is for gracefully stop the management server.
No description provided by the author
PushConfig configuration.
Pusher manages a push to the push gateway.

# Interfaces

Counter is an interface for metrics counters.
CounterVec is an interface for metrics vec counters.
CustomMetric is a provider for collector.
Router is an interface used for pprof instrumentation.
Summary is an interface for summary metrics.