Documentation
¶
Index ¶
- type PrometheusStats
- func (s *PrometheusStats) MetaBackwardsCompatibility(registry prometheus.Registerer)
- func (s *PrometheusStats) SeriesBackwardsCompatibility(registry prometheus.Registerer)
- func (s *PrometheusStats) Unregister()
- func (s *PrometheusStats) UpdateNetwork(stats types.NetworkStats)
- func (s *PrometheusStats) UpdateSerializer(stats types.SerializerStats)
- type Queue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrometheusStats ¶
type PrometheusStats struct {
// Network Stats
NetworkSeriesSent prometheus.Counter
NetworkFailures prometheus.Counter
NetworkRetries prometheus.Counter
NetworkRetries429 prometheus.Counter
NetworkRetries5XX prometheus.Counter
NetworkSentDuration prometheus.Histogram
NetworkErrors prometheus.Counter
NetworkNewestOutTimeStampSeconds prometheus.Gauge
// Serializer Stats
SerializerInSeries prometheus.Counter
SerializerNewestInTimeStampSeconds prometheus.Gauge
SerializerErrors prometheus.Counter
// Backwards compatibility metrics
SamplesTotal prometheus.Counter
HistogramsTotal prometheus.Counter
MetadataTotal prometheus.Counter
FailedSamplesTotal prometheus.Counter
FailedHistogramsTotal prometheus.Counter
FailedMetadataTotal prometheus.Counter
RetriedSamplesTotal prometheus.Counter
RetriedHistogramsTotal prometheus.Counter
RetriedMetadataTotal prometheus.Counter
EnqueueRetriesTotal prometheus.Counter
SentBatchDuration prometheus.Histogram
HighestSentTimestamp prometheus.Gauge
SentBytesTotal prometheus.Counter
MetadataBytesTotal prometheus.Counter
RemoteStorageInTimestamp prometheus.Gauge
RemoteStorageOutTimestamp prometheus.Gauge
RemoteStorageDuration prometheus.Histogram
// contains filtered or unexported fields
}
func NewStats ¶
func NewStats(namespace, subsystem string, registry prometheus.Registerer) *PrometheusStats
func (*PrometheusStats) MetaBackwardsCompatibility ¶
func (s *PrometheusStats) MetaBackwardsCompatibility(registry prometheus.Registerer)
func (*PrometheusStats) SeriesBackwardsCompatibility ¶
func (s *PrometheusStats) SeriesBackwardsCompatibility(registry prometheus.Registerer)
func (*PrometheusStats) Unregister ¶
func (s *PrometheusStats) Unregister()
func (*PrometheusStats) UpdateNetwork ¶
func (s *PrometheusStats) UpdateNetwork(stats types.NetworkStats)
func (*PrometheusStats) UpdateSerializer ¶
func (s *PrometheusStats) UpdateSerializer(stats types.SerializerStats)
type Queue ¶
Queue is the interface for a prometheus compatible queue. The queue is an append only interface.
Start will start the queue.
Stop will stop the queue.
Appender returns an Appender that writes to the queue.
func NewQueue ¶
func NewQueue(name string, cc types.ConnectionConfig, directory string, maxSignalsToBatch uint32, flushInterval time.Duration, ttl time.Duration, registerer prometheus.Registerer, namespace string, logger log.Logger) (Queue, error)
NewQueue creates and returns a new Queue instance, initializing its components such as network client, file storage queue, and serializer. It configures the queue with the given connection settings, directory for file storage, batching parameters, and logging. The function also sets up the statistics callback functions for network and serialization metrics.
Parameters: - cc: ConnectionConfig for setting up the network client. - directory: Directory path for storing queue files. - maxSignalsToBatch: Maximum number of signals to batch before flushing to file storage. - flushInterval: Duration for how often to flush the data to file storage. - ttl: Time-to-live for data in the queue, this is checked in both writing to file storage and sending to the network. - registry: Prometheus registry to apply metrics to. - namespace: Namespace to use to add to the metric family names. IE `alloy` would make `alloy_queue_series_total_sent` - logger: Logger for logging internal operations and errors.
Returns: - Queue: An initialized Queue instance. - error: An error if any of the components fail to initialize.