otel

package
v0.0.0-...-9750751 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2023 PayPal Inc.

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2023 PayPal Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 PayPal Inc.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	Target       = string("target")
	Endpoint     = string("target_ip_port")
	Operation    = string("operation")
	Client       = string("client_app")
	Status       = string("status")
	Fatal        = string("Fatal")
	Error        = string("Error")
	Warn         = string("Warning")
	Success      = string("Success")
	SS_RB_expire = string("SS_RB_expire")
	SSReqTimeout = string("SSReqTimeout")
	SSMarkDown   = string("Down")
	SSMarkUp     = string("Up")
	TLS_version  = string("tls_version")
	Cipher       = string("cipher")
	Ssl_r        = string("ssl_r")
)
View Source
const (
	SvrTypeProxy      = ServerType(1)
	SvrTypeStorage    = ServerType(2)
	SvrTypeClusterMgr = ServerType(3)
	SvrTypeAll        = ServerType(6)
)
View Source
const (
	StatusSuccess string = "SUCCESS"
	StatusFatal   string = "FATAL"
	StatusError   string = "ERROR"
	StatusWarning string = "WARNING"
	StatusUnknown string = "UNKNOWN"
)

OTEl Status

View Source
const (
	MachineCpuUsed string = string("machineCpuUsed")
	ProcessCpuUsed string = string("machineCpuUsed")
	MachineMemoryUsed
	ProcessMemoryUsed
)
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 = "http"

default OTEL configurations point to QA collector

View Source
const DEFAULT_OTEL_COLLECTOR__IP string = "0.0.0.0"
View Source
const JUNO_METRIC_PREFIX = "juno.server."
View Source
const MeterName = "juno-server-meter"

Variables

View Source
var (
	LNLevelOnce sync.Once

	TCPConnCountOnce sync.Once
	SSLConnCountOnce sync.Once
)
View Source
var GaugeMetricList = []*GaugeMetric{
	{"pCPU", "proc_cpu_used", "CPU utilization of individual Juno instance", nil, nil, &processCpuUsedOnce, SvrTypeAll},
	{"pMem", "proc_mem_used", "Memory utilization of individual Juno instance", nil, nil, &processMemoryUsedOnce, SvrTypeAll},

	{"nBShd", "bad_shard", "Number of bad shards", nil, nil, &badShardOnce, SvrTypeProxy},
	{"nAShd", "alert_shard", "number of shards with no redundancy", nil, nil, &alertShardOnce, SvrTypeProxy},
	{"nWShd", "warning_shard", "number of shards with bad SS", nil, nil, &warningShardOnce, SvrTypeProxy},

	{"conns", "conns_count", "number of current TCP connections", nil, nil, &TCPConnCountOnce, SvrTypeProxy},
	{"ssl_conns", "conns_ssl_count", "number of current SSL connections", nil, nil, &SSLConnCountOnce, SvrTypeProxy},
	{"keys", "key_count", "Key Counte in rocksDB", nil, nil, &keyCountOnce, SvrTypeStorage},
	{"free", "free_mb_storage_space", "Free Storage Space (mbytes)", nil, nil, &freeStorageOnce, SvrTypeStorage},
	{"used", "storage_used_mb", "Used Storage Space (mbytes)", nil, nil, &usedStorageOnce, SvrTypeStorage},
	{"LN", "LN_level", "Max LN Level in Rocksdb", nil, nil, &LNLevelOnce, SvrTypeStorage},
	{"compSec", "compaction_sec", "Compaction Sec", nil, nil, &compSecOnce, SvrTypeStorage},
	{"compCount", "compaction_count", "Compaction Count", nil, nil, &compCountOnce, SvrTypeStorage},
	{"pCompKB", "pending_compaction", "Pending Compaction KBytes", nil, nil, &pendingCompOnce, SvrTypeStorage},
	{"stall", "stall_write_rate", "Actural Delayed Write Rate", nil, nil, &stallOnce, SvrTypeStorage},
}
View Source
var OTEL_COLLECTOR_PROTOCOL string = DEFAULT_OTEL_COLLECTOR_PROTOCOL

Functions

func Finalize

func Finalize()

func GetCounter

func GetCounter(counterName CMetric) (chan DataPoint, error)

func InitMetricProvider

func InitMetricProvider(config *otelCfg.Config)

func InitSystemMetrics

func InitSystemMetrics(serverType ServerType, workerStats [][]stats.IState)

func Initialize

func Initialize(args ...interface{}) (err error)

func IsEnabled

func IsEnabled() bool

func NewHTTPExporter

func NewHTTPExporter(ctx context.Context) (metric.Exporter, error)

func NewMeterProvider

func NewMeterProvider(ctx context.Context, cfg otelCfg.Config, vis ...metric.View) (*metric.MeterProvider, error)

func PopulateJunoMetricNamePrefix

func PopulateJunoMetricNamePrefix(metricName string) string

func RecordCount

func RecordCount(counterName CMetric, tags []Tags)

func RecordOperation

func RecordOperation(opType string, status proto.OpStatus, latency int64)

This is the pp.app.intbound metric

func RecordOutboundConnection

func RecordOutboundConnection(endpoint string, status string, latency int64)

func RecordReplication

func RecordReplication(opType string, status string, destination string, latency int64)

func RecordSSConnection

func RecordSSConnection(endpoint string, status string, latency int64)

Types

type CMetric

type CMetric int

************************************ Types ****************************

const (
	RRDropMaxRetry CMetric = CMetric(iota)
	RRDropQueueFull
	RRDropRecExpired
	SSL_CLIENT_INFO
	CLIENT_INFO
	Accept
	Close
	RAPI
	ReqProc
	ProcErr
	SoftMark
	TLSStatus
	Inbound
	Replication
	OutboundConnection
	SSConnection
)

*************************** Constants ****************************

type DataPoint

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

type GaugeMetric

type GaugeMetric struct {
	MetricShortName string
	MetricName      string
	// contains filtered or unexported fields
}

type ServerType

type ServerType int

type StateData

type StateData struct {
	Name       string
	Value      float64
	Dimensions instrument.MeasurementOption
}

Represents stats by a worker

type Tags

type Tags struct {
	TagName  string
	TagValue string
}

Directories

Path Synopsis
Copyright 2023 PayPal Inc.
Copyright 2023 PayPal Inc.

Jump to

Keyboard shortcuts

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