Documentation
¶
Index ¶
- Constants
- Variables
- func CloneMetricData(src []*dto.MetricFamily) ([]*dto.MetricFamily, error)
- func CoordinationRedisErrors(errorType string)
- func DequeuedEvent(destinationType, destinationName string)
- func DequeuedRecognitionEvent(identifier string)
- func Enabled() bool
- func EnqueuedEvent(destinationType, destinationName string)
- func EnqueuedRecognitionEvent(identifier string)
- func ErrorObjects(sourceType, sourceTap, sourceName string, value int)
- func ErrorSourceEvents(sourceType, sourceTap, sourceName, destinationType, destinationName string, ...)
- func ErrorTokenEvent(tokenID, destinationType, destinationName string)
- func ErrorTokenEvents(tokenID, destinationType, destinationName string, value int)
- func ErrorTokenObjects(tokenID string, value int)
- func EventsRedisErrors(errorType string)
- func FreeSourcesGoroutines(value int)
- func Handler() http.Handler
- func Init(exported bool, auth bool, endpoint string)
- func InitialUsersRecognitionQueueSize(identifier string, value int)
- func MetaRedisErrors(errorType string)
- func NewCounterVec(opts prometheus.CounterOpts, labels []string) *prometheus.CounterVec
- func NewGaugeVec(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec
- func NewHistogramVec(opts prometheus.HistogramOpts, labels []string) *prometheus.HistogramVec
- func RecognitionEvent(metricType RecognitionMetric, tokenID string, value int)
- func RunningSourcesGoroutines(value int)
- func SetStreamEventsBufferSize(destinationType, destinationName string, value int)
- func SetStreamEventsQueueSize(destinationType, destinationName string, value int)
- func SkipTokenEvent(tokenID, destinationType, destinationName string)
- func SkipTokenEvents(tokenID, destinationType, destinationName string, value int)
- func SuccessObjects(sourceType, sourceTap, sourceName string, value int)
- func SuccessSourceEvents(sourceType, sourceTap, sourceName, destinationType, destinationName string, ...)
- func SuccessTokenEvent(tokenID, destinationType, destinationName string)
- func SuccessTokenEvents(tokenID, destinationType, destinationName string, value int)
- func SuccessTokenObjects(tokenID string, value int)
- func TransformErrors(destinationId string)
- func TransformKeyValueDel(destinationId string)
- func TransformKeyValueGet(destinationId string)
- func TransformKeyValueRedisErrors(errorType string)
- func TransformKeyValueSet(destinationId string, size int)
- func UserRecognitionRedisErrors(errorType string)
- type RecognitionMetric
- type Relay
- type RelayData
- type RelayTrigger
- type TickerTrigger
Constants ¶
View Source
const ( TokenSourceType = "token" EmptySourceTap = "" )
View Source
const Unknown = "unknown"
Variables ¶
View Source
var Auth bool
View Source
var DefaultRelayURL = "https://cplane.jitsu.com/api/prometheus/relay/submit"
DefaultRelayURL is the URL which is used by default for relaying metrics.
View Source
var Endpoint string
View Source
var Exported bool
View Source
var Registry *prometheus.Registry
View Source
var SensitiveLabels = map[string]bool{ "source_id": true, "destination_id": true, }
SensitiveLabels are label names which values should be hashed in order to respect users' privacy.
Functions ¶
func CloneMetricData ¶
func CloneMetricData(src []*dto.MetricFamily) ([]*dto.MetricFamily, error)
func CoordinationRedisErrors ¶
func CoordinationRedisErrors(errorType string)
func DequeuedEvent ¶
func DequeuedEvent(destinationType, destinationName string)
func DequeuedRecognitionEvent ¶
func DequeuedRecognitionEvent(identifier string)
func EnqueuedEvent ¶
func EnqueuedEvent(destinationType, destinationName string)
func EnqueuedRecognitionEvent ¶
func EnqueuedRecognitionEvent(identifier string)
func ErrorObjects ¶
func ErrorSourceEvents ¶
func ErrorTokenEvent ¶
func ErrorTokenEvent(tokenID, destinationType, destinationName string)
func ErrorTokenEvents ¶
func ErrorTokenObjects ¶
func EventsRedisErrors ¶
func EventsRedisErrors(errorType string)
func FreeSourcesGoroutines ¶
func FreeSourcesGoroutines(value int)
func MetaRedisErrors ¶
func MetaRedisErrors(errorType string)
func NewCounterVec ¶
func NewCounterVec(opts prometheus.CounterOpts, labels []string) *prometheus.CounterVec
func NewGaugeVec ¶
func NewGaugeVec(opts prometheus.GaugeOpts, labels []string) *prometheus.GaugeVec
func NewHistogramVec ¶
func NewHistogramVec(opts prometheus.HistogramOpts, labels []string) *prometheus.HistogramVec
func RecognitionEvent ¶
func RecognitionEvent(metricType RecognitionMetric, tokenID string, value int)
func RunningSourcesGoroutines ¶
func RunningSourcesGoroutines(value int)
func SkipTokenEvent ¶
func SkipTokenEvent(tokenID, destinationType, destinationName string)
func SkipTokenEvents ¶
func SuccessObjects ¶
func SuccessSourceEvents ¶
func SuccessTokenEvent ¶
func SuccessTokenEvent(tokenID, destinationType, destinationName string)
func SuccessTokenEvents ¶
func SuccessTokenObjects ¶
func TransformErrors ¶
func TransformErrors(destinationId string)
func TransformKeyValueDel ¶
func TransformKeyValueDel(destinationId string)
func TransformKeyValueGet ¶
func TransformKeyValueGet(destinationId string)
func TransformKeyValueRedisErrors ¶
func TransformKeyValueRedisErrors(errorType string)
func TransformKeyValueSet ¶
func UserRecognitionRedisErrors ¶
func UserRecognitionRedisErrors(errorType string)
Types ¶
type RecognitionMetric ¶
type RecognitionMetric int
const ( TotalEvents RecognitionMetric = iota AnonymousEvents IdentifiedEvents IdentifiedCacheHits IdentifiedAggregatedEvents RecognizedEvents BotEvents Dummy //to allocate proper array )
type Relay ¶
type Relay struct { URL string HostID string DeploymentID string Timeout time.Duration // contains filtered or unexported fields }
func (*Relay) Relay ¶
Relay is responsible for relaying all metrics data from Registry to some HTTP endpoint via POST request with JSON body (see RelayData) while also hashing sensitive label values.
func (*Relay) Run ¶
func (r *Relay) Run(rootCtx context.Context, trigger RelayTrigger, gatherer prometheus.Gatherer)
type RelayData ¶
type RelayData struct { Timestamp int64 `json:"timestamp"` HostID string `json:"hostId"` DeploymentID string `json:"deploymentId"` Data []*dto.MetricFamily `json:"data"` }
type RelayTrigger ¶
type RelayTrigger interface { // Channel returns the channel which events are emitted to. // The returned channel values are ignored. Channel() <-chan time.Time // Stop stops this trigger from emitting events. Stop() }
RelayTrigger is basically an interface of time.Ticker. Triggers are responsible for emitting events on the channel returned by Channel when some conditions for relay execution are met.
type TickerTrigger ¶
TickerTrigger wraps the stdlib time.Ticker into RelayTrigger interface.
func (TickerTrigger) Channel ¶
func (t TickerTrigger) Channel() <-chan time.Time
Click to show internal directories.
Click to hide internal directories.