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.