glo

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package glo helps with google cloud logging

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	MicroserviceName           string     `json:"microservice_name,omitempty"`
	InstanceName               string     `json:"instance_name,omitempty"`
	Environment                string     `json:"environment,omitempty"`
	Severity                   string     `json:"severity,omitempty"`
	Message                    string     `json:"message"`
	Description                string     `json:"description,omitempty"`
	Now                        *time.Time `json:"now,omitempty"`
	Trace                      string     `json:"logging.googleapis.com/trace,omitempty"`
	Component                  string     `json:"component,omitempty"`
	InitID                     string     `json:"init_id,omitempty"`
	TriggeringPubsubID         string     `json:"triggering_pubsub_id,omitempty"`
	TriggeringEventID          string     `json:"triggering_event_id,omitempty"`
	TriggeringPubsubTimestamp  *time.Time `json:"triggering_pubsub_timestamp,omitempty"`
	TriggeringEventTimestamp   *time.Time `json:"triggering_event_timestamp,omitempty"`
	TriggeringPubsubAgeSeconds float64    `json:"triggering_pubsub_age_seconds,omitempty"`
	TriggeringEventAgeSeconds  float64    `json:"triggering_event_age_seconds,omitempty"`
	OriginEventID              string     `json:"origin_event_id,omitempty"`
	OriginEventTimestamp       *time.Time `json:"origin_event_timestamp,omitempty"`
	LatencySeconds             float64    `json:"latency_seconds,omitempty"`
	LatencyE2ESeconds          float64    `json:"latency_e2e_seconds,omitempty"`
	StepStack                  Steps      `json:"step_stack,omitempty"`
	Compliant                  bool       `json:"compliant,omitempty"`
	AssetInventoryOrigin       string     `json:"assetInventoryOrigin,omitempty"`
}

Entry defines a Google Cloud logging structured entry https://cloud.google.com/logging/docs/agent/configuration#special-fields

func (Entry) String

func (e Entry) String() string

String renders an entry structure to the JSON format expected by Cloud Logging.

type LogMetricDeployment

type LogMetricDeployment struct {
	Artifacts struct {
		LogMetric logging.LogMetric
	}
	Core     *deploy.Core
	Settings struct {
		Instance struct {
			GLO LogMetricParameters
		}
	}
}

LogMetricDeployment struct

func NewLogMetricDeployment

func NewLogMetricDeployment() *LogMetricDeployment

NewLogMetricDeployment create deployment structure

func (LogMetricDeployment) Deploy

func (logMetricDeployment LogMetricDeployment) Deploy() (err error)

Deploy log based metric

type LogMetricParameters

type LogMetricParameters struct {
	MetricID       string `yaml:"metric_id"`
	Description    string
	Filter         string
	ValueExtractor string `yaml:"valueExtractor,omitempty"`
	BucketOptions  struct {
		ExplicitBuckets struct {
			Bounds []float64 `yaml:"bounds,omitempty"`
		} `yaml:"explicitBuckets,omitempty"`
		ExponentialBuckets struct {
			GrowthFactor     float64 `yaml:"growthFactor,omitempty"`
			NumFiniteBuckets int64   `yaml:"numFiniteBuckets,omitempty"`
			Scale            float64 `yaml:"scale,omitempty"`
		} `yaml:"exponentialBuckets,omitempty"`
		LinearBuckets struct {
			NumFiniteBuckets int64   `yaml:"numFiniteBuckets,omitempty"`
			Offset           float64 `yaml:"offset,omitempty"`
			Width            float64 `yaml:"width,omitempty"`
		} `yaml:"linearBuckets,omitempty"`
	} `yaml:"bucketOptions,omitempty"`
	Labels []struct {
		Name        string `yaml:"name,omitempty"`
		Extractor   string `yaml:"extractor,omitempty"`
		Description string `yaml:"description,omitempty"`
		ValueType   string `yaml:"valueType,omitempty"`
	} `yaml:"labels,omitempty"`
	MetricDescriptor struct {
		LaunchStage string `yaml:"launchStage,omitempty"`
		MetricKind  string `yaml:"metricKind,omitempty"`
		Unit        string `yaml:"unit,omitempty"`
		ValueType   string `yaml:"valueType,omitempty"`
	} `yaml:"metricDescriptor,omitempty"`
}

LogMetricParameters structure

type Step

type Step struct {
	StepID        string    `json:"step_id,omitempty"`
	StepTimestamp time.Time `json:"step_timestamp,omitempty"`
}

Step defines a step in a serverless chain of events

type Steps

type Steps []Step

Steps defines a stack of step

Jump to

Keyboard shortcuts

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