common

package
v0.0.0-...-fe23bbf Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//error codes
	CodeErrorLoadingConfig = "error_loading_configs"

	//error messages
	MessageErrorLoadingConfig       = "error parsing environment vars %#v"
	MessageTraceInitializationError = "error initializing traces"

	//Metrics errors
	MetricCollectorError                 = "metric_collector_error"
	MetricCollectorCreatingExporterError = "error creating exporter"
	MetricCollectorCountError            = "error sending Count metric"
	MetricCollectorDistributionError     = "error sending Distribution metric"
	MetricCollectorRegisterGaugeError    = "error registering the asynchronous gauge observer"
	MetricCollectorHistogramError        = "error sending Histogram metric"
	MetricCollectorSetError              = "error sending Set metric"

	//metric complements
	SuffixCounterMetric = "count"
	SuffixGaugeMetric   = "gauge"
)

Variables

This section is empty.

Functions

func GetResource

func GetResource(ctx context.Context) *resource.Resource

func GetResourceAttributes

func GetResourceAttributes() []attribute.KeyValue

Types

type Config

type Config struct {
	ServiceName string `split_words:"true"`
	Version     string `split_words:"true"`
	Environment string `split_words:"true" default:"dev"`
	Metrics     Metrics
}

func LoadConfig

func LoadConfig() Config

type Metrics

type Metrics struct {
	PrefixWithServiceName bool `split_words:"true" default:"false"`
}

Jump to

Keyboard shortcuts

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