Documentation ¶
Overview ¶
Package monitoring implements the functionality to export timeseries data to the Cloud Monitoring service.
Index ¶
- type Client
- type ExportingClient
- func (m *ExportingClient) AddLatency(name string, value float64)
- func (m *ExportingClient) EndExport(ctx context.Context)
- func (m *ExportingClient) IncCounter(name string)
- func (m *ExportingClient) NewCounter(name, description string)
- func (m *ExportingClient) NewLatency(name, description string)
- func (m *ExportingClient) StartExport(ctx context.Context, cred string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { IncCounter(name string) NewCounter(name, desc string) AddLatency(name string, value float64) NewLatency(name, desc string) }
Client interface provides basic functionality to create, record and retrieve metric values
type ExportingClient ¶
type ExportingClient struct {
// contains filtered or unexported fields
}
ExportingClient represents a client that exports to Cloud Monitoring
func NewExportingClient ¶
func NewExportingClient() *ExportingClient
NewExportingClient returns a client that can export to metrics to Cloud Monitoring.
func (*ExportingClient) AddLatency ¶
func (m *ExportingClient) AddLatency(name string, value float64)
AddLatency adds a latency metric or does nothing if the client is nil.
func (*ExportingClient) EndExport ¶
func (m *ExportingClient) EndExport(ctx context.Context)
EndExport must be called to ensure all metrics are exported
func (*ExportingClient) IncCounter ¶
func (m *ExportingClient) IncCounter(name string)
IncCounter increases a counter metric or does nothing if the client is nil.
func (*ExportingClient) NewCounter ¶
func (m *ExportingClient) NewCounter(name, description string)
NewCounter creates a new counter metrics or does nothing if the client is nil.
func (*ExportingClient) NewLatency ¶
func (m *ExportingClient) NewLatency(name, description string)
NewLatency creates a new latency metrics or does nothing if the client is nil.
func (*ExportingClient) StartExport ¶
func (m *ExportingClient) StartExport(ctx context.Context, cred string) error
StartExport metrics to the monitoring service roughly once a minute. It fetches metadata about the GCP environment and fails if not running on GCE or GKE.