metricsservice

package
v0.37.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostOptions

type HostOptions struct {
	// Config is the bootstrap metrics configuration loaded from config file.
	Config *provider.MetricsProviderOptions
}

HostOptions defines all of the settings that our metric's execution environment provides.

func NewHostOptionsFromEnvironment

func NewHostOptionsFromEnvironment(options hostoptions.ProviderConfig) HostOptions

NewHostOptionsFromEnvironment creates a new HostOptions object from a ProviderConfig object.

type Service

type Service struct {
	Options HostOptions
}

func NewService

func NewService(options HostOptions) *Service

NewService creates a new Service instance with the given HostOptions.

func (*Service) Name

func (s *Service) Name() string

Name returns the name of the metrics service.

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Run creates a new server for exposing an endpoint to collect metrics from. It sets up a Prometheus exporter, initializes metrics, creates an HTTP server and handles shutdown based on the context, returning an error if one occurs.

Jump to

Keyboard shortcuts

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