googlecloud

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.4.0

type Client interface {
	WriteLogEntries(ctx context.Context, req *logging.WriteLogEntriesRequest, opts ...gax.CallOption) (*logging.WriteLogEntriesResponse, error)
	Close() error
}

Client is an interface for writing entries to google cloud logging

type ClientBuilder added in v1.4.0

type ClientBuilder = func(ctx context.Context, opts ...option.ClientOption) (Client, error)

ClientBuilder is a function that builds a client

type EntryBuilder added in v1.4.0

type EntryBuilder interface {
	Build(entry *entry.Entry) (*logging.LogEntry, error)
}

EntryBuilder is an interface for building google cloud logging entries

type GoogleCloudOutput

type GoogleCloudOutput struct {
	helper.OutputOperator
	// contains filtered or unexported fields
}

GoogleCloudOutput is an operator that sends logs to google cloud logging.

func (*GoogleCloudOutput) Process added in v1.0.0

func (g *GoogleCloudOutput) Process(ctx context.Context, e *entry.Entry) error

Process adds an incoming entry to the buffer

func (*GoogleCloudOutput) Start

func (g *GoogleCloudOutput) Start() error

Start will start the google cloud operator

func (*GoogleCloudOutput) Stop

func (g *GoogleCloudOutput) Stop() error

Stop will stop the google cloud operator

type GoogleCloudOutputConfig

type GoogleCloudOutputConfig struct {
	helper.OutputConfig `yaml:",inline"`
	BufferConfig        buffer.Config   `json:"buffer,omitempty" yaml:"buffer,omitempty"`
	FlusherConfig       flusher.Config  `json:"flusher,omitempty" yaml:"flusher,omitempty"`
	Credentials         string          `json:"credentials,omitempty"      yaml:"credentials,omitempty"`
	CredentialsFile     string          `json:"credentials_file,omitempty" yaml:"credentials_file,omitempty"`
	ProjectID           string          `json:"project_id"                 yaml:"project_id"`
	LogNameField        *entry.Field    `json:"log_name_field,omitempty"   yaml:"log_name_field,omitempty"`
	LocationField       *entry.Field    `json:"location_field,omitempty"   yaml:"location_field,omitempty"`
	TraceField          *entry.Field    `json:"trace_field,omitempty"      yaml:"trace_field,omitempty"`
	SpanIDField         *entry.Field    `json:"span_id_field,omitempty"    yaml:"span_id_field,omitempty"`
	Timeout             helper.Duration `json:"timeout,omitempty"          yaml:"timeout,omitempty"`
	UseCompression      bool            `json:"use_compression,omitempty"  yaml:"use_compression,omitempty"`
	MaxEntrySize        helper.ByteSize `json:"max_entry_size"             yaml:"max_entry_size"`
	MaxRequestSize      helper.ByteSize `json:"max_request_size"           yaml:"max_request_size"`
}

GoogleCloudOutputConfig is the configuration of a google cloud output operator.

func NewGoogleCloudOutputConfig

func NewGoogleCloudOutputConfig(operatorID string) *GoogleCloudOutputConfig

NewGoogleCloudOutputConfig creates a new google cloud output config with default

func (GoogleCloudOutputConfig) Build

Build will build a google cloud output operator.

type GoogleEntryBuilder added in v1.4.0

type GoogleEntryBuilder struct {
	MaxEntrySize  int
	ProjectID     string
	LogNameField  *entry.Field
	LocationField *entry.Field
	TraceField    *entry.Field
	SpanIDField   *entry.Field
}

GoogleEntryBuilder is used to build google cloud logging entries

func (*GoogleEntryBuilder) Build added in v1.4.0

func (g *GoogleEntryBuilder) Build(entry *entry.Entry) (*logging.LogEntry, error)

Build builds a google cloud logging entry from a stanza entry. The size of the resulting entry is also returned.

type GoogleRequestBuilder added in v1.4.0

type GoogleRequestBuilder struct {
	MaxRequestSize int
	ProjectID      string
	EntryBuilder   EntryBuilder
	*zap.SugaredLogger
}

GoogleRequestBuilder builds google cloud logging requests

func (*GoogleRequestBuilder) Build added in v1.4.0

func (g *GoogleRequestBuilder) Build(entries []*entry.Entry) []*logging.WriteLogEntriesRequest

Build builds a series of write requests from stanza entries

type RequestBuilder added in v1.4.0

type RequestBuilder interface {
	Build(entries []*entry.Entry) []*logging.WriteLogEntriesRequest
}

RequestBuilder is an interface for creating requests to the google logging API

type ResourceKey added in v1.4.0

type ResourceKey = string

ResourceKey is a key used to distinguish a resource

type ResourceType added in v1.4.0

type ResourceType = string

ResourceType is a monitored resource type

Jump to

Keyboard shortcuts

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