Documentation ¶
Overview ¶
Package surfacers is a generated protocol buffer package.
It is generated from these files:
github.com/google/cloudprober/surfacers/config.proto
It has these top-level messages:
SurfacerDef
Package surfacers is the base package for creating Surfacer objects that are used for writing metics data to different monitoring services.
Any Surfacer that is created for writing metrics data to a monitor system should implement the below Surfacer interface and should accept metrics.EventMetrics object through a Write() call. Each new surfacer should also plug itself in through the New() method defined here.
Index ¶
- Variables
- func Register(name string, s Surfacer)
- type Surfacer
- type SurfacerDef
- func (*SurfacerDef) Descriptor() ([]byte, []int)
- func (m *SurfacerDef) GetFileSurfacer() *cloudprober_surfacer_file.SurfacerConf
- func (m *SurfacerDef) GetName() string
- func (m *SurfacerDef) GetPrometheusSurfacer() *cloudprober_surfacer_prometheus.SurfacerConf
- func (m *SurfacerDef) GetStackdriverSurfacer() *cloudprober_surfacer_stackdriver.SurfacerConf
- func (m *SurfacerDef) GetSurfacer() isSurfacerDef_Surfacer
- func (m *SurfacerDef) GetType() Type
- func (*SurfacerDef) ProtoMessage()
- func (m *SurfacerDef) Reset()
- func (m *SurfacerDef) String() string
- func (*SurfacerDef) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type SurfacerDef_FileSurfacer
- type SurfacerDef_PrometheusSurfacer
- type SurfacerDef_StackdriverSurfacer
- type Type
Constants ¶
This section is empty.
Variables ¶
var Type_name = map[int32]string{
0: "NONE",
1: "PROMETHEUS",
2: "STACKDRIVER",
3: "FILE",
99: "USER_DEFINED",
}
var Type_value = map[string]int32{
"NONE": 0,
"PROMETHEUS": 1,
"STACKDRIVER": 2,
"FILE": 3,
"USER_DEFINED": 99,
}
Functions ¶
func Register ¶
Register allows you to register a user defined surfacer with cloudprober. Example usage:
import ( "github.com/google/cloudprober" "github.com/google/cloudprober/surfacers" ) s := &FancySurfacer{} surfacers.Register("fancy_surfacer", s) pr, err := cloudprober.InitFromConfig(*configFile) if err != nil { log.Exitf("Error initializing cloudprober. Err: %v", err) }
Types ¶
type Surfacer ¶
type Surfacer interface { // Function for writing a piece of metric data to a specified metric // store (or other location). Write(ctx context.Context, em *metrics.EventMetrics) }
Surfacer is the base class for all metrics surfacing systems
func Init ¶
func Init(sDefs []*SurfacerDef) ([]Surfacer, error)
Init initializes the surfacers from the config protobufs and returns them as a list.
type SurfacerDef ¶
type SurfacerDef struct { // This name is used for logging. If not defined, it's derived from the type. // Note that this field is required for the USER_DEFINED surfacer type and // should match with the name that you used while registering the user defined // surfacer. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Type *Type `protobuf:"varint,2,opt,name=type,enum=cloudprober.surfacer.Type" json:"type,omitempty"` // Matching surfacer specific configuration (one for each type in the above // enum) // // Types that are valid to be assigned to Surfacer: // *SurfacerDef_PrometheusSurfacer // *SurfacerDef_StackdriverSurfacer // *SurfacerDef_FileSurfacer Surfacer isSurfacerDef_Surfacer `protobuf_oneof:"surfacer"` XXX_unrecognized []byte `json:"-"` }
func (*SurfacerDef) Descriptor ¶
func (*SurfacerDef) Descriptor() ([]byte, []int)
func (*SurfacerDef) GetFileSurfacer ¶
func (m *SurfacerDef) GetFileSurfacer() *cloudprober_surfacer_file.SurfacerConf
func (*SurfacerDef) GetName ¶
func (m *SurfacerDef) GetName() string
func (*SurfacerDef) GetPrometheusSurfacer ¶
func (m *SurfacerDef) GetPrometheusSurfacer() *cloudprober_surfacer_prometheus.SurfacerConf
func (*SurfacerDef) GetStackdriverSurfacer ¶
func (m *SurfacerDef) GetStackdriverSurfacer() *cloudprober_surfacer_stackdriver.SurfacerConf
func (*SurfacerDef) GetSurfacer ¶
func (m *SurfacerDef) GetSurfacer() isSurfacerDef_Surfacer
func (*SurfacerDef) GetType ¶
func (m *SurfacerDef) GetType() Type
func (*SurfacerDef) ProtoMessage ¶
func (*SurfacerDef) ProtoMessage()
func (*SurfacerDef) Reset ¶
func (m *SurfacerDef) Reset()
func (*SurfacerDef) String ¶
func (m *SurfacerDef) String() string
func (*SurfacerDef) XXX_OneofFuncs ¶
func (*SurfacerDef) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
type SurfacerDef_FileSurfacer ¶
type SurfacerDef_FileSurfacer struct {
FileSurfacer *cloudprober_surfacer_file.SurfacerConf `protobuf:"bytes,12,opt,name=file_surfacer,json=fileSurfacer,oneof"`
}
type SurfacerDef_PrometheusSurfacer ¶
type SurfacerDef_PrometheusSurfacer struct {
PrometheusSurfacer *cloudprober_surfacer_prometheus.SurfacerConf `protobuf:"bytes,10,opt,name=prometheus_surfacer,json=prometheusSurfacer,oneof"`
}
type SurfacerDef_StackdriverSurfacer ¶
type SurfacerDef_StackdriverSurfacer struct {
StackdriverSurfacer *cloudprober_surfacer_stackdriver.SurfacerConf `protobuf:"bytes,11,opt,name=stackdriver_surfacer,json=stackdriverSurfacer,oneof"`
}
type Type ¶
type Type int32
Enumeration for each type of surfacer we can parse and create
func (Type) EnumDescriptor ¶
func (*Type) UnmarshalJSON ¶
Directories ¶
Path | Synopsis |
---|---|
Package file is a generated protocol buffer package.
|
Package file is a generated protocol buffer package. |
Package prometheus is a generated protocol buffer package.
|
Package prometheus is a generated protocol buffer package. |
Package stackdriver is a generated protocol buffer package.
|
Package stackdriver is a generated protocol buffer package. |