flags

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package flags defines command line flags that are shared by several jaeger components. They are defined in this shared location so that if several components are wired into a single binary (e.g. a local container of complete Jaeger backend) they can all share the flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConfigFileFlag added in v0.9.0

func AddConfigFileFlag(flagSet *flag.FlagSet)

AddConfigFileFlag adds flags for ExternalConfFlags

func AddFlags added in v0.6.0

func AddFlags(flagSet *flag.FlagSet)

AddFlags adds flags for SharedFlags

func AddLoggingFlag added in v1.5.0

func AddLoggingFlag(flagSet *flag.FlagSet)

AddLoggingFlag adds logging flag for SharedFlags

func TryLoadConfigFile added in v0.9.0

func TryLoadConfigFile(v *viper.Viper) error

TryLoadConfigFile initializes viper with config file specified as flag

Types

type AdminServer added in v1.12.0

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

AdminServer runs an HTTP server with admin endpoints, such as healthcheck at /, /metrics, etc.

func NewAdminServer added in v1.12.0

func NewAdminServer(defaultPort int) *AdminServer

NewAdminServer creates a new admin server.

func (*AdminServer) AddFlags added in v1.12.0

func (s *AdminServer) AddFlags(flagSet *flag.FlagSet)

AddFlags registers CLI flags.

func (*AdminServer) Close added in v1.12.0

func (s *AdminServer) Close() error

Close stops the HTTP server

func (*AdminServer) HC added in v1.12.0

HC returns the reference to HeathCheck.

func (*AdminServer) Handle added in v1.12.0

func (s *AdminServer) Handle(path string, handler http.Handler)

Handle adds a new handler to the admin server.

func (*AdminServer) Serve added in v1.12.0

func (s *AdminServer) Serve() error

Serve starts HTTP server.

type Service added in v1.12.0

type Service struct {
	// AdminPort is the HTTP port number for admin server.
	AdminPort int

	// NoStorage indicates that storage type CLI flag is not applicable
	NoStorage bool

	// Admin is the admin server that hosts the health check and metrics endpoints.
	Admin *AdminServer

	// Logger is initialized after parsing Viper flags like --log-level.
	Logger *zap.Logger

	// MetricsFactory is the root factory without a namespace.
	MetricsFactory metrics.Factory
	// contains filtered or unexported fields
}

Service represents an abstract Jaeger backend component with some basic shared functionality.

func NewService added in v1.12.0

func NewService(adminPort int) *Service

NewService creates a new Service.

func (*Service) AddFlags added in v1.12.0

func (s *Service) AddFlags(flagSet *flag.FlagSet)

AddFlags registers CLI flags.

func (*Service) HC added in v1.12.0

func (s *Service) HC() *healthcheck.HealthCheck

HC returns the reference to HeathCheck.

func (*Service) RunAndThen added in v1.12.0

func (s *Service) RunAndThen(shutdown func())

RunAndThen sets the health check to Ready and blocks until SIGTERM is received. If then runs the shutdown function and exits.

func (*Service) SetHealthCheckStatus added in v1.12.0

func (s *Service) SetHealthCheckStatus(status healthcheck.Status)

SetHealthCheckStatus sets status of healthcheck

func (*Service) Start added in v1.12.0

func (s *Service) Start(v *viper.Viper) error

Start bootstraps the service and starts the admin server.

type SharedFlags added in v0.6.0

type SharedFlags struct {
	// Logging holds logging configuration
	Logging logging
}

SharedFlags holds flags configuration

func (*SharedFlags) InitFromViper added in v0.6.0

func (flags *SharedFlags) InitFromViper(v *viper.Viper) *SharedFlags

InitFromViper initializes SharedFlags with properties from viper

func (*SharedFlags) NewLogger added in v1.0.0

func (flags *SharedFlags) NewLogger(conf zap.Config, options ...zap.Option) (*zap.Logger, error)

NewLogger returns logger based on configuration in SharedFlags

Jump to

Keyboard shortcuts

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