otel

package
v0.0.0-...-0be08e2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Worker States
	InitConnMetric      = "init_connection"
	AccptConnMetric     = "accept_connection"
	WaitConnMetric      = "wait_connection"
	BusyConnMetric      = "busy_connection"
	ScheduledConnMetric = "scheduled_connection"
	FinishedConnMetric  = "finished_connection"
	QuiescedConnMetric  = "quiesced_connection"

	// Connection States
	AssignedConnMetric = "assigned_connection"
	IdleConnMetric     = "idle_connection"
	BacklogConnMetric  = "backlog_connection"
	StrdConnMetric     = "stranded_connection"
)

"init", "acpt", "wait", "busy", "schd", "fnsh", "quce", "asgn", "idle", "bklg", "strd", "cls" Following Metric Names will get instrumented as part of StateLogMetrics

View Source
const (
	Target             = string("target")
	Endpoint           = string("target_ip_port")
	TLS_version        = string("tls_version")
	ApplicationDimName = string("application")
	ShardId            = string("ShardId")
	WorkerType         = string("WorkerType")
	InstanceId         = string("InstanceId")
	Datapoints         = string("datapoints")
	OtelSourceName     = string("source")

	OccWorkerParamName   = string("occ_worker")
	HostDimensionName    = string("host")
	ContainerHostDimName = string("container_host")
)
View Source
const COLLECTOR_POLLING_INTERVAL_SECONDS int32 = 5
View Source
const DEFAULT_GRPC_OTEL_COLLECTOR_PORT string = "4317"
View Source
const DEFAULT_HTTP_OTEL_COLLECTOR_PORT string = "4318"
View Source
const DEFAULT_OTEL_COLLECTOR_PROTOCOL string = "grpc"

DEFAULT_OTEL_COLLECTOR_PROTOCOL default OTEL configurations point to QA collector

View Source
const DEFAULT_OTEL_COLLECTOR__IP string = "0.0.0.0"
View Source
const IngestTokenHeader = "X-Sf-Token"

Headers

View Source
const LoggingOTELPublishingInterval = 15

LoggingOTELPublishingInterval This controls how frequently log OTEL publishing error

View Source
const OtelInstrumentationVersion string = "v1.0"
View Source
const StateLogMeterName = "occ-statelog-data"

Variables

View Source
var ConnectionStateBucket = []float64{0, 25, 50, 75, 100, 150, 200, 300, 400, 500, 600, 700, 800, 1200, 2400, 4800, 9600, 19200, 39400, 65536}
View Source
var StatelogBucket = []float64{0, 5, 10, 15, 20, 25, 30, 40, 50, 60, 80, 100, 120, 160, 200}
View Source
var WorkerTypeMap = map[int]string{
	0: "rw",
	1: "ro",
	2: "standby_ro",
}

WorkerTypeMap This map represents worker type configured in lib.HeraWorkerType variable. If any changes in worker type this definition need to get updated.

Functions

func AddDataPointToOTELStateDataChan

func AddDataPointToOTELStateDataChan(dataPoint *WorkersStateData)

AddDataPointToOTELStateDataChan Send data to stateLogMetrics.mStateDataChan channel

func AddDataPointToTotalConnectionsDataChannel

func AddDataPointToTotalConnectionsDataChannel(totalConnectionData *GaugeMetricData)

AddDataPointToTotalConnectionsDataChannel Send data to totalConnectionStateDataLogger.totalConnDataChannel channel

func Init

func Init(ctx context.Context) (shutdown func(ctx context.Context) error, err error)

Init takes care of initialize OTEL SDK once during startup

func StartMetricsCollection

func StartMetricsCollection(ctx context.Context, totalWorkersCount int, opt ...StateLogOption) error

StartMetricsCollection initializes reporting of stateLogMetrics using the supplied config.

func StopMetricCollection

func StopMetricCollection()

StopMetricCollection Send notification to stateLogMetrics.stopPublish to stop metric collection

Types

type AppNameOption

type AppNameOption string

AppNameOption Define Option for OCCName

type GaugeMetricData

type GaugeMetricData struct {
	*WorkerStateInfo
	StateData int64
}

type MetricProviderOption

type MetricProviderOption struct {
	metric.MeterProvider
}

MetricProviderOption Define confuration for metric Provider Option

type OTelErrorData

type OTelErrorData struct {
	// contains filtered or unexported fields
}

type OTelErrorHandler

type OTelErrorHandler struct{}

func (OTelErrorHandler) Handle

func (handler OTelErrorHandler) Handle(err error)

Handle function handles errors in async way whenever runtime error while publishing data to OTEL agent.

type ServerType

type ServerType int

type StateLogMetrics

type StateLogMetrics struct {
	// contains filtered or unexported fields
}

StateLogMetrics state_log_metrics reports workers states

type StateLogOption

type StateLogOption interface {
	// contains filtered or unexported methods
}

StateLogOption Option Interface define configuration parameters for statelog metrics agent

func WithAppName

func WithAppName(appName string) StateLogOption

WithAppName Create StateLogMetrics with OCC Name

func WithMetricProvider

func WithMetricProvider(provider metric.MeterProvider) StateLogOption

WithMetricProvider Create StateLogMetrics with provided stateLogMeter Provider

type Tags

type Tags struct {
	TagName  string
	TagValue string
}

type TotalConnectionsGaugeData

type TotalConnectionsGaugeData struct {
	// contains filtered or unexported fields
}

type WorkerStateInfo

type WorkerStateInfo struct {
	StateTitle string
	ShardId    int
	WorkerType int
	InstanceId int
}

type WorkersStateData

type WorkersStateData struct {
	*WorkerStateInfo
	StateData map[string]int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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