Documentation
¶
Index ¶
- Variables
- type BigqueryClient
- func (c *BigqueryClient) Collect(ch chan<- prometheus.Metric)
- func (c *BigqueryClient) Describe(ch chan<- *prometheus.Desc)
- func (c BigqueryClient) Name() string
- func (c *BigqueryClient) Read(req *prompb.ReadRequest) (*prompb.ReadResponse, error)
- func (c *BigqueryClient) Write(timeseries []*prompb.TimeSeries) error
- type ClientOption
- type Item
- type PromotedColumn
Constants ¶
This section is empty.
Variables ¶
var CoreColumns = []string{"value", "metricname", "timestamp", "tags"}
CoreColumns are the column names every row always carries. Promoted columns may never use these names, so a promoted key can never shadow a core field.
Functions ¶
This section is empty.
Types ¶
type BigqueryClient ¶
type BigqueryClient struct {
// contains filtered or unexported fields
}
BigqueryClient allows sending batches of Prometheus samples to Bigquery.
func NewClient ¶
func NewClient(logger *slog.Logger, googleAPIjsonkeypath, googleProjectID, googleAPIdatasetID, googleAPItableID string, remoteTimeout time.Duration, opts ...ClientOption) *BigqueryClient
NewClient creates a new Client.
func (*BigqueryClient) Collect ¶
func (c *BigqueryClient) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*BigqueryClient) Describe ¶
func (c *BigqueryClient) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
func (BigqueryClient) Name ¶
func (c BigqueryClient) Name() string
Name identifies the client as a BigQuery client.
func (*BigqueryClient) Read ¶ added in v0.2.0
func (c *BigqueryClient) Read(req *prompb.ReadRequest) (*prompb.ReadResponse, error)
Read queries the database and returns the results to Prometheus
func (*BigqueryClient) Write ¶
func (c *BigqueryClient) Write(timeseries []*prompb.TimeSeries) error
Write sends a batch of samples to BigQuery via the client.
type ClientOption ¶ added in v0.10.0
type ClientOption func(*BigqueryClient)
ClientOption customizes a BigqueryClient. Options are variadic so that the existing NewClient signature stays source-compatible for current callers.
func WithPromotedLabels ¶ added in v0.10.0
func WithPromotedLabels(cols []PromotedColumn) ClientOption
WithPromotedLabels configures labels to be promoted into their own columns.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents a row item.
type PromotedColumn ¶ added in v0.10.0
PromotedColumn maps a Prometheus label onto a dedicated top-level BigQuery column. StripPort removes a trailing :port from the value. OmitEmpty drops the key entirely when the label is absent, so the column is stored as NULL; without it the column is written on every row (empty string when the label is absent) so that a REQUIRED column can never be violated.