Documentation
¶
Overview ¶
Package remotewrite is a k6 output that sends metrics to a Prometheus remote write endpoint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapSeries ¶
func MapSeries(series metrics.TimeSeries, suffix string) []*prompb.Label
MapSeries converts a k6 time series into the equivalent set of Labels (name+tags) as expected from the Prometheus' data model.
The labels are lexicographic sorted as required from the Remote write's specification.
Types ¶
type Config ¶
type Config struct {
// ServerURL contains the absolute ServerURL for the Write endpoint where to flush the time series.
ServerURL null.String `json:"url"`
// Headers contains additional headers that should be included in the HTTP requests.
Headers map[string]string `json:"headers"`
// InsecureSkipTLSVerify skips TLS client side checks.
InsecureSkipTLSVerify null.Bool `json:"insecureSkipTLSVerify"`
// Username is the User for Basic Auth.
Username null.String `json:"username"`
// Password is the Password for the Basic Auth.
Password null.String `json:"password"`
// PushInterval defines the time between flushes. The Output will wait the set time
// before push a new set of time series to the endpoint.
PushInterval types.NullDuration `json:"pushInterval"`
// TrendAsNativeHistogram defines if the mapping for metrics defined as Trend type
// should map to a Prometheus' Native Histogram.
TrendAsNativeHistogram null.Bool `json:"trendAsNativeHistogram"`
// TrendStats defines the stats to flush for Trend metrics.
//
// TODO: should we support K6_SUMMARY_TREND_STATS?
TrendStats []string `json:"trendStats"`
StaleMarkers null.Bool `json:"staleMarkers"`
}
Config contains the configuration for the Output.
func GetConsolidatedConfig ¶
func GetConsolidatedConfig(jsonRawConf json.RawMessage, env map[string]string, url string) (Config, error)
GetConsolidatedConfig combines the options' values from the different sources and returns the merged options. The Order of precedence used is documented in the k6 Documentation https://k6.io/docs/using-k6/k6-options/how-to/#order-of-precedence.
func (Config) RemoteConfig ¶
func (conf Config) RemoteConfig() (*remote.HTTPConfig, error)
RemoteConfig creates a configuration for the HTTP Remote-write client.
type Output ¶
type Output struct {
output.SampleBuffer
// contains filtered or unexported fields
}
Output is a k6 output that sends metrics to a Prometheus remote write endpoint.
func (*Output) Description ¶
Description returns a short human-readable description of the output.