observe

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Package observe provides functions that help with setting tracing/metrics in cloud providers, mainly GCP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGAEInfo

func GetGAEInfo() (projectID, service, version string)

GetGAEInfo returns the GCP Project ID, the service, and the version of the application.

func GetServiceInfo

func GetServiceInfo() (projectID, service, version string)

GetServiceInfo returns the GCP Project ID, the service name and version (GAE or through SERVICE_NAME/SERVICE_VERSION env vars). Note that SERVICE_NAME/SERVICE_VERSION are not standard but your application can pass them in as variables to be included in your trace attributes

func GoogleProjectID

func GoogleProjectID() string

GoogleProjectID returns the GCP Project ID that can be used to instantiate various GCP clients such as Stack Driver.

func IsGAE

func IsGAE() bool

IsGAE tells you whether your program is running within the App Engine platform.

func IsGCPEnabled

func IsGCPEnabled() bool

IsGCPEnabled returns whether the running application is inside GCP or has access to its products.

func NewStackdriverExporter

func NewStackdriverExporter(projectID string, onErr func(error)) (*stackdriver.Exporter, error)

NewStackdriverExporter will return the tracing and metrics through the stack driver exporter, if exists in the underlying platform. If exporter is registered, it returns the exporter so you can register it and ensure to call Flush on termination.

Types

This section is empty.

Jump to

Keyboard shortcuts

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