Documentation ¶
Overview ¶
Package cortex provides a Cortex exporter. It provides functionality to sends cumulative metric data Cortex using the Prometheus Remote Write API.
Deprecated: This package is no longer supported. Use the go.opentelemetry.io/otel/exporters/otlp/otlpmetric exporter as a replacement to send data to a collector which can then export with its PRW exporter.
Index ¶
- Variables
- func InstallNewPipeline(config Config, options ...controller.Option) (*controller.Controller, error)
- func NewExportPipeline(config Config, options ...controller.Option) (*controller.Controller, error)
- func SemVersion() string
- func Version() string
- type Config
- type Exporter
- func (e *Exporter) ConvertToTimeSeries(res *resource.Resource, checkpointSet export.InstrumentationLibraryReader) ([]prompb.TimeSeries, error)
- func (e *Exporter) Export(_ context.Context, res *resource.Resource, ...) error
- func (e *Exporter) TemporalityFor(*sdkapi.Descriptor, aggregation.Kind) aggregation.Temporality
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTwoPasswords occurs when the YAML file contains both `password` and // `password_file`. ErrTwoPasswords = fmt.Errorf("cannot have two passwords in the YAML file") // ErrTwoBearerTokens occurs when the YAML file contains both `bearer_token` and // `bearer_token_file`. ErrTwoBearerTokens = fmt.Errorf("cannot have two bearer tokens in the YAML file") // ErrConflictingAuthorization occurs when the YAML file contains both BasicAuth and // bearer token authorization ErrConflictingAuthorization = fmt.Errorf("cannot have both basic auth and bearer token authorization") // ErrNoBasicAuthUsername occurs when no username was provided for basic // authentication. ErrNoBasicAuthUsername = fmt.Errorf("no username provided for basic authentication") // ErrNoBasicAuthPassword occurs when no password or password file was provided for // basic authentication. ErrNoBasicAuthPassword = fmt.Errorf("no password or password file provided for basic authentication") // ErrInvalidQuantiles occurs when the supplied quantiles are not between 0 and 1. ErrInvalidQuantiles = fmt.Errorf("cannot have quantiles that are less than 0 or greater than 1") )
var ErrFailedToReadFile = fmt.Errorf("failed to read password / bearer token file")
ErrFailedToReadFile occurs when a password / bearer token file exists, but could not be read.
Functions ¶
func InstallNewPipeline ¶
func InstallNewPipeline(config Config, options ...controller.Option) (*controller.Controller, error)
InstallNewPipeline registers a push Controller's MeterProvider globally.
func NewExportPipeline ¶
func NewExportPipeline(config Config, options ...controller.Option) (*controller.Controller, error)
NewExportPipeline sets up a complete export pipeline with a push Controller and Exporter.
func SemVersion ¶ added in v0.25.0
func SemVersion() string
SemVersion is the semantic version to be supplied to tracer/meter creation.
Types ¶
type Config ¶
type Config struct { Endpoint string `mapstructure:"url"` RemoteTimeout time.Duration `mapstructure:"remote_timeout"` Name string `mapstructure:"name"` BasicAuth map[string]string `mapstructure:"basic_auth"` BearerToken string `mapstructure:"bearer_token"` BearerTokenFile string `mapstructure:"bearer_token_file"` TLSConfig map[string]string `mapstructure:"tls_config"` ProxyURL *url.URL `mapstructure:"proxy_url"` PushInterval time.Duration `mapstructure:"push_interval"` Quantiles []float64 `mapstructure:"quantiles"` HistogramBoundaries []float64 `mapstructure:"histogram_boundaries"` Headers map[string]string `mapstructure:"headers"` Client *http.Client }
Config contains properties the Exporter uses to export metrics data to Cortex.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter forwards metrics to a Cortex instance
func NewRawExporter ¶
NewRawExporter validates the Config struct and creates an Exporter with it.
func (*Exporter) ConvertToTimeSeries ¶
func (e *Exporter) ConvertToTimeSeries(res *resource.Resource, checkpointSet export.InstrumentationLibraryReader) ([]prompb.TimeSeries, error)
ConvertToTimeSeries converts a InstrumentationLibraryReader to a slice of TimeSeries pointers Based on the aggregation type, ConvertToTimeSeries will call helper functions like convertFromSum to generate the correct number of TimeSeries.
func (*Exporter) Export ¶
func (e *Exporter) Export(_ context.Context, res *resource.Resource, checkpointSet export.InstrumentationLibraryReader) error
Export forwards metrics to Cortex from the SDK
func (*Exporter) TemporalityFor ¶ added in v0.27.0
func (e *Exporter) TemporalityFor(*sdkapi.Descriptor, aggregation.Kind) aggregation.Temporality
TemporalityFor returns CumulativeExporter so the Processor correctly aggregates data