setup

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package setup contains common logic for setting up the export package across binaries.

Index

Constants

View Source
const (
	// Supported HA backend modes.
	HABackendNone       = "none"
	HABackendKubernetes = "kube"
	// User agent environments.
	UAEnvGKE         = "gke"
	UAEnvGCE         = "gce"
	UAEnvUnspecified = "unspecified"
	// User agent modes.
	UAModeGKE         = "gke"
	UAModeKubectl     = "kubectl"
	UAModeUnspecified = "unspecified"
	UAModeAVMW        = "on-prem"
	UAModeABM         = "baremetal"
)
View Source
const ExtraArgsEnvvar = "EXTRA_ARGS"

Environment variable that contains additional command line arguments. It can be used to inject additional arguments when the regular ones cannot be easily modified.

Variables

View Source
var ErrLocationGlobal = errors.New("Location must be set to a named Google Cloud " +
	"region and cannot be set to \"global\". Please choose the " +
	"Google Cloud region that is physically nearest to your cluster. " +
	"See https://www.cloudinfrastructuremap.com/")

Functions

func ExtraArgs added in v0.4.1

func ExtraArgs() ([]string, error)

ExtraArgs returns additional command line arguments extracted from the EXTRA_ARGS. environment variable. It is parsed like a shell parses arguments. For example: EXTRA_ARGS="--foo=bar -x 123". It can be used like `flagset.Parse(append(os.Args[1:], ExtraArgs()...))`.

func FromFlags

func FromFlags(a *kingpin.Application, userAgentProduct string) func(log.Logger, prometheus.Registerer) (*export.Exporter, error)

FromFlags returns a constructor for a new exporter that is configured through flags that are registered with the given application. The constructor must be called after the flags have been parsed.

func Global

func Global() *export.Exporter

Global returns the global instance of the GCM exporter.

func SetGlobal

func SetGlobal(exporter *export.Exporter) (err error)

SetGlobal sets the global instance of the GCM exporter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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