Documentation
¶
Index ¶
- Variables
- func Serialize(iterableSeries *IterableSeries, iterableSketches *IterableSketches, ...)
- type APIMetricType
- type AddSampleTelemetry
- type CheckMetrics
- func (cm *CheckMetrics) AddSample(contextKey ckey.ContextKey, sample *MetricSample, timestamp float64, ...) error
- func (cm *CheckMetrics) Expire(contextKeys []ckey.ContextKey, timestamp float64)
- func (cm *CheckMetrics) Flush(timestamp float64) ([]*Serie, map[ckey.ContextKey]error)
- func (cm *CheckMetrics) RemoveExpired(timestamp float64)
- type CheckMetricsTelemetryAccumulator
- type ContextMetrics
- type ContextMetricsFlusher
- type Count
- type Counter
- type EnrichTagsfn
- type Gauge
- type Histogram
- type HistogramBucket
- func (m *HistogramBucket) GetHost() string
- func (m *HistogramBucket) GetMetricType() MetricType
- func (m *HistogramBucket) GetName() string
- func (m *HistogramBucket) GetSource() MetricSource
- func (m *HistogramBucket) GetTags(_, metricBuffer tagset.TagsAccumulator, _ EnrichTagsfn)
- func (m *HistogramBucket) IsNoIndex() bool
- type Historate
- type IterableSeries
- type IterableSketches
- type Metric
- type MetricSample
- func (m *MetricSample) Copy() *MetricSample
- func (m *MetricSample) GetHost() string
- func (m *MetricSample) GetMetricType() MetricType
- func (m *MetricSample) GetName() string
- func (m *MetricSample) GetSource() MetricSource
- func (m *MetricSample) GetTags(taggerBuffer, metricBuffer tagset.TagsAccumulator, fn EnrichTagsfn)
- func (m *MetricSample) IsNoIndex() bool
- type MetricSampleBatch
- type MetricSampleContext
- type MetricSamplePool
- type MetricSource
- type MetricType
- type MetricWithTimestamp
- type MonotonicCount
- type NoSerieError
- type Point
- type Rate
- type Resource
- type Serie
- type SerieSink
- type SerieSource
- type Series
- type Set
- type SketchPoint
- type SketchSeries
- type SketchSeriesList
- type SketchesSink
- type SketchesSource
Constants ¶
This section is empty.
Variables ¶
var ( DistributionMetricTypes = map[MetricType]struct{}{ DistributionType: {}, } )
DistributionMetricTypes contains the MetricTypes that are used for percentiles
Functions ¶
func Serialize ¶
func Serialize( iterableSeries *IterableSeries, iterableSketches *IterableSketches, producer func(SerieSink, SketchesSink), serieConsumer func(SerieSource), sketchesConsumer func(SketchesSource), )
Serialize starts the serialization for series and sketches. `producer` callback is responsible for adding the data. It runs in the current goroutine. `serieConsumer` callback is responsible for consuming the series. It runs in its OWN goroutine. `sketchesConsumer` callback is responsible for consuming the sketches. It runs in its OWN goroutine. This function returns when all three `producer`, `serieConsumer` and `sketchesConsumer` functions are finished.
Types ¶
type APIMetricType ¶
type APIMetricType int
APIMetricType represents an API metric type
const ( APIGaugeType APIMetricType = iota APIRateType APICountType )
Enumeration of the existing API metric types
func (APIMetricType) MarshalText ¶
func (a APIMetricType) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshal interface to marshal an APIMetricType to a serialized byte slice
func (APIMetricType) SeriesAPIV2Enum ¶
func (a APIMetricType) SeriesAPIV2Enum() int32
SeriesAPIV2Enum returns the enumeration value for MetricPayload.MetricType in https://github.com/DataDog/agent-payload/blob/master/proto/metrics/agent_payload.proto
func (APIMetricType) String ¶
func (a APIMetricType) String() string
String returns a string representation of APIMetricType
func (*APIMetricType) UnmarshalText ¶
func (a *APIMetricType) UnmarshalText(buf []byte) error
UnmarshalText is a custom unmarshaller for APIMetricType (used for testing)
type AddSampleTelemetry ¶
type AddSampleTelemetry struct { Total telemetry.SimpleCounter Stateful telemetry.SimpleCounter Stateless telemetry.SimpleCounter }
AddSampleTelemetry counts number of new metrics added.
func (*AddSampleTelemetry) Inc ¶
func (a *AddSampleTelemetry) Inc(isStateful bool)
Inc should be called once for each new metric added to the map.
isStateful should be the value returned by isStateful method for the new metric.
type CheckMetrics ¶
type CheckMetrics struct {
// contains filtered or unexported fields
}
CheckMetrics stores metrics for the check sampler.
This is similar to ContextMetrics, but provides additional facility to remove metrics.
Metrics can be requested to be removed by calling Expire(). Metrics that keep state between flushes (see Metric.isStateful) are kept for additional statefulTimeout seconds after expiration, as a precaution against checks that send metrics intermittently. Older stateful metrics need to be cleaned up by calling RemoveExpired().
func NewCheckMetrics ¶
func NewCheckMetrics(expireMetrics bool, statefulTimeout time.Duration) CheckMetrics
NewCheckMetrics returns new CheckMetrics instance.
func (*CheckMetrics) AddSample ¶
func (cm *CheckMetrics) AddSample(contextKey ckey.ContextKey, sample *MetricSample, timestamp float64, interval int64, config pkgconfigmodel.Config) error
AddSample adds a new sample to the metric with contextKey, initializing a new metric as necessary.
If contextKey is scheduled for removal (see Expire), it will be unscheduled.
See also ContextMetrics.AddSample().
func (*CheckMetrics) Expire ¶
func (cm *CheckMetrics) Expire(contextKeys []ckey.ContextKey, timestamp float64)
Expire enables metric data for given context keys to be removed.
Metrics that do not keep state between flushes, will be removed immediately.
Metrics that do keep state, will be kept around for additional `cm.statefulTimeout` time after timestamp, before ultimately removed (See RemoveExpired). Call to AddSample will cancel delayed removal.
func (*CheckMetrics) Flush ¶
func (cm *CheckMetrics) Flush(timestamp float64) ([]*Serie, map[ckey.ContextKey]error)
Flush flushes every metrics in the CheckMetrics (see ContextMetrics.Flush)
func (*CheckMetrics) RemoveExpired ¶
func (cm *CheckMetrics) RemoveExpired(timestamp float64)
RemoveExpired removes stateful metrics that have expired before the given timestamp.
type CheckMetricsTelemetryAccumulator ¶
type CheckMetricsTelemetryAccumulator struct {
// contains filtered or unexported fields
}
CheckMetricsTelemetryAccumulator aggregates telemetry collected from multiple CheckMetrics instances.
func (*CheckMetricsTelemetryAccumulator) Flush ¶
func (c *CheckMetricsTelemetryAccumulator) Flush()
Flush updates telemetry counters based on aggregated statistics.
func (*CheckMetricsTelemetryAccumulator) VisitCheckMetrics ¶
func (c *CheckMetricsTelemetryAccumulator) VisitCheckMetrics(cm *CheckMetrics)
VisitCheckMetrics adds metrics from CheckMetrics instance to the accumulator.
type ContextMetrics ¶
type ContextMetrics map[ckey.ContextKey]Metric
ContextMetrics stores all the metrics by context key
func MakeContextMetrics ¶
func MakeContextMetrics() ContextMetrics
MakeContextMetrics returns a new ContextMetrics
func (ContextMetrics) AddSample ¶
func (m ContextMetrics) AddSample(contextKey ckey.ContextKey, sample *MetricSample, timestamp float64, interval int64, t *AddSampleTelemetry, config pkgconfigmodel.Config) error
AddSample add a sample to the current ContextMetrics and initialize a new metrics if needed.
func (ContextMetrics) Flush ¶
func (m ContextMetrics) Flush(timestamp float64) ([]*Serie, map[ckey.ContextKey]error)
Flush flushes every metrics in the ContextMetrics. Returns the slice of Series and a map of errors by context key.
type ContextMetricsFlusher ¶
type ContextMetricsFlusher struct {
// contains filtered or unexported fields
}
ContextMetricsFlusher sorts Metrics by context key, in a streaming fashion. It accepts a collection of timestamped ContextMetrics instances, each of which contains Metric instances organized by context key. Its FlushAndClear method then flushes those Metric instances one context key at a time, without requiring the space to sort Metrics by context key.
func NewContextMetricsFlusher ¶
func NewContextMetricsFlusher() *ContextMetricsFlusher
NewContextMetricsFlusher creates a new instance of ContextMetricsFlusher
func (*ContextMetricsFlusher) Append ¶
func (f *ContextMetricsFlusher) Append(bucketTimestamp float64, contextMetrics ContextMetrics)
Append appends a new contextMetrics
func (*ContextMetricsFlusher) FlushAndClear ¶
func (f *ContextMetricsFlusher) FlushAndClear(callback func([]*Serie)) map[ckey.ContextKey][]error
FlushAndClear flushes Metrics appended to this instance, and clears the instance. For each context key present in any of the ContextMetrics instances, it constructs a slice containing all Serie instances with that context key, and passes that slice to `callback`. Any errors encountered flushing the Metric instances are returned, but such errors do not interrupt the flushing operation.
type Count ¶
type Count struct {
// contains filtered or unexported fields
}
Count is used to count the number of events that occur between 2 flushes. Each sample's value is added to the value that's flushed
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter tracks how many times something happened per second. Counters are only used by DogStatsD and are very similar to Count: the main diffence is that they are sent as Rate.
func NewCounter ¶
NewCounter return a new initialized Counter
type EnrichTagsfn ¶
type EnrichTagsfn func(tb tagset.TagsAccumulator, origin taggertypes.OriginInfo)
EnrichTagsfn can be used to Enrich tags with origin detection tags.
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge tracks the value of a metric
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram tracks the distribution of samples added over one flush period
func NewHistogram ¶
func NewHistogram(interval int64, config pkgconfigmodel.Config) *Histogram
NewHistogram returns a newly initialized histogram
type HistogramBucket ¶
type HistogramBucket struct { Name string Value int64 LowerBound float64 UpperBound float64 Monotonic bool Tags []string Host string Timestamp float64 FlushFirstValue bool Source MetricSource }
HistogramBucket represents a prometheus/openmetrics histogram bucket
func (*HistogramBucket) GetHost ¶
func (m *HistogramBucket) GetHost() string
GetHost returns the bucket host
func (*HistogramBucket) GetMetricType ¶
func (m *HistogramBucket) GetMetricType() MetricType
GetMetricType implements MetricSampleContext#GetMetricType.
func (*HistogramBucket) GetName ¶
func (m *HistogramBucket) GetName() string
GetName returns the bucket name
func (*HistogramBucket) GetSource ¶
func (m *HistogramBucket) GetSource() MetricSource
GetSource returns the currently set MetricSource
func (*HistogramBucket) GetTags ¶
func (m *HistogramBucket) GetTags(_, metricBuffer tagset.TagsAccumulator, _ EnrichTagsfn)
GetTags returns the bucket tags.
func (*HistogramBucket) IsNoIndex ¶
func (m *HistogramBucket) IsNoIndex() bool
IsNoIndex returns if the metric must not be indexed.
type Historate ¶
type Historate struct {
// contains filtered or unexported fields
}
Historate tracks the distribution of samples added over one flush period for "rate" like metrics. Warning this doesn't use the harmonic mean, beware of what it means when using it.
func NewHistorate ¶
func NewHistorate(interval int64, config pkgconfigmodel.Config) *Historate
NewHistorate returns a newly-initialized historate
type IterableSeries ¶
type IterableSeries struct {
// contains filtered or unexported fields
}
IterableSeries is an specialisation of iterableMetrics for serie.
func NewIterableSeries ¶
func NewIterableSeries(callback func(*Serie), chanSize int, bufferSize int) *IterableSeries
NewIterableSeries creates a new instance of *IterableSeries
`callback` is called in the context of the sender's goroutine each time `Append` is called.
func (*IterableSeries) Append ¶
func (it *IterableSeries) Append(serie *Serie)
Append appends a serie
func (*IterableSeries) Count ¶
func (it *IterableSeries) Count() uint64
Count returns the number of metrics appended with `iterableMetrics.Append`.
Count can be called by any goroutine.
func (*IterableSeries) Current ¶
func (it *IterableSeries) Current() *Serie
Current returns the current serie.
func (*IterableSeries) MoveNext ¶
func (it *IterableSeries) MoveNext() bool
MoveNext advances to the next element. Returns false for the end of the iteration.
This method must only be called by the receiver.
func (*IterableSeries) WaitForValue ¶
func (it *IterableSeries) WaitForValue() bool
Wait until a value is available for MoveNext() or until senderStopped() is called Returns true if a value is available, false otherwise
type IterableSketches ¶
type IterableSketches struct {
// contains filtered or unexported fields
}
IterableSketches is an specialisation of iterableMetrics for Sketches.
func NewIterableSketches ¶
func NewIterableSketches(callback func(*SketchSeries), chanSize int, bufferSize int) *IterableSketches
NewIterableSketches creates a new instance of *IterableSketches
`callback` is called in the context of the sender's goroutine each time `Append` is called.
func (*IterableSketches) Append ¶
func (it *IterableSketches) Append(Sketches *SketchSeries)
Append appends a sketches
func (*IterableSketches) Count ¶
func (it *IterableSketches) Count() uint64
Count returns the number of metrics appended with `iterableMetrics.Append`.
Count can be called by any goroutine.
func (*IterableSketches) Current ¶
func (it *IterableSketches) Current() *SketchSeries
Current returns the current sketches.
func (*IterableSketches) MoveNext ¶
func (it *IterableSketches) MoveNext() bool
MoveNext advances to the next element. Returns false for the end of the iteration.
This method must only be called by the receiver.
func (*IterableSketches) WaitForValue ¶
func (it *IterableSketches) WaitForValue() bool
WaitForValue waits until a value is available for MoveNext() or until senderStopped() is called Returns true if a value is available, false otherwise
type Metric ¶
type Metric interface {
// contains filtered or unexported methods
}
Metric is the interface of all metric types
type MetricSample ¶
type MetricSample struct { Name string Value float64 RawValue string Mtype MetricType Tags []string Host string SampleRate float64 Timestamp float64 FlushFirstValue bool OriginInfo taggertypes.OriginInfo ListenerID string NoIndex bool Source MetricSource }
MetricSample represents a raw metric sample
func (*MetricSample) Copy ¶
func (m *MetricSample) Copy() *MetricSample
Copy returns a deep copy of the m MetricSample
func (*MetricSample) GetHost ¶
func (m *MetricSample) GetHost() string
GetHost returns the metric sample host
func (*MetricSample) GetMetricType ¶
func (m *MetricSample) GetMetricType() MetricType
GetMetricType implements MetricSampleContext#GetMetricType.
func (*MetricSample) GetName ¶
func (m *MetricSample) GetName() string
GetName returns the metric sample name
func (*MetricSample) GetSource ¶
func (m *MetricSample) GetSource() MetricSource
GetSource returns the currently set MetricSource
func (*MetricSample) GetTags ¶
func (m *MetricSample) GetTags(taggerBuffer, metricBuffer tagset.TagsAccumulator, fn EnrichTagsfn)
GetTags returns the metric sample tags
func (*MetricSample) IsNoIndex ¶
func (m *MetricSample) IsNoIndex() bool
IsNoIndex returns true if the metric must not be indexed.
type MetricSampleBatch ¶
type MetricSampleBatch []MetricSample
MetricSampleBatch is a slice of MetricSample. It is used by the MetricSamplePool to avoid constant reallocation in high throughput pipelines.
Can be used for both "on-time" and for "late" metrics.
type MetricSampleContext ¶
type MetricSampleContext interface { GetName() string GetHost() string // GetTags extracts metric tags for context tracking. // // Implementations should call `Append` or `AppendHashed` on the provided accumulators. // Tags from origin detection should be appended to taggerBuffer. Client-provided tags // should be appended to the metricBuffer. GetTags(taggerBuffer, metricBuffer tagset.TagsAccumulator, fn EnrichTagsfn) // GetMetricType returns the metric type for this metric. This is used for telemetry. GetMetricType() MetricType // IsNoIndex returns true if the metric must not be indexed. IsNoIndex() bool // GetMetricSource returns the metric source for this metric. This is used to define the Origin GetSource() MetricSource }
MetricSampleContext allows to access a sample context data
type MetricSamplePool ¶
type MetricSamplePool struct {
// contains filtered or unexported fields
}
MetricSamplePool is a pool of metrics sample
func NewMetricSamplePool ¶
func NewMetricSamplePool(batchSize int, isTelemetryEnabled bool) *MetricSamplePool
NewMetricSamplePool creates a new MetricSamplePool
func (*MetricSamplePool) GetBatch ¶
func (m *MetricSamplePool) GetBatch() MetricSampleBatch
GetBatch gets a batch of metric samples from the pool
func (*MetricSamplePool) PutBatch ¶
func (m *MetricSamplePool) PutBatch(batch MetricSampleBatch)
PutBatch puts a batch back into the pool
type MetricSource ¶
type MetricSource uint16
MetricSource represents how this metric made it into the Agent
const ( MetricSourceUnknown MetricSource = iota MetricSourceDogstatsd // JMX Integrations MetricSourceJmxCustom MetricSourceActivemq MetricSourceCassandra MetricSourceConfluentPlatform MetricSourceHazelcast MetricSourceHive MetricSourceHivemq MetricSourceHudi MetricSourceIgnite MetricSourceJbossWildfly MetricSourceKafka MetricSourcePresto MetricSourceSolr MetricSourceSonarqube MetricSourceTomcat MetricSourceWeblogic // Core Checks MetricSourceInternal MetricSourceContainer MetricSourceContainerd MetricSourceCri MetricSourceDocker MetricSourceNTP MetricSourceSystemd MetricSourceHelm MetricSourceKubernetesAPIServer MetricSourceKubernetesStateCore MetricSourceOrchestrator MetricSourceWinproc MetricSourceFileHandle MetricSourceWinkmem MetricSourceIo MetricSourceUptime MetricSourceSbom MetricSourceMemory MetricSourceTCPQueueLength MetricSourceOomKill MetricSourceContainerLifecycle MetricSourceJetson MetricSourceContainerImage MetricSourceCPU MetricSourceLoad MetricSourceDisk MetricSourceNetwork MetricSourceSnmp MetricSourceCloudFoundry MetricSourceJenkins // Python Checks MetricSourceZenohRouter MetricSourceZabbix MetricSourceWayfinder MetricSourceVespa MetricSourceUpsc MetricSourceUpboundUxp MetricSourceUnifiConsole MetricSourceUnbound MetricSourceTraefik MetricSourceTidb MetricSourceSyncthing MetricSourceStorm MetricSourceStardog MetricSourceSpeedtest MetricSourceSortdb MetricSourceSonarr MetricSourceSnmpwalk MetricSourceSendmail MetricSourceScaphandre MetricSourceScalr MetricSourceRiakRepl MetricSourceRedpanda MetricSourceRedisenterprise MetricSourceRedisSentinel MetricSourceRebootRequired MetricSourceRadarr MetricSourcePurefb MetricSourcePurefa MetricSourcePuma MetricSourcePortworx MetricSourcePing MetricSourcePihole MetricSourcePhpOpcache MetricSourcePhpApcu MetricSourceOpenPolicyAgent MetricSourceOctopusDeploy MetricSourceOctoprint MetricSourceNvml MetricSourceNs1 MetricSourceNnSdwan MetricSourceNextcloud MetricSourceNeutrona MetricSourceNeo4j MetricSourceMergify MetricSourceLogstash MetricSourceLighthouse MetricSourceKernelcare MetricSourceKepler MetricSourceJfrogPlatformSelfHosted MetricSourceHikaricp MetricSourceGrpcCheck MetricSourceGoPprofScraper MetricSourceGnatsdStreaming MetricSourceGnatsd MetricSourceGitea MetricSourceGatekeeper MetricSourceFlyIo MetricSourceFluentbit MetricSourceFilemage MetricSourceFilebeat MetricSourceFiddler MetricSourceExim MetricSourceEventstore MetricSourceEmqx MetricSourceCyral MetricSourceCybersixgillActionableAlerts MetricSourceCloudsmith MetricSourceCloudnatix MetricSourceCfssl MetricSourceBind9 MetricSourceAwsPricing MetricSourceAqua MetricSourceKubernetesClusterAutoscaler MetricSourceKubeVirtAPI MetricSourceKubeVirtController MetricSourceKubeVirtHandler MetricSourceTraefikMesh MetricSourceWeaviate MetricSourceTorchserve MetricSourceTemporal MetricSourceTeleport MetricSourceTekton MetricSourceStrimzi MetricSourceRay MetricSourceNvidiaTriton MetricSourceKarpenter MetricSourceFluxcd MetricSourceEsxi MetricSourceDcgm MetricSourceDatadogClusterAgent MetricSourceCloudera MetricSourceArgoWorkflows MetricSourceArgoRollouts MetricSourceActiveDirectory MetricSourceActivemqXML MetricSourceAerospike MetricSourceAirflow MetricSourceAmazonMsk MetricSourceAmbari MetricSourceApache MetricSourceArangodb MetricSourceArgocd MetricSourceAspdotnet MetricSourceAviVantage MetricSourceAzureIotEdge MetricSourceBoundary MetricSourceBtrfs MetricSourceCacti MetricSourceCalico MetricSourceCassandraNodetool MetricSourceCeph MetricSourceCertManager MetricSourceCilium MetricSourceCitrixHypervisor MetricSourceClickhouse MetricSourceCloudFoundryAPI MetricSourceCockroachdb MetricSourceConsul MetricSourceCoredns MetricSourceCouch MetricSourceCouchbase MetricSourceCrio MetricSourceDirectory MetricSourceDNSCheck MetricSourceDotnetclr MetricSourceDruid MetricSourceEcsFargate MetricSourceEksFargate MetricSourceElastic MetricSourceEnvoy MetricSourceEtcd MetricSourceExchangeServer MetricSourceExternalDNS MetricSourceFluentd MetricSourceFoundationdb MetricSourceGearmand MetricSourceGitlab MetricSourceGitlabRunner MetricSourceGlusterfs MetricSourceGoExpvar MetricSourceGunicorn MetricSourceHaproxy MetricSourceHarbor MetricSourceHdfsDatanode MetricSourceHdfsNamenode MetricSourceHTTPCheck MetricSourceHyperv MetricSourceIbmAce MetricSourceIbmDb2 MetricSourceIbmI MetricSourceIbmMq MetricSourceIbmWas MetricSourceIis MetricSourceImpala MetricSourceIstio MetricSourceKafkaConsumer MetricSourceKong MetricSourceKubeAPIserverMetrics MetricSourceKubeControllerManager MetricSourceKubeDNS MetricSourceKubeMetricsServer MetricSourceKubeProxy MetricSourceKubeScheduler MetricSourceKubelet MetricSourceKubernetesState MetricSourceKyototycoon MetricSourceLighttpd MetricSourceLinkerd MetricSourceLinuxProcExtras MetricSourceMapr MetricSourceMapreduce MetricSourceMarathon MetricSourceMarklogic MetricSourceMcache MetricSourceMesosMaster MetricSourceMesosSlave MetricSourceMongo MetricSourceMysql MetricSourceNagios MetricSourceNfsstat MetricSourceNginx MetricSourceNginxIngressController MetricSourceOpenldap MetricSourceOpenmetrics MetricSourceOpenstack MetricSourceOpenstackController MetricSourceOracle MetricSourcePdhCheck MetricSourcePgbouncer MetricSourcePhpFpm MetricSourcePostfix MetricSourcePostgres MetricSourcePowerdnsRecursor MetricSourceProcess MetricSourcePrometheus MetricSourceProxysql MetricSourcePulsar MetricSourceRabbitmq MetricSourceRedisdb MetricSourceRethinkdb MetricSourceRiak MetricSourceRiakcs MetricSourceSapHana MetricSourceScylla MetricSourceSilk MetricSourceSinglestore MetricSourceSnowflake MetricSourceSpark MetricSourceSqlserver MetricSourceSquid MetricSourceSSHCheck MetricSourceStatsd MetricSourceSupervisord MetricSourceSystemCore MetricSourceSystemSwap MetricSourceTCPCheck MetricSourceTeamcity MetricSourceTeradata MetricSourceTLS MetricSourceTokumx MetricSourceTrafficServer MetricSourceTwemproxy MetricSourceTwistlock MetricSourceVarnish MetricSourceVault MetricSourceVertica MetricSourceVllm MetricSourceVoltdb MetricSourceVsphere MetricSourceWin32EventLog MetricSourceWindowsPerformanceCounters MetricSourceWindowsService MetricSourceWmiCheck MetricSourceYarn MetricSourceZk MetricSourceAwsNeuron MetricSourceTibcoEMS MetricSourceSlurm MetricSourceKyverno MetricSourceKubeflow MetricSourceAppgateSDP MetricSourceAnyscale MetricSourceMilvus MetricSourceNvidiaNim MetricSourceQuarkus )
Enumeration of the currently supported MetricSources
func CheckNameToMetricSource ¶ added in v0.55.0
func CheckNameToMetricSource(name string) MetricSource
CheckNameToMetricSource returns a MetricSource given the name
func JMXCheckNameToMetricSource ¶
func JMXCheckNameToMetricSource(name string) MetricSource
JMXCheckNameToMetricSource returns a MetricSource given the checkName
func (MetricSource) String ¶
func (ms MetricSource) String() string
String returns a string representation of MetricSource
type MetricType ¶
type MetricType int
MetricType is the representation of an aggregator metric type
const ( GaugeType MetricType = iota RateType CountType MonotonicCountType CounterType HistogramType HistorateType SetType DistributionType GaugeWithTimestampType CountWithTimestampType // NumMetricTypes is the number of metric types; must be the last item here NumMetricTypes )
metric type constants enumeration
func (MetricType) String ¶
func (m MetricType) String() string
String returns a string representation of MetricType
type MetricWithTimestamp ¶ added in v0.53.0
type MetricWithTimestamp struct {
// contains filtered or unexported fields
}
MetricWithTimestamp allows sending metric values with a given timestamp
func NewMetricWithTimestamp ¶ added in v0.53.0
func NewMetricWithTimestamp(apiType APIMetricType) *MetricWithTimestamp
NewMetricWithTimestamp returns a new MetricWithTimestamp with the given API type
type MonotonicCount ¶
type MonotonicCount struct {
// contains filtered or unexported fields
}
MonotonicCount tracks a raw counter, based on increasing counter values. Samples that have a lower value than the previous sample are ignored (since it usually means that the underlying raw counter has been reset). Example:
submitting samples 2, 3, 6, 7 returns 5 (i.e. 7-2) on flush ; then submitting samples 10, 11 on the same MonotonicCount returns 4 (i.e. 11-7) on flush
type NoSerieError ¶
type NoSerieError struct{}
NoSerieError is the error returned by a metric when not enough samples have been submitted to generate a serie
func (NoSerieError) Error ¶
func (e NoSerieError) Error() string
type Point ¶
Point represents a metric value at a specific time
func (*Point) MarshalJSON ¶
MarshalJSON return a Point as an array of value (to be compatible with v1 API) FIXME(maxime): to be removed when v2 endpoints are available Note: it is not used with jsoniter, encodePoints takes over
func (*Point) UnmarshalJSON ¶
UnmarshalJSON is a custom unmarshaller for Point (used for testing)
type Rate ¶
type Rate struct {
// contains filtered or unexported fields
}
Rate tracks the rate of a metric over 2 successive flushes
type Serie ¶
type Serie struct { Name string `json:"metric"` Points []Point `json:"points"` Tags tagset.CompositeTags `json:"tags"` Host string `json:"host"` Device string `json:"device,omitempty"` MType APIMetricType `json:"type"` Interval int64 `json:"interval"` SourceTypeName string `json:"source_type_name,omitempty"` ContextKey ckey.ContextKey `json:"-"` NameSuffix string `json:"-"` NoIndex bool `json:"-"` // This is only used by api V2 Resources []Resource `json:"-"` // This is only used by api V2 Source MetricSource `json:"-"` // This is only used by api V2 }
Serie holds a timeseries (w/ json serialization to DD API format)
func (*Serie) PopulateDeviceField ¶
func (serie *Serie) PopulateDeviceField()
PopulateDeviceField removes any `device:` tag in the series tags and uses the value to populate the Serie.Device field FIXME(olivier v): remove this as soon as the v1 API can handle `device` as a regular tag
func (*Serie) PopulateResources ¶
func (serie *Serie) PopulateResources()
PopulateResources removes any dd.internal.resource tags in the series tags and uses the values to populate the Serie.Resources field. The format for the dd.internal.resource tag values is <resource_type>:<resource_name>. Any dd.internal.resource tag not matching the expected format will be dropped.
type SerieSink ¶
type SerieSink interface {
Append(*Serie)
}
SerieSink is a sink for series. It provides a way to append a serie into `Series` or `IterableSerie`
type SerieSource ¶
SerieSource is a source of series used by the serializer.
type Series ¶
type Series []*Serie
Series is a collection of `Serie`
func (Series) MarshalStrings ¶
MarshalStrings converts the timeseries to a sorted slice of string slices
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set tracks the number of unique elements in a set. They are only use by DogStatsD
type SketchPoint ¶
A SketchPoint represents a quantile sketch at a specific time
type SketchSeries ¶
type SketchSeries struct { Name string `json:"metric"` Tags tagset.CompositeTags `json:"tags"` Host string `json:"host"` Interval int64 `json:"interval"` Points []SketchPoint `json:"points"` ContextKey ckey.ContextKey `json:"-"` NoIndex bool `json:"-"` // This is only used by api V2 Source MetricSource `json:"-"` // This is only used by api V2 }
A SketchSeries is a timeseries of quantile sketches.
func (SketchSeries) String ¶
func (sl SketchSeries) String() string
String returns the JSON representation of a SketchSeries as a string or an empty string in case of an error
type SketchSeriesList ¶
type SketchSeriesList []*SketchSeries
SketchSeriesList is a collection of SketchSeries
func (*SketchSeriesList) Append ¶
func (sl *SketchSeriesList) Append(sketches *SketchSeries)
Append appends a sketches.
func (SketchSeriesList) MarshalJSON ¶
func (sl SketchSeriesList) MarshalJSON() ([]byte, error)
MarshalJSON serializes sketch series to JSON.
func (SketchSeriesList) String ¶
func (sl SketchSeriesList) String() string
String returns the JSON representation of a SketchSeriesList as a string or an empty string in case of an error
type SketchesSink ¶
type SketchesSink interface {
Append(*SketchSeries)
}
SketchesSink is a sink for sketches. It provides a way to append a sketches into `SketchSeriesList`
type SketchesSource ¶
type SketchesSource interface { MoveNext() bool Current() *SketchSeries Count() uint64 WaitForValue() bool }
SketchesSource is a source of sketches used by the serializer.
Source Files
¶
- check_metrics.go
- context_metrics.go
- context_metrics_flusher.go
- count.go
- counter.go
- gauge.go
- histogram.go
- histogram_bucket.go
- historate.go
- iterable_metrics.go
- iterable_series.go
- iterable_skeches.go
- metric.go
- metric_sample.go
- metric_sample_pool.go
- metric_with_timestamp.go
- metricsource.go
- monotonic_count.go
- rate.go
- series.go
- set.go
- sketch_series.go
Directories
¶
Path | Synopsis |
---|---|
Package event provides the event type and its serialization to the DD agent 5 intake format.
|
Package event provides the event type and its serialization to the DD agent 5 intake format. |