prometheus

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

Prometheus Metrics HTTP Server

This code provides the ability to start/stop a native Golang HTTP Server backed by the default Prometheus handler. The desired HTTP Port & Path are specified upon server creation. This should allow the Channel, Controller, and Dispatcher to quickly add this capability in a consistent manner without code duplication.

This code only serves to expose the default Prometheus metrics on a specified port/path. The creation of the K8S Service and Prometheus ServiceMonitor is left up to the individual component to provide.

Metrics Endpoint

In order to manually test the exposed /metrics endpoint you can port forward the service

kubectl port-forward svc/<service> -n <namespace> 8081:8081

...and point your browser at http://localhost:8081/metrics, or you can use telepresence and curl...

telepresence
curl http://<service>.<namespace>.svc.cluster.local:8081/metrics
Prometheus Console

In order to expose the Prometheus console in the Kyma cluster simply expose the port...

kubectl port-forward svc/monitoring-prometheus -n kyma-system 9090:9090

...and then point you browser at http://localhost:9090/graph or http://localhost:9090/targets

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsServer

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

The MetricsServer Struct

func NewMetricsServer

func NewMetricsServer(logger *zap.Logger, httpPort string, path string) *MetricsServer

MetricsServer Constructor

func (*MetricsServer) Observe

func (m *MetricsServer) Observe(stats string)

Observe librdkafka Metrics

func (*MetricsServer) Start

func (m *MetricsServer) Start()

Start The Metrics HTTP Server Listening For Requests

func (*MetricsServer) Stop

func (m *MetricsServer) Stop()

Stop The Metrics HTTP Server Listening For Requests

Jump to

Keyboard shortcuts

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