Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSchema ¶
type DataSchema struct { DataSource string `json:"dataSource"` Parser Parser `json:"parser"` MetricsSpec []Metric `json:"metricsSpec"` GranularitySpec GranularitySpec `json:"granularitySpec"` }
DataSchema represents the Druid dataSchema spec. Right now only the legacy spec is supported.
type DimensionsSpec ¶
type DimensionsSpec struct {
Dimensions LabelSet `json:"dimensions"`
}
DimensionsSpec is responsible for configuring Druid's dimensions. They're a set of columns in Druid's data model that can be used for grouping, filtering or applying aggregations.
type FlattenSpec ¶
type FlattenSpec struct {
Fields FieldList `json:"fields"`
}
FlattenSpec responsible for bridging the gap between potentially nested input data (such as JSON, Avro, etc) and Druid's flat data model.
type GranularitySpec ¶
type GranularitySpec struct { Type string `json:"type"` SegmentGranularity string `json:"segmentGranularity"` QueryGranularity string `json:"queryGranularity"` }
GranularitySpec allows for configuring operations such as data segment partitioning, truncating timestamps, time chunk segmentation or roll-up.
type IOConfig ¶
type IOConfig struct { Topic string `json:"topic"` ConsumerProperties KafkaConsumerProperties `json:"consumerProperties"` TaskDuration string `json:"taskDuration"` UseEarliestOffset bool `json:"useEarliestOffset"` }
IOConfig influences how data is read into Druid from a source system. Right now only Kafka is supported.
type KafkaConsumerProperties ¶
type KafkaConsumerProperties struct { BootstrapServers string `json:"bootstrap.servers"` SecurityProtocol *string `json:"security.protocol,omitempty"` SSLTruststoreType *string `json:"ssl.truststore.type,omitempty"` SSLEnabledProtocols *string `json:"ssl.enabled.protocols,omitempty"` SSLTruststoreLocation *string `json:"ssl.truststore.location,omitempty"` SSLTruststorePassword *PasswordProvider `json:"ssl.truststore.password,omitempty"` SSLKeystoreLocation *string `json:"ssl.keystore.location,omitempty"` SSLKeystorePassword *PasswordProvider `json:"ssl.keystore.password,omitempty"` }
KafkaConsumerProperties is a set of properties that is passed to the Kafka consumer.
type KafkaIngestionSpec ¶
type KafkaIngestionSpec struct { Type string `json:"type"` DataSchema DataSchema `json:"dataSchema"` IOConfig IOConfig `json:"ioConfig"` }
KafkaIngestionSpec is the root-level type defining an ingestion spec used by Apache Druid.
func NewKafkaIngestionSpec ¶
func NewKafkaIngestionSpec(options ...KafkaIngestionSpecOptions) *KafkaIngestionSpec
NewKafkaIngestionSpec returns a default KafkaIngestionSpec and applies any options passed to it.
type KafkaIngestionSpecOptions ¶
type KafkaIngestionSpecOptions func(*KafkaIngestionSpec)
KafkaIngestionSpecOptions allows for configuring a KafkaIngestionSpec.
func ApplySSLConfig ¶
func ApplySSLConfig() KafkaIngestionSpecOptions
ApplySSLConfig adds an opinionated SSL config that is used for communicating with Kafka securely.
func SetBrokers ¶
func SetBrokers(brokers string) KafkaIngestionSpecOptions
SetBrokers sets the addresses of Kafka brokers. E.g. 'kafka01:9092, kafka02:9092,kafka03:9092'.
func SetDataSource ¶
func SetDataSource(ds string) KafkaIngestionSpecOptions
SetDataSource sets the name of the dataSource used in Druid.
func SetLabels ¶
func SetLabels(labels LabelSet) KafkaIngestionSpecOptions
SetLabels uses a LabelSet to configure the ingestion spec with. This sets the FieldList under FlattenSpec, as well as Dimensions.
func SetTopic ¶
func SetTopic(topic string) KafkaIngestionSpecOptions
SetTopic sets the Kafka topic to consume data from.
type LabelSet ¶
type LabelSet []string
LabelSet is a unique set of Prometheus labels.
func ExtractUniqueLabels ¶
ExtractUniqueLabels extracts unique labels from a Prometheus query result.
func (LabelSet) ToDimensions ¶
ToDimensions converts a LabelSet to a slice of strings that can be used for Druids Dimensions. It also adds the dimension 'name' to the slice.
func (LabelSet) ToFieldList ¶
ToFieldList converts a LabelSet to a FieldList
type Metric ¶
type Metric struct { Name string `json:"name"` Type string `json:"type"` FieldName string `json:"fieldName,omitempty"` }
Metric is a Druid aggregator that is applied at ingestion time.
type ParseSpec ¶
type ParseSpec struct { Format string `json:"format"` TimeStampSpec TimestampSpec `json:"timestampSpec"` FlattenSpec FlattenSpec `json:"flattenSpec"` DimensionsSpec DimensionsSpec `json:"dimensionsSpec"` }
ParseSpec represents the parseSpec object under Parser.
type Parser ¶
Parser is responsible for configuring a wide variety of items related to parsing input records.
type PasswordProvider ¶
PasswordProvider allows Druid to configure secrets via environment variables.
type TimestampSpec ¶
TimestampSpec is responsible for configuring the primary timestamp.