Documentation
¶
Overview ¶
Package exporter defines a metrics exporter interface that is used by an agent to export metrics into the desired metrics provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize(ctx *appcontext.Context, provider Provider) (ExportFunc, GetterFunc, error)
Initialize method initializes the exporter and returns a function that exports the metrics.
Types ¶
type ExportFunc ¶
ExportFunc is the function that is used to export the metrics into the provider.
type Exporter ¶
type Exporter interface { // Provision provisions the exporter. Creates database connection and // sets other configuration for the exporter. Provision(*appcontext.Context, Provider) error // Export is the function that does the actual exporting. Export(context.Context, []checker.Metric) error // GetMetrics get the metrics for the given check IDs. It accepts a `duration` // parameter that fetches metrics for the check in the past `duration`. // // In the resultant map, each of the metrics array should be ordered in // descending order of their start times. This process usually happens in // the database much quicker than processing it on here so it is required // that the exporter returns metrics in the correct order. GetMetrics(_ context.Context, _ time.Duration, checkIDs ...string) (map[string][]checker.Metric, error) }
Exporter is anything that can export metrics into the database provider.
type GetterFunc ¶
type GetterFunc = func(context.Context, time.Duration, ...string) (map[string][]checker.Metric, error)
GetterFunc is the function that fetches metrics from the database for the given checks.
type Provider ¶
type Provider interface { GetBackend() string // Returns the provider backend name. GetHost() string // Returns the host. GetPort() uint16 // Returns the port. GetDBName() string // Returns the database name. GetUsername() string // Returns the username. GetPassword() string // Returns the password. IsSSLMode() bool // Tells if connection is through SSL mode. }
Provider is anything that can be used to configure and create a metrics exporter.
Directories
¶
Path | Synopsis |
---|---|
Package influxdb implements the influxdb exporter.
|
Package influxdb implements the influxdb exporter. |
Package log implements the log metrics exporter.
|
Package log implements the log metrics exporter. |
Package timescale implements the timescale metrics exporter.
|
Package timescale implements the timescale metrics exporter. |
Click to show internal directories.
Click to hide internal directories.