metrics

package
v0.0.0-...-7971d7e Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidateRuleOperation             string = "ValidateRule"
	ApplyScriptOperation              string = "ApplyScript"
	ApplyYamlOperation                string = "ApplyYaml"
	ApplyCustomResource               string = "ApplyCustomResource"
	ReceiveDataChannelOperation       string = "ReceiveFromDataChannel"
	ReceiveErrorChannelOperation      string = "ReceiveFromErrorChannel"
	ConvertResourceDataBytesOperation string = "ConvertResourceDataToBytes"
	ObjectOperation                   string = "Object"
	ResourceOperation                 string = "Resource"
	PullChartOperation                string = "PullChart"
	LoadChartOperation                string = "LoadChart"
	HelmChartOperation                string = "HelmChart"
	HelmActionConfigOperation         string = "HelmActionConfig"
	HelmPropertiesOperation           string = "HelmProperties"
	K8SProjectorOperation             string = "K8SProjector"
	K8SDeploymentOperation            string = "K8SDeployment"
	K8SRemoveServiceOperation         string = "K8SRemoveService"
	K8SRemoveDeploymentOperation      string = "K8SRemoveDeployment"
	K8SRemoveNamespaceOperation       string = "K8SRemoveNamespace"
	ConfigMapOperation                string = "ConfigMap"
	IngressOperation                  string = "Ingress"
	IngressPropertiesOperation        string = "IngressProperties"

	ProcessOperation string = "Process"
	ApplyOperation   string = "Apply"

	GetOperationType      string = "Get"
	ValidateOperationType string = "Validate"
	RunOperationType      string = "Run"
	ApplyOperationType    string = "Apply"
)

Variables

This section is empty.

Functions

func Target

func Target(
	providerType string,
	functionName string,
	operation string,
	operationType string,
	errorCode string,
) map[string]any

Target gets common logging attributes for a target.

func TargetWithoutErrorCode

func TargetWithoutErrorCode(
	providerType string,
	functionName string,
	operation string,
	operationType string,
) map[string]any

Types

type Metrics

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

Metrics is a metrics tracker for a provider operation.

func New

func New() (*Metrics, error)

func (*Metrics) Close

func (m *Metrics) Close()

Close closes all metrics.

func (*Metrics) ProviderOperationErrors

func (m *Metrics) ProviderOperationErrors(
	providerType string,
	functionName string,
	operation string,
	operationType string,
	errorCode string,
)

ProviderOperationErrors increments the count of errors for provider target.

func (*Metrics) ProviderOperationLatency

func (m *Metrics) ProviderOperationLatency(
	startTime time.Time,
	providerType string,
	operation string,
	operationType string,
	functionName string,
)

ProviderOperationLatency tracks the overall provider target latency.

Jump to

Keyboard shortcuts

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