Versions in this module Expand all Collapse all v3 v3.1.0 Feb 13, 2025 v3.0.0 Dec 17, 2024 Changes in this version + type CmdOpts struct + BatchingDelay time.Duration + RealDbnameField string + Retention int + Sinks []string + SystemIdentifierField string + type DbStorageSchemaType int + const DbStorageSchemaPostgres + const DbStorageSchemaTimescale + type ExistingPartitionInfo struct + EndTime time.Time + StartTime time.Time + type JSONWriter struct + func NewJSONWriter(ctx context.Context, fname string) (*JSONWriter, error) + func (jw *JSONWriter) SyncMetric(_, _, _ string) error + func (jw *JSONWriter) Write(msgs []metrics.MeasurementEnvelope) error + type MeasurementMessagePostgres struct + DBName string + Data map[string]any + Metric string + TagData map[string]any + Time time.Time + type MultiWriter struct + func NewMultiWriter(ctx context.Context, opts *CmdOpts, metricDefs *metrics.Metrics) (mw *MultiWriter, err error) + func (mw *MultiWriter) AddWriter(w Writer) + func (mw *MultiWriter) SyncMetrics(dbUnique, metricName, op string) (err error) + func (mw *MultiWriter) WriteMeasurements(ctx context.Context, storageCh <-chan []metrics.MeasurementEnvelope) + type PostgresWriter struct + func NewPostgresWriter(ctx context.Context, connstr string, opts *CmdOpts, ...) (pgw *PostgresWriter, err error) + func NewWriterFromPostgresConn(ctx context.Context, conn db.PgxPoolIface, opts *CmdOpts, ...) (pgw *PostgresWriter, err error) + func (pgw *PostgresWriter) AddDBUniqueMetricToListingTable(dbUnique, metric string) error + func (pgw *PostgresWriter) DropOldTimePartitions(metricAgeDaysThreshold int) (res int, err error) + func (pgw *PostgresWriter) EnsureBuiltinMetricDummies() (err error) + func (pgw *PostgresWriter) EnsureMetricDbnameTime(metricDbnamePartBounds map[string]map[string]ExistingPartitionInfo, force bool) (err error) + func (pgw *PostgresWriter) EnsureMetricDummy(metric string) (err error) + func (pgw *PostgresWriter) EnsureMetricTime(pgPartBounds map[string]ExistingPartitionInfo, force bool) error + func (pgw *PostgresWriter) EnsureMetricTimescale(pgPartBounds map[string]ExistingPartitionInfo, force bool) (err error) + func (pgw *PostgresWriter) GetOldTimePartitions(metricAgeDaysThreshold int) ([]string, error) + func (pgw *PostgresWriter) ReadMetricSchemaType() (err error) + func (pgw *PostgresWriter) SyncMetric(dbUnique, metricName, op string) error + func (pgw *PostgresWriter) Write(msgs []metrics.MeasurementEnvelope) error + type PrometheusWriter struct + PrometheusNamespace string + func NewPrometheusWriter(ctx context.Context, connstr string) (promw *PrometheusWriter, err error) + func (promw *PrometheusWriter) Collect(ch chan<- prometheus.Metric) + func (promw *PrometheusWriter) Describe(_ chan<- *prometheus.Desc) + func (promw *PrometheusWriter) MetricStoreMessageToPromMetrics(msg metrics.MeasurementEnvelope) []prometheus.Metric + func (promw *PrometheusWriter) PromAsyncCacheAddMetricData(dbUnique, metric string, msgArr []metrics.MeasurementEnvelope) + func (promw *PrometheusWriter) PromAsyncCacheInitIfRequired(dbUnique, _ string) + func (promw *PrometheusWriter) PurgeMetricsFromPromAsyncCacheIfAny(dbUnique, metric string) + func (promw *PrometheusWriter) SyncMetric(dbUnique, metricName, op string) error + func (promw *PrometheusWriter) Write(msgs []metrics.MeasurementEnvelope) error + type RPCWriter struct + func NewRPCWriter(ctx context.Context, address string) (*RPCWriter, error) + func (rw *RPCWriter) SyncMetric(dbUnique string, metricName string, op string) error + func (rw *RPCWriter) Write(msgs []metrics.MeasurementEnvelope) error + type SyncReq struct + DbName string + MetricName string + Operation string + type Writer interface + SyncMetric func(dbUnique, metricName, op string) error + Write func(msgs []metrics.MeasurementEnvelope) error