metrics

package
v0.0.0-...-4f1971e Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

README

Go Reference

golang.org/x/build/internal/metrics

Package metrics provides a service for reporting metrics to Stackdriver, or locally during development.

Documentation

Overview

Package metrics provides a service for reporting metrics to Stackdriver, or locally during development.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MonitoredResource

type MonitoredResource mrpb.MonitoredResource

MonitoredResource wraps a *mrpb.MonitoredResource to implement the monitoredresource.MonitoredResource interface.

func GKEResource

func GKEResource(containerName string) (*MonitoredResource, error)

GKEResource populates a MonitoredResource with GKE Metadata.

The returned MonitoredResource will have the type set to "k8s_container".

func (*MonitoredResource) MonitoredResource

func (r *MonitoredResource) MonitoredResource() (resType string, labels map[string]string)

type Service

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

Service controls metric exporters.

func NewService

func NewService(resource *MonitoredResource, views []*view.View) (*Service, error)

NewService initializes a *Service.

The Service returned is configured to send metric data to StackDriver. When not running on GCE, it will host metrics through a prometheus HTTP handler.

views will be passed to view.Register for export to the metric service.

func (*Service) ServeHTTP

func (m *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Service) Stop

func (m *Service) Stop()

Stop flushes metrics and stops exporting. Stop should be called before exiting.

Jump to

Keyboard shortcuts

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