gcpmetric

package
v0.0.0-...-06c6e23 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package gcpmetric implements a metric.Saver that records metrics with Google's Cloud Trace API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSaver

func NewSaver(projectID string, n, maxQPS int, labels ...string) (metric.Saver, error)

NewSaver returns a metric.Saver that saves metrics to GCP Traces for a GCP projectID. The caller must have enabled the StackDriver Traces API for the projectID and have sufficient permission to use the scope "cloud-platform".

A random sampling ratio of 1-to-n is taken. Setting n to 1 reports every event.

A maximum number of outbound network requests per second (maxQPS) when uploading metrics to the GCP backend is enforced. Values equal to or larger than 1000 mean unlimited.

An optional set of string key-value pairs can be given and they will be saved as labels on GCP. They are useful, for example, in the case of differentiating a metric coming from a test instance versus production.

Types

This section is empty.

Jump to

Keyboard shortcuts

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