internal

package
v0.102.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertMetrics

func InsertMetrics(ctx context.Context, db *sql.DB, metricsMap map[pmetric.MetricType]MetricsModel) error

InsertMetrics insert metric data into clickhouse concurrently

func NewMetricsModel

func NewMetricsModel(tableName string) map[pmetric.MetricType]MetricsModel

NewMetricsModel create a model for contain different metric data

func NewMetricsTable

func NewMetricsTable(ctx context.Context, tableName, cluster, engine, ttlExpr string, db *sql.DB) error

NewMetricsTable create metric tables with an expiry time to storage metric telemetry data

func SetLogger

func SetLogger(l *zap.Logger)

SetLogger set a logger instance

Types

type MetricsMetaData

type MetricsMetaData struct {
	ResAttr    map[string]string
	ResURL     string
	ScopeURL   string
	ScopeInstr pcommon.InstrumentationScope
}

MetricsMetaData contain specific metric data

type MetricsModel

type MetricsModel interface {
	// Add used to bind MetricsMetaData to a specific metric then put them into a slice
	Add(resAttr map[string]string, resURL string, scopeInstr pcommon.InstrumentationScope, scopeURL string, metrics any, name string, description string, unit string) error
	// contains filtered or unexported methods
}

MetricsModel is used to group metric data and insert into clickhouse any type of metrics need implement it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL