monitoring

package
v0.0.0-...-eb19a62 Latest Latest
Warning

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

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

Documentation

Overview

Package monitoring implements the functionality to export timeseries data to the Cloud Monitoring service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureExport

func ConfigureExport(ctx context.Context, cl *Client, cred string) error

ConfigureExport prepares a Client for exporting metrics. It fetches metadata about the GCP environment and fails if not running on GCE or GKE.

Types

type Client

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

Client exports metrics to the Cloud Monitoring Service.

func NewClient

func NewClient() *Client

NewClient returns a client that can be used for creating, incrementing, and retrieving metrics but not for exporting them.

func (*Client) Inc

func (m *Client) Inc(name string)

Inc increments a metric or does nothing if the client is nil.

func (*Client) NewInt64

func (m *Client) NewInt64(name string)

NewInt64 creates a new cumulative int64 metric with the given name or does nothing if the client is nil. If the same name is used multiple times, only the last returned Metric is exported.

func (*Client) StartExport

func (m *Client) StartExport(ctx context.Context, minStartDelay int, startDelayInterval int) error

Run sends the metrics to the monitoring service roughly once a minute.

func (*Client) Value

func (m *Client) Value(name string) int64

Value gets the value of a metric or returns 0 if the client is nil.

Jump to

Keyboard shortcuts

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