server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package server implements an http server to export metrics in Prometheus format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddr          string        // Address to bind the server to.
	BindCert, BindKey string        // Paths to Certificate and Key.
	CaCert            string        // Path to the Root CA.
	Endpoint          string        // Endpoint for metrics
	RewriteHistograms bool          // Enable histogram rewriting
	Insecure          bool          // Sanity check to ensure that the operator really means it.
	Prometheus        string        // URL for the node prometheus endpoint
	Refresh           time.Duration // how often to refresh the configuration.
	URL               string        // URL to connect to the database
	ProcMetrics       bool          // Enable collections of process metrics.
	VisusMetrics      bool          // Enable collection of visus metrics.
}

Config encapsulates the command-line configurations and the logic necessary to make those values usable.

func (*Config) GetTLSClientConfig

func (c *Config) GetTLSClientConfig() (*tls.Config, error)

GetTLSClientConfig returns the TLS configuration to use for outgoing http connections.

type Server

type Server interface {
	// Refresh the server configuration
	Refresh(ctx context.Context) error
	// Start the server
	Start(ctx context.Context) error
	// Shutdown the server, releasing all the resources associated with it.
	Shutdown(ctx context.Context) error
}

A Server is a process that can be started and shutdown.

Jump to

Keyboard shortcuts

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