metrics

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncrementExternalPayloadUsed

func IncrementExternalPayloadUsed(entityName string, operation string, payloadType string)

func IncrementTaskExecuteError

func IncrementTaskExecuteError(taskType string, err error)

func IncrementTaskExecutionQueueFull

func IncrementTaskExecutionQueueFull(taskType string)

func IncrementTaskPaused

func IncrementTaskPaused(taskType string)

func IncrementTaskPoll

func IncrementTaskPoll(taskType string)

func IncrementTaskPollError

func IncrementTaskPollError(taskType string, err error)

func IncrementTaskUpdateError

func IncrementTaskUpdateError(taskType string, err error)

func IncrementUncaughtException

func IncrementUncaughtException(message string)

func IncrementWorkflowStartError

func IncrementWorkflowStartError(workflowType string, err error)

func ProvideMetrics

func ProvideMetrics(metricsSettings *settings.MetricsSettings)

ProvideMetrics start collecting metrics for the workers We use prometheus to collect metrics from the workers. When called this function starts the metrics server and publishes the worker metrics

func RecordTaskExecuteTime

func RecordTaskExecuteTime(taskType string, timeSpent float64)

func RecordTaskPollTime

func RecordTaskPollTime(taskType string, timeSpent float64)

func RecordTaskResultPayloadSize

func RecordTaskResultPayloadSize(taskType string, payloadSize float64)

func RecordTaskUpdateTime

func RecordTaskUpdateTime(taskType string, timeSpent float64)

func RecordWorkflowInputPayloadSize

func RecordWorkflowInputPayloadSize(workflowType string, version string, payloadSize float64)

Types

type MetricDetails

type MetricDetails struct {
	Name        string
	Description string
	Labels      []string
}

func NewMetricDetails

func NewMetricDetails(
	name MetricName,
	description MetricDocumentation,
	labels []MetricLabel,
) *MetricDetails

type MetricDocumentation

type MetricDocumentation string
const (
	EXTERNAL_PAYLOAD_USED_DOC     MetricDocumentation = "Incremented each time external payload storage is used"
	TASK_ACK_ERROR_DOC            MetricDocumentation = "Task ack has encountered an exception"
	TASK_ACK_FAILED_DOC           MetricDocumentation = "Task ack failed"
	TASK_EXECUTE_ERROR_DOC        MetricDocumentation = "Execution error"
	TASK_EXECUTE_TIME_DOC         MetricDocumentation = "Time to execute a task"
	TASK_EXECUTION_QUEUE_FULL_DOC MetricDocumentation = "Counter to record execution queue has saturated"
	TASK_PAUSED_DOC               MetricDocumentation = "Counter for number of times the task has been polled, when the worker has been paused"
	TASK_POLL_DOC                 MetricDocumentation = "Incremented each time polling is done"
	TASK_POLL_ERROR_DOC           MetricDocumentation = "Client error when polling for a task queue"
	TASK_POLL_TIME_DOC            MetricDocumentation = "Time to poll for a batch of tasks"
	TASK_RESULT_SIZE_DOC          MetricDocumentation = "Records output payload size of a task"
	TASK_UPDATE_ERROR_DOC         MetricDocumentation = "Task status cannot be updated back to server"
	TASK_UPDATE_TIME_DOC          MetricDocumentation = "Time to update for a task"
	THREAD_UNCAUGHT_EXCEPTION_DOC MetricDocumentation = "thread_uncaught_exceptions"
	WORKFLOW_START_ERROR_DOC      MetricDocumentation = "Counter for workflow start errors"
	WORKFLOW_INPUT_SIZE_DOC       MetricDocumentation = "Records input payload size of a workflow"
)

type MetricLabel

type MetricLabel string
const (
	ENTITY_NAME      MetricLabel = "entityName"
	EXCEPTION        MetricLabel = "exception"
	OPERATION        MetricLabel = "operation"
	PAYLOAD_TYPE     MetricLabel = "payload_type"
	TASK_TYPE        MetricLabel = "taskType"
	WORKFLOW_TYPE    MetricLabel = "workflowType"
	WORKFLOW_VERSION MetricLabel = "version"
)

type MetricName

type MetricName string
const (
	EXTERNAL_PAYLOAD_USED     MetricName = "external_payload_used"
	TASK_EXECUTE_ERROR        MetricName = "task_execute_error"
	TASK_EXECUTE_TIME         MetricName = "task_execute_time"
	TASK_EXECUTION_QUEUE_FULL MetricName = "task_execution_queue_full"
	TASK_PAUSED               MetricName = "task_paused"
	TASK_POLL                 MetricName = "task_poll"
	TASK_POLL_ERROR           MetricName = "task_poll_error"
	TASK_POLL_TIME            MetricName = "task_poll_time"
	TASK_RESULT_SIZE          MetricName = "task_result_size"
	TASK_UPDATE_ERROR         MetricName = "task_update_error"
	TASK_UPDATE_TIME          MetricName = "task_update_time"
	THREAD_UNCAUGHT_EXCEPTION MetricName = "thread_uncaught_exceptions"
	WORKFLOW_INPUT_SIZE       MetricName = "workflow_input_size"
	WORKFLOW_START_ERROR      MetricName = "workflow_start_error"
)

List of metrics that are collected when metrics server is enabled

type Operation

type Operation string
const (
	READ  Operation = "READ"
	WRITE Operation = "WRITE"
)

type PayloadType

type PayloadType string
const (
	TASK_INPUT  PayloadType = "TASK_INPUT"
	TASK_OUTPUT PayloadType = "TASK_INPUT"
)

Jump to

Keyboard shortcuts

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