Documentation ¶
Index ¶
- Constants
- Variables
- func AddDataPointToOTELStateDataChan(dataPoint *WorkersStateData)
- func AddDataPointToTotalConnectionsDataChannel(totalConnectionData *GaugeMetricData)
- func Init(ctx context.Context) (shutdown func(ctx context.Context) error, err error)
- func StartMetricsCollection(ctx context.Context, totalWorkersCount int, opt ...StateLogOption) error
- func StopMetricCollection()
- type AppNameOption
- type GaugeMetricData
- type MetricProviderOption
- type OTelErrorData
- type OTelErrorHandler
- type ServerType
- type StateLogMetrics
- type StateLogOption
- type Tags
- type TotalConnectionsGaugeData
- type WorkerStateInfo
- type WorkersStateData
Constants ¶
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
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") )
const COLLECTOR_POLLING_INTERVAL_SECONDS int32 = 5
const DEFAULT_GRPC_OTEL_COLLECTOR_PORT string = "4317"
const DEFAULT_HTTP_OTEL_COLLECTOR_PORT string = "4318"
const DEFAULT_OTEL_COLLECTOR_PROTOCOL string = "grpc"
DEFAULT_OTEL_COLLECTOR_PROTOCOL default OTEL configurations point to QA collector
const DEFAULT_OTEL_COLLECTOR__IP string = "0.0.0.0"
const IngestTokenHeader = "X-Sf-Token"
Headers
const LoggingOTELPublishingInterval = 15
LoggingOTELPublishingInterval This controls how frequently log OTEL publishing error
const OtelInstrumentationVersion string = "v1.0"
const StateLogMeterName = "occ-statelog-data"
Variables ¶
var ConnectionStateBucket = []float64{0, 25, 50, 75, 100, 150, 200, 300, 400, 500, 600, 700, 800, 1200, 2400, 4800, 9600, 19200, 39400, 65536}
var StatelogBucket = []float64{0, 5, 10, 15, 20, 25, 30, 40, 50, 60, 80, 100, 120, 160, 200}
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 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 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 TotalConnectionsGaugeData ¶
type TotalConnectionsGaugeData struct {
// contains filtered or unexported fields
}
type WorkerStateInfo ¶
type WorkersStateData ¶
type WorkersStateData struct { *WorkerStateInfo StateData map[string]int64 }