Documentation ¶
Overview ¶
Package prometheus is a tRPC metric filter that provides prometheus exporter, Sink and Labels feature.
Index ¶
- func ClientFilter(ctx context.Context, req, rsp interface{}, handler filter.ClientHandleFunc) error
- func GetDefaultPusher() *push.Pusher
- func NewMetricsCache() *metricsCache
- func ServerFilter(ctx context.Context, req interface{}, handler filter.ServerHandleFunc) (rsp interface{}, err error)
- func SetClientBounds(b metrics.BucketBounds)
- func SetServerBounds(b metrics.BucketBounds)
- type Config
- type Plugin
- type Sink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientFilter ¶
func ClientFilter(ctx context.Context, req, rsp interface{}, handler filter.ClientHandleFunc) error
ClientFilter client filter for prome.
func ServerFilter ¶
func ServerFilter(ctx context.Context, req interface{}, handler filter.ServerHandleFunc) (rsp interface{}, err error)
ServerFilter server filter for prome.
func SetClientBounds ¶
func SetClientBounds(b metrics.BucketBounds)
SetClientBounds set client filter buckets.
func SetServerBounds ¶
func SetServerBounds(b metrics.BucketBounds)
SetServerBounds set server filter buckets.
Types ¶
type Config ¶
type Config struct { IP string `yaml:"ip"` //metrics monitoring address. Port int32 `yaml:"port"` //metrics listens to the port. Path string `yaml:"path"` //metrics path. Namespace string `yaml:"namespace"` //formal or test. Subsystem string `yaml:"subsystem"` //default trpc. RawMode bool `yaml:"rawmode"` //by default, the special character in metrics will be converted. EnablePush bool `yaml:"enablepush"` //push is not enabled by default. Password string `yaml:"password"` //account Password. Gateway string `yaml:"gateway"` //push gateway address. PushInterval uint32 `yaml:"pushinterval"` //push interval,default 1s. Job string `yaml:"job"` //reported task name. }
Config config struct.
type Sink ¶
type Sink struct {
// contains filtered or unexported fields
}
Sink struct
func GetDefaultPrometheusSink ¶
func GetDefaultPrometheusSink() *Sink
GetDefaultPrometheusSink get prome sink.
func (*Sink) GetMetricsName ¶
GetMetricsName returns metrics name.
Click to show internal directories.
Click to hide internal directories.