telemetry

package
v0.0.0-...-1825ddb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DefaultQueryLimit the default query limit for results
	DefaultQueryLimit int = 1000
	//DefaultBaseURL is the default Domain and Protocol for quering against the Metrics API
	DefaultBaseURL string = "https://api.telemetry.confluent.cloud"
	//DefaultMaxWorkers controls the max number of workers in a given Worker Pool that will be spawned
	DefaultMaxWorkers int = 5

	//DatasetCloud constant name for the CCloud dataset
	DatasetCloud  Dataset = "cloud"
	DatasetHosted Dataset = "hosted-monitoring"
)

Variables

View Source
var (
	//AvailableDatasets Constant for the currently known available Datasets
	AvailableDatasets []Dataset = []Dataset{
		DatasetCloud,
	}
)

Functions

This section is empty.

Types

type Dataset

type Dataset string

Dataset struct to referece the selected dataset

type TelemetryAPIPath

type TelemetryAPIPath client.APIPath
const (
	APIPathQuery               TelemetryAPIPath = "metrics/%s/query"
	APIPathAttributes          TelemetryAPIPath = "metrics/%s/attributes"
	APIPathDescriptor          TelemetryAPIPath = "metrics/%s/descriptors"
	APIPathDescriptorMetrics   TelemetryAPIPath = "metrics/%s/descriptors/metrics"
	APIPathDescriptorResources TelemetryAPIPath = "metrics/%s/descriptors/resources"
)

func (TelemetryAPIPath) Format

func (p TelemetryAPIPath) Format(client TelemetryClient, apiVersion int8) string

type TelemetryClient

type TelemetryClient struct {
	client.Client
	PageLimit  int
	DataSet    Dataset
	MaxWorkers int
}

TelemetryClient is the SDK Client for making REST calls to the Confluent Metrics API

func New

func New(apiKey string, apiSecret string) TelemetryClient

New Used to create a new MetricsClient from the given minimal set of properties

func (*TelemetryClient) GetAvailableMetrics

func (client *TelemetryClient) GetAvailableMetrics() ([]metric.Metric, error)

GetAvailableMetrics returns a collection of all the available metrics and their supported labels among other important meta data for Kafka Clusters

func (*TelemetryClient) GetAvailableMetricsForResource

func (client *TelemetryClient) GetAvailableMetricsForResource(resourceType resourcetype.ResourceType) ([]metric.Metric, error)

GetAvailableMetricsForResource returns a collection of all the available metrics and their supported labels among other important meta data for a given resource type This is also a Preview V2 API feature and may be subject to breakage and/or change at any moment

func (*TelemetryClient) GetAvailableResources

func (client *TelemetryClient) GetAvailableResources() ([]resourcetype.ResourceType, error)

GetAvailableResources returns a collection of all the available metrics and their supported labels among other important meta data. This is also a Preview V2 API feature and may be subject to breakage and/or change at any moment

func (TelemetryClient) GetKafkaRequestTypes

func (client TelemetryClient) GetKafkaRequestTypes(cluster string, inter interval.Interval) ([]string, error)

GetKafkaRequestTypes returns all the available request types for a given Kafka Cluster

func (TelemetryClient) GetKafkaTopicsForMetric

func (client TelemetryClient) GetKafkaTopicsForMetric(cluster string, metric metric.Metric, inter interval.Interval) ([]string, error)

GetKafkaTopicsForMetric returns all the available topics for a given metric within a window of time

func (TelemetryClient) LabelQuery

func (client TelemetryClient) LabelQuery(resourceType labels.Resource, resourceID string, metric metric.Metric, field labels.Label, inter interval.Interval) ([]string, error)

func (*TelemetryClient) PostLabelQuery

func (client *TelemetryClient) PostLabelQuery(query query.Query) (response.Query, error)

func (*TelemetryClient) PostMetricsQuery

func (client *TelemetryClient) PostMetricsQuery(query query.Query) (response.Query, error)

func (*TelemetryClient) PostMetricsQueryAsync

func (client *TelemetryClient) PostMetricsQueryAsync(queryChan <-chan query.Query, resultsChan chan<- response.Query, errsChan chan<- error)

func (TelemetryClient) PostQuery

func (client TelemetryClient) PostQuery(response interface{}, url string, q query.Query) error

PostQuery POST Query to the Telemetry API

func (*TelemetryClient) QueryKafkaMetricAndTopic

func (client *TelemetryClient) QueryKafkaMetricAndTopic(resourceID string, granularity granularity.Granularity, inter interval.Interval, metric metric.Metric, topic string) ([]response.Telemetry, error)

QueryMetricAndTopic returns all the data points for a given metric and topic, aggregated up to the given granularity, within the given window of time

func (*TelemetryClient) QueryKafkaMetricAndTopicWithPartitions

func (client *TelemetryClient) QueryKafkaMetricAndTopicWithPartitions(resourceID string, granularity granularity.Granularity, inter interval.Interval, metric metric.Metric, topic string) ([]response.Telemetry, error)

QueryMetricAndTopicWithPartitions returns all the data points for a given metric and topic, aggregated up to the given granularity, within the given window of time, including aggregations to the partition

func (*TelemetryClient) QueryKafkaMetricAndType

func (client *TelemetryClient) QueryKafkaMetricAndType(resourceID string, granularity granularity.Granularity, inter interval.Interval, metric metric.Metric, reqType string) ([]response.Telemetry, error)

QueryMetricAndType returns all the data points for a given metric and type, aggregated up to the given granularity, within the given window of time

func (*TelemetryClient) QueryKafkaMetricForAllTopics

func (client *TelemetryClient) QueryKafkaMetricForAllTopics(resourceID string, granularity granularity.Granularity, inter interval.Interval, metric metric.Metric) ([]response.Telemetry, error)

QueryMetricForAllTopics returns all the data points, fetched in parallel, for a given metric and all available topics (As returned by GetTopicsForMetric), aggregated up to the given granularity, within the given window of time

func (*TelemetryClient) QueryMetric

func (client *TelemetryClient) QueryMetric(resourceType labels.Resource, resourceID string, granularity granularity.Granularity, inter interval.Interval, metric metric.Metric) ([]response.Telemetry, error)

QueryMetric returns all the data points for a given metric, aggregated up to the given granularity, within the given window of time

func (*TelemetryClient) QueryMetricAndLabel

func (client *TelemetryClient) QueryMetricAndLabel(resourceType labels.Resource, resourceID string, granularity granularity.Granularity, inter interval.Interval, metric metric.Metric, lbl labels.Metric, lblValue string) ([]response.Telemetry, error)

QueryMetricAndLabel returns all the data points for a given metric, aggregated up to the given granularity, within the given window of time

func (*TelemetryClient) QueryMetricAsync

func (client *TelemetryClient) QueryMetricAsync(resourceType labels.Resource, resourceID string, granularity granularity.Granularity, inter interval.Interval, metricChan <-chan metric.Metric, resultsChan chan<- map[string][]response.Telemetry, errsChan chan<- map[string]error)

QueryMetricAsync returns all the data points for a given metric, aggregated up to the given granularity, within the given window of time

func (*TelemetryClient) QueryMetrics

func (client *TelemetryClient) QueryMetrics(resourceType labels.Resource, resourceID string, granularity granularity.Granularity, inter interval.Interval, timeout time.Duration, metrics ...metric.Metric) (map[string][]response.Telemetry, map[string]error)

QueryMetrics returns all the data points for a given metrics, aggregated up to the given granularity, within the given window of time

func (*TelemetryClient) SendDesc

func (client *TelemetryClient) SendDesc() (response.Metrics, error)

func (*TelemetryClient) SendDescMetrics

func (client *TelemetryClient) SendDescMetrics(resourceType resourcetype.ResourceType) (response.Metrics, error)

func (*TelemetryClient) SendDescResources

func (client *TelemetryClient) SendDescResources() (response.Resources, error)

Directories

Path Synopsis
agg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL