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 ¶ added in v0.0.4
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"` // ClientCertificate is the public key of the SSL certificate. // It is expected the path of the certificate on the file system. // If it is required a dedicated Certifacate Authority then it should be added // to the conventional folders defined by the operating system's registry. ClientCertificate null.String `json:"clientCertificate"` // ClientCertificateKey is the private key of the SSL certificate. // It is expected the path of the certificate on the file system. ClientCertificateKey null.String `json:"clientCertificateKey"` // BearerToken if set is the token used for the `Authorization` header. BearerToken null.String `json:"bearerToken"` // 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"` // SigV4Region is the AWS region where the workspace is. SigV4Region null.String `json:"sigV4Region"` // SigV4AccessKey is the AWS access key. SigV4AccessKey null.String `json:"sigV4AccessKey"` // SigV4SecretKey is the AWS secret key. SigV4SecretKey null.String `json:"sigV4SecretKey"` }
Config contains the configuration for the Output.
func GetConsolidatedConfig ¶
func GetConsolidatedConfig(jsonRawConf json.RawMessage, env map[string]string, _ 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 ¶ added in v0.0.5
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.