metrics

package
v1.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Package metrics is a generated GoMock package.

Index

Examples

Constants

View Source
const (
	// FrameworkTally tally framework id
	FrameworkTally = "tally"
	// FrameworkOpentelemetry OpenTelemetry framework id
	FrameworkOpentelemetry = "opentelemetry"
)

Supported framework types

View Source
const (
	UnitNameDimensionless = "dimensionless"
	UnitNameMilliseconds  = "milliseconds"
	UnitNameBytes         = "bytes"
)

Valid unit name for PerUnitHistogramBoundaries config field

View Source
const (
	Dimensionless = "1"
	Milliseconds  = "ms"
	Bytes         = "By"
	Seconds       = "s"
)

MetricUnit supported values Values are pulled from https://pkg.go.dev/golang.org/x/exp/event#Unit

View Source
const (
	OperationTagName     = "operation"
	ServiceRoleTagName   = "service_role"
	CacheTypeTagName     = "cache_type"
	FailureTagName       = "failure"
	FailureSourceTagName = "failure_source"
	TaskCategoryTagName  = "task_category"
	TaskTypeTagName      = "task_type"
	TaskPriorityTagName  = "task_priority"
	QueueReaderIDTagName = "queue_reader_id"
	QueueActionTagName   = "queue_action"
	QueueTypeTagName     = "queue_type"

	ErrorTypeTagName = "error_type"

	PartitionTagName               = "partition"
	PriorityTagName                = "priority"
	PersistenceDBKindTagName       = "db_kind"
	WorkerPluginNameTagName        = "worker_plugin_name"
	WorkerStorageDriverTypeTagName = "worker_storage_driver_type"

	ArchetypeTagName     = "archetype"
	ChasmTaskTypeTagName = "chasm_task_type"
)

Common tags for all services

View Source
const (
	HistoryRoleTagValue       = "history"
	MatchingRoleTagValue      = "matching"
	FrontendRoleTagValue      = "frontend"
	AdminRoleTagValue         = "admin"
	OperatorRoleTagValue      = "operator"
	DCRedirectionRoleTagValue = "dc_redirection"
	BlobstoreRoleTagValue     = "blobstore"

	MutableStateCacheTypeTagValue                     = "mutablestate"
	EventsCacheTypeTagValue                           = "events"
	VersionMembershipCacheTypeTagValue                = "version_membership"
	ReactivationSignalDedupCacheTypeTagValue          = "reactivation_signal_dedup"
	RoutingInfoCacheTypeTagValue                      = "routing_info"
	NexusEndpointRegistryReadThroughCacheTypeTagValue = "nexus_endpoint_registry_readthrough"
	ReplicationProgressCacheTypeTagValue              = "replication_progress"

	InvalidHistoryURITagValue    = "invalid_history_uri"
	InvalidVisibilityURITagValue = "invalid_visibility_uri"

	ActiveNamespaceStateTagValue  = "active"
	PassiveNamespaceStateTagValue = "passive"
	UnknownNamespaceStateTagValue = "unknown"
)

This package should hold all the metrics and tags for temporal

View Source
const (
	MatchingClientPollWorkflowTaskQueueScope = "MatchingClientPollWorkflowTaskQueue"
	MatchingClientPollActivityTaskQueueScope = "MatchingClientPollActivityTaskQueue"
	MatchingClientPollNexusTaskQueueScope    = "MatchingClientPollNexusTaskQueue"
	MatchingClientAddActivityTaskScope       = "MatchingClientAddActivityTask"
	MatchingClientAddWorkflowTaskScope       = "MatchingClientAddWorkflowTask"
	MatchingClientQueryWorkflowScope         = "MatchingClientQueryWorkflow"
	MatchingClientDispatchNexusTaskScope     = "MatchingDispatchNexusTask"
)

Matching Client Operations

View Source
const (
	// TaskQueueScavengerScope is scope used by all metrics emitted by worker.taskqueue.Scavenger module
	TaskQueueScavengerScope = "TaskQueueScavenger"
	// ExecutionsScavengerScope is scope used by all metrics emitted by worker.executions.Scavenger module
	ExecutionsScavengerScope = "ExecutionsScavenger"
)

Worker

View Source
const (
	// PersistenceAppendHistoryNodesScope tracks AppendHistoryNodes calls made by service to persistence layer
	PersistenceAppendHistoryNodesScope = "AppendHistoryNodes"
	// PersistenceAppendRawHistoryNodesScope tracks AppendRawHistoryNodes calls made by service to persistence layer
	PersistenceAppendRawHistoryNodesScope = "AppendRawHistoryNodes"
	// PersistenceReadHistoryBranchScope tracks ReadHistoryBranch calls made by service to persistence layer
	PersistenceReadHistoryBranchScope = "ReadHistoryBranch"
	// PersistenceReadHistoryBranchReverseScope tracks ReadHistoryBranchReverse calls made by service to persistence layer
	PersistenceReadHistoryBranchReverseScope = "ReadHistoryBranchReverse"
	// PersistenceReadRawHistoryBranchScope tracks ReadRawHistoryBranch calls made by service to persistence layer
	PersistenceReadRawHistoryBranchScope = "ReadRawHistoryBranch"
	// PersistenceForkHistoryBranchScope tracks ForkHistoryBranch calls made by service to persistence layer
	PersistenceForkHistoryBranchScope = "ForkHistoryBranch"
	// PersistenceDeleteHistoryBranchScope tracks DeleteHistoryBranch calls made by service to persistence layer
	PersistenceDeleteHistoryBranchScope = "DeleteHistoryBranch"
	// PersistenceTrimHistoryBranchScope tracks TrimHistoryBranch calls made by service to persistence layer
	PersistenceTrimHistoryBranchScope = "TrimHistoryBranch"
	// PersistenceGetAllHistoryTreeBranchesScope tracks GetAllHistoryTreeBranches calls made by service to persistence layer
	PersistenceGetAllHistoryTreeBranchesScope = "GetAllHistoryTreeBranches"
	// PersistenceNamespaceReplicationQueueScope is the metrics scope for namespace replication queue
	PersistenceNamespaceReplicationQueueScope = "NamespaceReplicationQueue"
	// PersistenceEnqueueMessageScope tracks Enqueue calls made by service to persistence layer
	PersistenceEnqueueMessageScope = "EnqueueMessage"
	// PersistenceEnqueueMessageToDLQScope tracks Enqueue DLQ calls made by service to persistence layer
	PersistenceEnqueueMessageToDLQScope = "EnqueueMessageToDLQ"
	// PersistenceReadQueueMessagesScope tracks ReadMessages calls made by service to persistence layer
	PersistenceReadQueueMessagesScope = "ReadQueueMessages"
	// PersistenceReadMessagesFromDLQScope tracks ReadMessagesFromDLQ calls made by service to persistence layer
	PersistenceReadMessagesFromDLQScope = "ReadMessagesFromDLQ"
	// PersistenceDeleteMessagesBeforeScope tracks DeleteMessagesBefore calls made by service to persistence layer
	PersistenceDeleteMessagesBeforeScope = "DeleteMessagesBefore"
	// PersistenceDeleteMessageFromDLQScope tracks DeleteMessageFromDLQ calls made by service to persistence layer
	PersistenceDeleteMessageFromDLQScope = "DeleteMessageFromDLQ"
	// PersistenceRangeDeleteMessagesFromDLQScope tracks RangeDeleteMessagesFromDLQ calls made by service to persistence layer
	PersistenceRangeDeleteMessagesFromDLQScope = "RangeDeleteMessagesFromDLQ"
	// PersistenceUpdateAckLevelScope tracks UpdateAckLevel calls made by service to persistence layer
	PersistenceUpdateAckLevelScope = "UpdateAckLevel"
	// PersistenceGetAckLevelScope tracks GetAckLevel calls made by service to persistence layer
	PersistenceGetAckLevelScope = "GetAckLevel"
	// PersistenceUpdateDLQAckLevelScope tracks UpdateDLQAckLevel calls made by service to persistence layer
	PersistenceUpdateDLQAckLevelScope = "UpdateDLQAckLevel"
	// PersistenceGetDLQAckLevelScope tracks GetDLQAckLevel calls made by service to persistence layer
	PersistenceGetDLQAckLevelScope = "GetDLQAckLevel"
	// PersistenceListClusterMetadataScope tracks ListClusterMetadata calls made by service to persistence layer
	PersistenceListClusterMetadataScope = "ListClusterMetadata"
	// PersistenceGetClusterMetadataScope tracks GetClusterMetadata calls made by service to persistence layer
	PersistenceGetClusterMetadataScope = "GetClusterMetadata"
	// PersistenceGetCurrentClusterMetadataScope tracks GetCurrentClusterMetadata calls made by service to persistence layer
	PersistenceGetCurrentClusterMetadataScope = "GetCurrentClusterMetadata"
	// PersistenceSaveClusterMetadataScope tracks SaveClusterMetadata calls made by service to persistence layer
	PersistenceSaveClusterMetadataScope = "SaveClusterMetadata"
	// PersistenceDeleteClusterMetadataScope tracks DeleteClusterMetadata calls made by service to persistence layer
	PersistenceDeleteClusterMetadataScope = "DeleteClusterMetadata"
	// PersistenceUpsertClusterMembershipScope tracks UpsertClusterMembership calls made by service to persistence layer
	PersistenceUpsertClusterMembershipScope = "UpsertClusterMembership"
	// PersistencePruneClusterMembershipScope tracks PruneClusterMembership calls made by service to persistence layer
	PersistencePruneClusterMembershipScope = "PruneClusterMembership"
	// PersistenceGetClusterMembersScope tracks GetClusterMembers calls made by service to persistence layer
	PersistenceGetClusterMembersScope = "GetClusterMembers"
	// PersistenceGetOrCreateShardScope tracks GetOrCreateShard calls made by service to persistence layer
	PersistenceGetOrCreateShardScope = "GetOrCreateShard"
	// PersistenceUpdateShardScope tracks UpdateShard calls made by service to persistence layer
	PersistenceUpdateShardScope = "UpdateShard"
	// PersistenceAssertShardOwnershipScope tracks UpdateShard calls made by service to persistence layer
	PersistenceAssertShardOwnershipScope = "AssertShardOwnership"
	// PersistenceCreateWorkflowExecutionScope tracks CreateWorkflowExecution calls made by service to persistence layer
	PersistenceCreateWorkflowExecutionScope = "CreateWorkflowExecution"
	// PersistenceGetWorkflowExecutionScope tracks GetWorkflowExecution calls made by service to persistence layer
	PersistenceGetWorkflowExecutionScope = "GetWorkflowExecution"
	// PersistenceSetWorkflowExecutionScope tracks SetWorkflowExecution calls made by service to persistence layer
	PersistenceSetWorkflowExecutionScope = "SetWorkflowExecution"
	// PersistenceUpdateWorkflowExecutionScope tracks UpdateWorkflowExecution calls made by service to persistence layer
	PersistenceUpdateWorkflowExecutionScope = "UpdateWorkflowExecution"
	// PersistenceConflictResolveWorkflowExecutionScope tracks ConflictResolveWorkflowExecution calls made by service to persistence layer
	PersistenceConflictResolveWorkflowExecutionScope = "ConflictResolveWorkflowExecution"
	// PersistenceDeleteWorkflowExecutionScope tracks DeleteWorkflowExecution calls made by service to persistence layer
	PersistenceDeleteWorkflowExecutionScope = "DeleteWorkflowExecution"
	// PersistenceDeleteCurrentWorkflowExecutionScope tracks DeleteCurrentWorkflowExecution calls made by service to persistence layer
	PersistenceDeleteCurrentWorkflowExecutionScope = "DeleteCurrentWorkflowExecution"
	// PersistenceGetCurrentExecutionScope tracks GetCurrentExecution calls made by service to persistence layer
	PersistenceGetCurrentExecutionScope = "GetCurrentExecution"
	// PersistenceListConcreteExecutionsScope tracks ListConcreteExecutions calls made by service to persistence layer
	PersistenceListConcreteExecutionsScope = "ListConcreteExecutions"
	// PersistenceAddTasksScope tracks AddTasks calls made by service to persistence layer
	PersistenceAddTasksScope = "AddTasks"
	// PersistenceGetTransferTasksScope tracks GetTransferTasks calls made by service to persistence layer
	PersistenceGetTransferTasksScope = "GetTransferTasks"
	// PersistenceCompleteTransferTaskScope tracks CompleteTransferTasks calls made by service to persistence layer
	PersistenceCompleteTransferTaskScope = "CompleteTransferTask"
	// PersistenceRangeCompleteTransferTasksScope tracks CompleteTransferTasks calls made by service to persistence layer
	PersistenceRangeCompleteTransferTasksScope = "RangeCompleteTransferTasks"
	// PersistenceGetVisibilityTasksScope tracks GetVisibilityTasks calls made by service to persistence layer
	PersistenceGetVisibilityTasksScope = "GetVisibilityTasks"
	// PersistenceCompleteVisibilityTaskScope tracks CompleteVisibilityTasks calls made by service to persistence layer
	PersistenceCompleteVisibilityTaskScope = "CompleteVisibilityTask"
	// PersistenceRangeCompleteVisibilityTasksScope tracks CompleteVisibilityTasks calls made by service to persistence layer
	PersistenceRangeCompleteVisibilityTasksScope = "RangeCompleteVisibilityTasks"
	// PersistenceGetReplicationTaskScope tracks GetReplicationTask calls made by service to persistence layer
	PersistenceGetArchivalTasksScope = "GetArchivalTasks"
	// PersistenceGetOutboundTasksScope tracks GetOutboundTasks calls made by service to persistence layer
	PersistenceGetOutboundTasksScope = "GetOutboundTasks"
	// PersistenceCompleteOutboundTasksScope tracks CompleteOutboundTasks calls made by service to persistence layer
	PersistenceCompleteOutboundTasksScope = "CompleteOutboundTasks"
	// PersistenceRangeCompleteOutboundTasksScope tracks RangeCompleteOutboundTasks calls made by service to persistence layer
	PersistenceRangeCompleteOutboundTasksScope = "RangeCompleteOutboundTasks"
	// PersistenceCompleteArchivalTaskScope tracks CompleteArchivalTasks calls made by service to persistence layer
	PersistenceCompleteArchivalTaskScope = "CompleteArchivalTask"
	// PersistenceRangeCompleteArchivalTasksScope tracks CompleteArchivalTasks calls made by service to persistence layer
	PersistenceRangeCompleteArchivalTasksScope = "RangeCompleteArchivalTasks"
	// PersistenceGetReplicationTasksScope tracks GetReplicationTasks calls made by service to persistence layer
	PersistenceGetReplicationTasksScope = "GetReplicationTasks"
	// PersistenceCompleteReplicationTaskScope tracks CompleteReplicationTasks calls made by service to persistence layer
	PersistenceCompleteReplicationTaskScope = "CompleteReplicationTask"
	// PersistenceRangeCompleteReplicationTasksScope tracks RangeCompleteReplicationTasks calls made by service to persistence layer
	PersistenceRangeCompleteReplicationTasksScope = "RangeCompleteReplicationTasks"
	// PersistencePutReplicationTaskToDLQScope tracks PersistencePutReplicationTaskToDLQScope calls made by service to persistence layer
	PersistencePutReplicationTaskToDLQScope = "PutReplicationTaskToDLQ"
	// PersistenceGetReplicationTasksFromDLQScope tracks PersistenceGetReplicationTasksFromDLQScope calls made by service to persistence layer
	PersistenceGetReplicationTasksFromDLQScope = "GetReplicationTasksFromDLQ"
	// PersistenceDeleteReplicationTaskFromDLQScope tracks PersistenceDeleteReplicationTaskFromDLQScope calls made by service to persistence layer
	PersistenceDeleteReplicationTaskFromDLQScope = "DeleteReplicationTaskFromDLQ"
	// PersistenceRangeDeleteReplicationTaskFromDLQScope tracks PersistenceRangeDeleteReplicationTaskFromDLQScope calls made by service to persistence layer
	PersistenceRangeDeleteReplicationTaskFromDLQScope = "RangeDeleteReplicationTaskFromDLQ"
	// PersistenceGetTimerTasksScope tracks GetTimerTasks calls made by service to persistence layer
	PersistenceGetTimerTasksScope = "GetTimerTasks"
	// PersistenceCompleteTimerTaskScope tracks CompleteTimerTasks calls made by service to persistence layer
	PersistenceCompleteTimerTaskScope = "CompleteTimerTask"
	// PersistenceRangeCompleteTimerTasksScope tracks CompleteTimerTasks calls made by service to persistence layer
	PersistenceRangeCompleteTimerTasksScope = "RangeCompleteTimerTasks"
	// PersistenceCreateTasksScope tracks CreateTasks calls made by service to persistence layer
	PersistenceCreateTasksScope = "CreateTasks"
	// PersistenceGetTasksScope tracks GetTasks calls made by service to persistence layer
	PersistenceGetTasksScope = "GetTasks"
	// PersistenceCompleteTaskScope tracks CompleteTask calls made by service to persistence layer
	PersistenceCompleteTaskScope = "CompleteTask"
	// PersistenceCompleteTasksLessThanScope is the metric scope for persistence.TaskManager.PersistenceCompleteTasksLessThan API
	PersistenceCompleteTasksLessThanScope = "CompleteTasksLessThan"
	// PersistenceCreateTaskQueueScope tracks PersistenceCreateTaskQueueScope calls made by service to persistence layer
	PersistenceCreateTaskQueueScope = "CreateTaskQueue"
	// PersistenceUpdateTaskQueueScope tracks PersistenceUpdateTaskQueueScope calls made by service to persistence layer
	PersistenceUpdateTaskQueueScope = "UpdateTaskQueue"
	// PersistenceGetTaskQueueScope tracks PersistenceGetTaskQueueScope calls made by service to persistence layer
	PersistenceGetTaskQueueScope = "GetTaskQueue"
	// PersistenceListTaskQueueScope is the metric scope for persistence.TaskManager.ListTaskQueue API
	PersistenceListTaskQueueScope = "ListTaskQueue"
	// PersistenceDeleteTaskQueueScope is the metric scope for persistence.TaskManager.DeleteTaskQueue API
	PersistenceDeleteTaskQueueScope = "DeleteTaskQueue"
	// PersistenceGetTaskQueueUserDataScope is the metric scope for persistence.TaskManager.GetTaskQueueUserData API
	PersistenceGetTaskQueueUserDataScope = "GetTaskQueueUserData"
	// PersistenceUpdateTaskQueueUserDataScope is the metric scope for persistence.TaskManager.UpdateTaskQueueUserData API
	PersistenceUpdateTaskQueueUserDataScope = "UpdateTaskQueueUserData"
	// PersistenceListTaskQueueUserDataEntriesScope is the metric scope for persistence.TaskManager.ListTaskQueueUserDataEntries API
	PersistenceListTaskQueueUserDataEntriesScope = "ListTaskQueueUserDataEntries"
	// PersistenceGetTaskQueuesByBuildIdScope is the metric scope for persistence.TaskManager.GetTaskQueuesByBuildId API
	PersistenceGetTaskQueuesByBuildIdScope = "GetTaskQueuesByBuildId"
	// PersistenceCountTaskQueuesByBuildIdScope is the metric scope for persistence.TaskManager.CountTaskQueuesByBuildId API
	PersistenceCountTaskQueuesByBuildIdScope = "CountTaskQueuesByBuildId"
	// PersistenceInitializeSystemNamespaceScope tracks InitializeSystemNamespaceScope calls made by service to persistence layer
	PersistenceInitializeSystemNamespaceScope = "InitializeSystemNamespace"
	// PersistenceCreateNamespaceScope tracks CreateNamespace calls made by service to persistence layer
	PersistenceCreateNamespaceScope = "CreateNamespace"
	// PersistenceGetNamespaceScope tracks GetNamespace calls made by service to persistence layer
	PersistenceGetNamespaceScope = "GetNamespace"
	// PersistenceUpdateNamespaceScope tracks UpdateNamespace calls made by service to persistence layer
	PersistenceUpdateNamespaceScope = "UpdateNamespace"
	// PersistenceDeleteNamespaceScope tracks DeleteNamespace calls made by service to persistence layer
	PersistenceDeleteNamespaceScope = "DeleteNamespace"
	// PersistenceRenameNamespaceScope tracks RenameNamespace calls made by service to persistence layer
	PersistenceRenameNamespaceScope = "RenameNamespace"
	// PersistenceDeleteNamespaceByNameScope tracks DeleteNamespaceByName calls made by service to persistence layer
	PersistenceDeleteNamespaceByNameScope = "DeleteNamespaceByName"
	// PersistenceListNamespacesScope tracks ListNamespaces calls made by service to persistence layer
	PersistenceListNamespacesScope = "ListNamespaces"
	// PersistenceGetMetadataScope tracks GetMetadata calls made by service to persistence layer
	PersistenceGetMetadataScope = "GetMetadata"
	// PersistenceWatchNamespacesScope tracks WatchNamespaces calls made by service to persistence layer
	PersistenceWatchNamespacesScope = "WatchNamespaces"
	// PersistenceGetNexusEndpointScope tracks GetNexusEndpoint calls made by service to persistence layer
	PersistenceGetNexusEndpointScope = "GetNexusEndpoint"
	// PersistenceListNexusEndpointsScope tracks ListNexusEndpoint calls made by service to persistence layer
	PersistenceListNexusEndpointsScope = "ListNexusEndpoints"
	// PersistenceCreateOrUpdateNexusEndpointScope tracks CreateOrUpdateNexusEndpoint calls made by service to persistence layer
	PersistenceCreateOrUpdateNexusEndpointScope = "CreateOrUpdateNexusEndpoint"
	// PersistenceDeleteNexusEndpointScope tracks DeleteNexusEndpoint calls made by service to persistence layer
	PersistenceDeleteNexusEndpointScope = "DeleteNexusEndpoint"

	// VisibilityPersistenceRecordWorkflowExecutionStartedScope tracks RecordWorkflowExecutionStarted calls made by service to visibility persistence layer
	VisibilityPersistenceRecordWorkflowExecutionStartedScope = "RecordWorkflowExecutionStarted"
	// VisibilityPersistenceRecordWorkflowExecutionClosedScope tracks RecordWorkflowExecutionClosed calls made by service to visibility persistence layer
	VisibilityPersistenceRecordWorkflowExecutionClosedScope = "RecordWorkflowExecutionClosed"
	// VisibilityPersistenceUpsertWorkflowExecutionScope tracks UpsertWorkflowExecution calls made by service to persistence visibility layer
	VisibilityPersistenceUpsertWorkflowExecutionScope = "UpsertWorkflowExecution"
	// VisibilityPersistenceDeleteWorkflowExecutionScope tracks DeleteWorkflowExecutions calls made by service to visibility persistence layer
	VisibilityPersistenceDeleteWorkflowExecutionScope = "DeleteWorkflowExecution"
	// VisibilityPersistenceListWorkflowExecutionsScope tracks ListWorkflowExecutions calls made by service to visibility persistence layer
	VisibilityPersistenceListWorkflowExecutionsScope = "ListWorkflowExecutions"
	// VisibilityPersistenceListChasmExecutionsScope tracks ListChasmExecutions calls made by service to visibility persistence layer
	VisibilityPersistenceListChasmExecutionsScope = "ListChasmExecutions"
	// VisibilityPersistenceScanWorkflowExecutionsScope tracks ScanWorkflowExecutions calls made by service to visibility persistence layer
	VisibilityPersistenceScanWorkflowExecutionsScope = "ScanWorkflowExecutions"
	// VisibilityPersistenceCountWorkflowExecutionsScope tracks CountWorkflowExecutions calls made by service to visibility persistence layer
	VisibilityPersistenceCountWorkflowExecutionsScope = "CountWorkflowExecutions"
	// VisibilityPersistenceCountChasmExecutionsScope tracks CountChasmExecutions calls made by service to visibility persistence layer
	VisibilityPersistenceCountChasmExecutionsScope = "CountChasmExecutions"
	// VisibilityPersistenceGetWorkflowExecutionScope tracks GetWorkflowExecution calls made by service to visibility persistence layer
	VisibilityPersistenceGetWorkflowExecutionScope = "GetWorkflowExecution"
	// VisibilityPersistenceAddSearchAttributesScope tracks AddSearchAttributes calls made by service to visibility persistence layer
	VisibilityPersistenceAddSearchAttributesScope = "AddSearchAttributes"
)
View Source
const (
	ServerTlsScope = "ServerTls"
	// AuthorizationScope is the scope used by all metric emitted by authorization code
	AuthorizationScope = "Authorization"
	// NamespaceCacheScope tracks namespace cache callbacks
	NamespaceCacheScope = "NamespaceCache"
)

Common

View Source
const (
	// AdminGetWorkflowExecutionRawHistoryV2Scope is the metric scope for admin.GetWorkflowExecutionRawHistoryScope
	AdminGetWorkflowExecutionRawHistoryV2Scope = "AdminGetWorkflowExecutionRawHistoryV2"
	// AdminGetWorkflowExecutionRawHistoryScope is the metric scope for admin.GetWorkflowExecutionRawHistoryScope
	AdminGetWorkflowExecutionRawHistoryScope = "AdminGetWorkflowExecutionRawHistory"
	// OperatorAddSearchAttributesScope is the metric scope for operator.AddSearchAttributes
	OperatorAddSearchAttributesScope = "OperatorAddSearchAttributes"
	// OperatorDeleteNamespaceScope is the metric scope for operator.OperatorDeleteNamespace
	OperatorDeleteNamespaceScope = "OperatorDeleteNamespace"

	// FrontendGetWorkflowExecutionHistoryScope is the metric scope for non-long-poll frontend.GetWorkflowExecutionHistory
	FrontendGetWorkflowExecutionHistoryScope = "GetWorkflowExecutionHistory"
	// FrontendPollWorkflowExecutionHistoryScope is the metric scope for long poll case of frontend.GetWorkflowExecutionHistory
	FrontendPollWorkflowExecutionHistoryScope = "PollWorkflowExecutionHistory"

	// VersionCheckScope is scope used by version checker
	VersionCheckScope = "VersionCheck"
)

Frontend Scope

View Source
const (
	// HistoryStartWorkflowExecutionScope tracks StartWorkflowExecution API calls received by service
	HistoryStartWorkflowExecutionScope = "StartWorkflowExecution"
	// HistoryRecordActivityTaskHeartbeatScope tracks RecordActivityTaskHeartbeat API calls received by service
	HistoryRecordActivityTaskHeartbeatScope = "RecordActivityTaskHeartbeat"
	// HistoryRespondWorkflowTaskCompletedScope tracks RespondWorkflowTaskCompleted API calls received by service
	HistoryRespondWorkflowTaskCompletedScope = "RespondWorkflowTaskCompleted"
	HistoryRespondWorkflowTaskFailedScope    = "RespondWorkflowTaskFailed"
	// HistoryRespondActivityTaskCompletedScope tracks RespondActivityTaskCompleted API calls received by service
	HistoryRespondActivityTaskCompletedScope = "RespondActivityTaskCompleted"
	// HistoryRespondActivityTaskFailedScope tracks RespondActivityTaskFailed API calls received by service
	HistoryRespondActivityTaskFailedScope = "RespondActivityTaskFailed"
	// HistoryRespondActivityTaskCanceledScope tracks RespondActivityTaskCanceled API calls received by service
	HistoryRespondActivityTaskCanceledScope = "RespondActivityTaskCanceled"
	// ActivityTerminatedScope identifies applied activity termination mutations.
	ActivityTerminatedScope = "ActivityTerminated"
	// ActivityPausedScope identifies applied activity pause mutations.
	ActivityPausedScope = "ActivityPaused"
	// ActivityUnpausedScope identifies applied activity unpause mutations.
	ActivityUnpausedScope = "ActivityUnpaused"
	// ActivityResetScope identifies applied activity reset mutations.
	ActivityResetScope = "ActivityReset"
	// ActivityUpdateOptionsScope identifies applied activity option mutations.
	ActivityUpdateOptionsScope = "ActivityUpdateOptions"
	// HistoryGetWorkflowExecutionHistoryScope is the metric scope for non-long-poll frontend.GetWorkflowExecutionHistory
	HistoryGetWorkflowExecutionHistoryScope = "GetWorkflowExecutionHistory"
	// HistoryPollWorkflowExecutionHistoryScope is the metric scope for long poll case of frontend.GetWorkflowExecutionHistory
	HistoryPollWorkflowExecutionHistoryScope = "PollWorkflowExecutionHistory"
	// HistoryGetWorkflowExecutionRawHistoryScope tracks GetWorkflowExecutionRawHistoryV2Scope API calls received by service
	HistoryGetWorkflowExecutionRawHistoryScope = "GetWorkflowExecutionRawHistory"
	// HistoryGetWorkflowExecutionRawHistoryV2Scope tracks GetWorkflowExecutionRawHistoryV2Scope API calls received by service
	HistoryGetWorkflowExecutionRawHistoryV2Scope = "GetWorkflowExecutionRawHistoryV2"
	// HistoryGetHistoryScope tracks GetHistoryScope API calls received by service
	HistoryGetHistoryScope = "GetHistory"
	// HistoryGetRawHistoryScope tracks GetRawHistoryScope API calls received by service
	HistoryGetRawHistoryScope = "GetRawHistory"
	// HistoryGetHistoryReverseScope tracks GetHistoryReverseScope API calls received by service
	HistoryGetHistoryReverseScope = "GetHistoryReverse"
	// HistoryRecordWorkflowTaskStartedScope tracks RecordWorkflowTaskStarted API calls received by service
	HistoryRecordWorkflowTaskStartedScope = "RecordWorkflowTaskStarted"
	// HistoryRecordActivityTaskStartedScope tracks RecordActivityTaskStarted API calls received by service
	HistoryRecordActivityTaskStartedScope = "RecordActivityTaskStarted"
	// HistorySignalWithStartWorkflowExecutionScope tracks SignalWithStartWorkflowExecution API calls received by service
	HistorySignalWithStartWorkflowExecutionScope = "SignalWithStartWorkflowExecution"
	// HistoryCompleteNexusOperationScope tracks CompleteNexusOperation API calls received by service
	HistoryCompleteNexusOperationScope = "CompleteNexusOperation"
	// HistoryCompleteNexusOperationChasmScope tracks CompleteNexusOperationChasm API calls received by service
	HistoryCompleteNexusOperationChasmScope = "CompleteNexusOperationChasm"
	// HistorySyncShardStatusScope tracks HistorySyncShardStatus API calls received by service
	HistorySyncShardStatusScope = "SyncShardStatus"
	// HistoryShardControllerScope is the scope used by shard controller
	HistoryShardControllerScope = "ShardController"
	// HistoryReapplyEventsScope is the scope used by event reapplication
	HistoryReapplyEventsScope = "ReapplyEvents"
	// HistoryQueryWorkflowScope tracks QueryWorkflow API calls received by service
	HistoryQueryWorkflowScope = "QueryWorkflow"
	HistoryResetWorkflowScope = "HistoryResetWorkflow"
	// HistoryProcessDeleteHistoryEventScope tracks ProcessDeleteHistoryEvent processing calls
	HistoryProcessDeleteHistoryEventScope = "ProcessDeleteHistoryEvent"
	// HistoryDeleteWorkflowExecutionScope tracks DeleteWorkflowExecutions API calls
	HistoryDeleteWorkflowExecutionScope = "DeleteWorkflowExecution"
	// HistoryCacheGetOrCreateScope is the scope used by history cache
	HistoryCacheGetOrCreateScope = "HistoryCacheGetOrCreate"
	// HistoryCacheGetOrCreateCurrentScope is the scope used by history cache
	HistoryCacheGetOrCreateCurrentScope = "HistoryCacheGetOrCreateCurrent"

	// TransferActiveTaskCloseExecutionScope is the scope used for close execution task processing by transfer queue processor
	TransferActiveTaskCloseExecutionScope = "TransferActiveTaskCloseExecution"

	// TimerActiveTaskActivityTimeoutScope is the scope used by metric emitted by timer queue processor for processing activity timeouts
	TimerActiveTaskActivityTimeoutScope = "TimerActiveTaskActivityTimeout"
	// TimerActiveTaskWorkflowTaskTimeoutScope is the scope used by metric emitted by timer queue processor for processing workflow task timeouts
	TimerActiveTaskWorkflowTaskTimeoutScope = "TimerActiveTaskWorkflowTaskTimeout"
	// TimerActiveTaskWorkflowBackoffTimerScope is the scope used by metric emitted by timer queue processor for processing retry task.
	TimerActiveTaskWorkflowBackoffTimerScope = "TimerActiveTaskWorkflowBackoffTimer"

	// ReplicatorQueueProcessorScope is the scope used by all metric emitted by replicator queue processor
	ReplicatorQueueProcessorScope = "ReplicatorQueueProcessor"
	// ReplicateHistoryEventsScope is the scope used by historyReplicator API for applying events
	ReplicateHistoryEventsScope = "ReplicateHistoryEvents"
	// HistoryRereplicationByTransferTaskScope tracks history replication calls made by transfer task
	HistoryRereplicationByTransferTaskScope = "HistoryRereplicationByTransferTask"
	// HistoryRereplicationByTimerTaskScope tracks history replication calls made by timer task
	HistoryRereplicationByTimerTaskScope = "HistoryRereplicationByTimerTask"
	// HistoryRereplicationByHistoryReplicationScope tracks history replication calls made by history replication
	HistoryRereplicationByHistoryReplicationScope = "HistoryRereplicationByHistoryReplication"
	// HistoryRereplicationByActivityReplicationScope tracks history replication calls made by activity replication
	HistoryRereplicationByActivityReplicationScope = "HistoryRereplicationByActivityReplication"

	// ShardInfoScope is the scope used when updating shard info
	ShardInfoScope = "ShardInfo"
	// WorkflowContextScope is the scope used by WorkflowContext component
	WorkflowContextScope = "WorkflowContext"
	// ExecutionStatsScope is the scope used for emiting workflow execution related stats
	ExecutionStatsScope = "ExecutionStats"
	// SessionStatsScope is the scope used for emiting session update related stats
	SessionStatsScope = "SessionStats"
	// WorkflowCompletionStatsScope tracks workflow completion updates
	WorkflowCompletionStatsScope = "CompletionStats"
	// ReplicationTaskFetcherScope is scope used by all metrics emitted by ReplicationTaskFetcher
	ReplicationTaskFetcherScope = "ReplicationTaskFetcher"
	// ReplicationTaskTrackerScope is scope used by all metrics emitted by ExecutableTaskTracker
	ReplicationTaskTrackerScope = "ReplicationTaskTracker"
	// ReplicationTaskCleanupScope is scope used by all metrics emitted by ReplicationTaskProcessor cleanup
	ReplicationTaskCleanupScope = "ReplicationTaskCleanup"
	// ReplicationDLQStatsScope is scope used by all metrics emitted related to replication DLQ
	ReplicationDLQStatsScope = "ReplicationDLQStats"
	// EventsCacheGetEventScope is the scope used by events cache
	EventsCacheGetEventScope = "EventsCacheGetEvent"
	// EventsCachePutEventScope is the scope used by events cache
	EventsCachePutEventScope = "EventsCachePutEvent"
	// EventsCacheDeleteEventScope is the scope used by events cache
	EventsCacheDeleteEventScope = "EventsCacheDeleteEvent"
	// EventsCacheGetFromStoreScope is the scope used by events cache
	EventsCacheGetFromStoreScope = "EventsCacheGetFromStore"
	// HistoryEventNotificationScope is the scope used by shard history event notification
	HistoryEventNotificationScope = "HistoryEventNotification"
	// ArchiverClientScope is scope used by all metrics emitted by archiver.Client
	ArchiverClientScope = "ArchiverClient"
	// DeadlockDetectorScope is a scope for deadlock detector
	DeadlockDetectorScope = "DeadlockDetector"
	// OperationTimerQueueProcessorScope is a scope for timer queue base processor
	OperationTimerQueueProcessorScope = "TimerQueueProcessor"
	// OperationTransferQueueProcessorScope is a scope for transfer queue base processor
	OperationTransferQueueProcessorScope = "TransferQueueProcessor"
	// OperationVisibilityQueueProcessorScope is a scope for visibility queue processor
	OperationVisibilityQueueProcessorScope = "VisibilityQueueProcessor"
	// OperationArchivalQueueProcessorScope is a scope for archival queue processor
	OperationArchivalQueueProcessorScope = "ArchivalQueueProcessor"
	// OperationMemoryScheduledQueueProcessorScope is a scope for memory scheduled queue processor.
	OperationMemoryScheduledQueueProcessorScope = "MemoryScheduledQueueProcessor"
	// OperationOutboundQueueProcessorScope is a scope for the outbound queue processor.
	OperationOutboundQueueProcessorScope = "OutboundQueueProcessor"
	// VersionMembershipCacheGetScope is the scope used by version membership cache
	VersionMembershipCacheGetScope = "VersionMembershipCacheGet"
	// VersionMembershipCachePutScope is the scope used by version membership cache
	VersionMembershipCachePutScope = "VersionMembershipCachePut"
	// ReactivationSignalDedupScope is the scope used by the per-pod reactivation-signal
	// dedup cache on the worker-deployment client.
	ReactivationSignalDedupScope = "ReactivationSignalDedup"
	// RoutingInfoCacheGetScope is the scope used by routing info cache
	RoutingInfoCacheGetScope = "RoutingInfoCacheGet"
	// RoutingInfoCachePutScope is the scope used by routing info cache
	RoutingInfoCachePutScope = "RoutingInfoCachePut"
)

History Scope

View Source
const (
	// MatchingPollWorkflowTaskQueueScope tracks PollWorkflowTaskQueue API calls received by service
	MatchingPollWorkflowTaskQueueScope = "PollWorkflowTaskQueue"
	// MatchingPollActivityTaskQueueScope tracks PollActivityTaskQueue API calls received by service
	MatchingPollActivityTaskQueueScope = "PollActivityTaskQueue"
	// MatchingPollNexusTaskQueueScope tracks PollNexusTaskQueue API calls received by service
	MatchingPollNexusTaskQueueScope = "PollNexusTaskQueue"
	// MatchingAddActivityTaskScope tracks AddActivityTask API calls received by service
	MatchingAddActivityTaskScope = "AddActivityTask"
	// MatchingAddWorkflowTaskScope tracks AddWorkflowTask API calls received by service
	MatchingAddWorkflowTaskScope = "AddWorkflowTask"
	// MatchingTaskQueueMgrScope is the metrics scope for matching.TaskQueueManager component
	MatchingTaskQueueMgrScope = "TaskQueueMgr"
	// MatchingTaskQueuePartitionManagerScope is the metrics scope for matching.TaskQueuePartitionManager component
	MatchingTaskQueuePartitionManagerScope = "TaskQueuePartitionManager"
	// MatchingEngineScope is the metrics scope for matchingEngine component
	MatchingEngineScope = "MatchingEngine"
	// MatchingQueryWorkflowScope tracks AddWorkflowTask API calls received by service
	MatchingQueryWorkflowScope = "QueryWorkflow"
	// MatchingRespondQueryTaskCompletedScope tracks RespondQueryTaskCompleted API calls received by service
	MatchingRespondQueryTaskCompletedScope = "RespondQueryTaskCompleted"
	// MatchingRespondNexusTaskCompletedScope tracks RespondNexusTaskCompleted API calls received by service
	MatchingRespondNexusTaskCompletedScope = "RespondNexusTaskCompleted"
	// MatchingRespondNexusTaskFailedScope tracks RespondNexusTaskFailed API calls received by service
	MatchingRespondNexusTaskFailedScope = "RespondNexusTaskFailed"
)

Matching Scope

View Source
const (
	// HistoryArchiverScope is used by history archivers
	HistoryArchiverScope = "HistoryArchiver"
	// VisibilityArchiverScope is used by visibility archivers
	VisibilityArchiverScope = "VisibilityArchiver"
	// HistoryScavengerScope is scope used by all metrics emitted by worker.history.Scavenger module
	HistoryScavengerScope = "HistoryScavenger"
	// ScheduleInvariantsScannerScope is scope used by metrics emitted by the schedule-invariants scanner
	ScheduleInvariantsScannerScope = "ScheduleInvariantsScanner"
	// ArchiverDeleteHistoryActivityScope is scope used by all metrics emitted by archiver.DeleteHistoryActivity
	ArchiverDeleteHistoryActivityScope = "ArchiverDeleteHistoryActivity"
	// ArchiverUploadHistoryActivityScope is scope used by all metrics emitted by archiver.UploadHistoryActivity
	ArchiverUploadHistoryActivityScope = "ArchiverUploadHistoryActivity"
	// ArchiverArchiveVisibilityActivityScope is scope used by all metrics emitted by archiver.ArchiveVisibilityActivity
	ArchiverArchiveVisibilityActivityScope = "ArchiverArchiveVisibilityActivity"
	// ArchiverScope is scope used by all metrics emitted by archiver.Archiver
	ArchiverScope = "Archiver"
	// ArchiverPumpScope is scope used by all metrics emitted by archiver.Pump
	ArchiverPumpScope = "ArchiverPump"
	// ArchiverArchivalWorkflowScope is scope used by all metrics emitted by archiver.ArchivalWorkflow
	ArchiverArchivalWorkflowScope = "ArchiverArchivalWorkflow"
	// AddSearchAttributesWorkflowScope is scope used by all metrics emitted by worker.AddSearchAttributesWorkflowScope module
	AddSearchAttributesWorkflowScope = "AddSearchAttributesWorkflow"
	// BatcherScope is scope used by all metrics emitted by worker.Batcher module
	BatcherScope = "Batcher"
	// ElasticsearchBulkProcessor is scope used by all metric emitted by Elasticsearch bulk processor
	ElasticsearchBulkProcessor = "ElasticsearchBulkProcessor"
	// ElasticsearchVisibility is scope used by all Elasticsearch visibility metrics
	ElasticsearchVisibility = "ElasticsearchVisibility"
	// MigrationWorkflowScope is scope used by metrics emitted by migration related workflows
	MigrationWorkflowScope = "MigrationWorkflow"
	// ReplicatorScope is the scope used by all metric emitted by replicator
	ReplicatorScope = "Replicator"
	// NamespaceReplicationTaskScope is the scope used by namespace task replication processing
	NamespaceReplicationTaskScope = "NamespaceReplicationTask"
	// HistoryReplicationTaskScope is the scope used by history task replication processing
	HistoryReplicationTaskScope = "HistoryReplicationTask"
	// HistoryMetadataReplicationTaskScope is the scope used by history metadata task replication processing
	HistoryMetadataReplicationTaskScope = "HistoryMetadataReplicationTask"
	// SyncShardTaskScope is the scope used by sync shrad information processing
	SyncShardTaskScope = "SyncShardTask"
	// SyncActivityTaskScope is the scope used by sync activity
	SyncActivityTaskScope = "SyncActivityTask"
	// SyncWorkflowStateTaskScope is the scope used by closed workflow task replication processing
	SyncWorkflowStateTaskScope = "SyncWorkflowStateTask"
	// SyncHSMTaskScope is the scope used by sync HSM replication task
	SyncHSMTaskScope = "SyncHSMTask"
	// BackfillHistoryEventsTaskScope is the scope used by backfill history events replication processing
	BackfillHistoryEventsTaskScope = "BackfillHistoryEventsTask"
	// VerifyVersionedTransitionTaskScope is the scope used by verify versioned transition task processing
	VerifyVersionedTransitionTaskScope = "VerifyVersionedTransitionTask"
	// SyncVersionedTransitionTaskScope is the scope used by sync versioned transition task processing
	SyncVersionedTransitionTaskScope = "SyncVersionedTransitionTask"
	// SyncWatermarkScope is the scope used by closed workflow task replication processing
	SyncWatermarkScope = "SyncWatermark"
	// NoopTaskScope is the scope used by noop task
	NoopTaskScope = "NoopTask"
	// UnknownTaskScope is the scope used by unknown task
	UnknownTaskScope = "UnknownTask"
	// ParentClosePolicyProcessorScope is scope used by all metrics emitted by worker.ParentClosePolicyProcessor
	ParentClosePolicyProcessorScope = "ParentClosePolicyProcessor"
	// DeleteExecutionReplicationTaskScope is the scope used by delete execution replication task processing
	DeleteExecutionReplicationTaskScope = "DeleteExecutionReplicationTask"
)

Worker Scope

View Source
const (
	TaskTypeTransferActiveTaskActivity                    = "TransferActiveTaskActivity"
	TaskTypeTransferActiveTaskWorkflowTask                = "TransferActiveTaskWorkflowTask"
	TaskTypeTransferActiveTaskCloseExecution              = "TransferActiveTaskCloseExecution"
	TaskTypeTransferActiveTaskCancelExecution             = "TransferActiveTaskCancelExecution"
	TaskTypeTransferActiveTaskSignalExecution             = "TransferActiveTaskSignalExecution"
	TaskTypeTransferActiveTaskStartChildExecution         = "TransferActiveTaskStartChildExecution"
	TaskTypeTransferActiveTaskResetWorkflow               = "TransferActiveTaskResetWorkflow"
	TaskTypeTransferActiveTaskDeleteExecution             = "TransferActiveTaskDeleteExecution"
	TaskTypeTransferStandbyTaskActivity                   = "TransferStandbyTaskActivity"
	TaskTypeTransferStandbyTaskWorkflowTask               = "TransferStandbyTaskWorkflowTask"
	TaskTypeTransferStandbyTaskCloseExecution             = "TransferStandbyTaskCloseExecution"
	TaskTypeTransferStandbyTaskCancelExecution            = "TransferStandbyTaskCancelExecution"
	TaskTypeTransferStandbyTaskSignalExecution            = "TransferStandbyTaskSignalExecution"
	TaskTypeTransferStandbyTaskStartChildExecution        = "TransferStandbyTaskStartChildExecution"
	TaskTypeTransferStandbyTaskResetWorkflow              = "TransferStandbyTaskResetWorkflow"
	TaskTypeTransferStandbyTaskDeleteExecution            = "TransferStandbyTaskDeleteExecution"
	TaskTypeVisibilityTaskStartExecution                  = "VisibilityTaskStartExecution"
	TaskTypeVisibilityTaskUpsertExecution                 = "VisibilityTaskUpsertExecution"
	TaskTypeVisibilityTaskCloseExecution                  = "VisibilityTaskCloseExecution"
	TaskTypeVisibilityTaskDeleteExecution                 = "VisibilityTaskDeleteExecution"
	TaskTypeVisibilityTaskUpsertChasmExecution            = "VisibilityTaskUpsertChasmExecution"
	TaskTypeArchivalTaskArchiveExecution                  = "ArchivalTaskArchiveExecution"
	TaskTypeTimerActiveTaskActivityTimeout                = "TimerActiveTaskActivityTimeout"
	TaskTypeTimerActiveTaskWorkflowTaskTimeout            = "TimerActiveTaskWorkflowTaskTimeout"
	TaskTypeTimerActiveTaskUserTimer                      = "TimerActiveTaskUserTimer"
	TaskTypeTimerActiveTaskWorkflowRunTimeout             = "TimerActiveTaskWorkflowRunTimeout"
	TaskTypeTimerActiveTaskWorkflowExecutionTimeout       = "TimerActiveTaskWorkflowExecutionTimeout"
	TaskTypeTimerActiveTaskActivityRetryTimer             = "TimerActiveTaskActivityRetryTimer"
	TaskTypeTimerActiveTaskWorkflowBackoffTimer           = "TimerActiveTaskWorkflowBackoffTimer"
	TaskTypeTimerActiveTaskDeleteHistoryEvent             = "TimerActiveTaskDeleteHistoryEvent"
	TaskTypeTimerActiveTaskSpeculativeWorkflowTaskTimeout = "TimerActiveTaskSpeculativeWorkflowTaskTimeout"
	TaskTypeTimerActiveTaskChasmPureTask                  = "TimerActiveTaskChasmPureTask"
	TaskTypeTimerActiveTaskTimeSkippingTimer              = "TimerActiveTaskTimeSkippingTimer"
	TaskTypeTimerStandbyTaskActivityTimeout               = "TimerStandbyTaskActivityTimeout"
	TaskTypeTimerStandbyTaskWorkflowTaskTimeout           = "TimerStandbyTaskWorkflowTaskTimeout"
	TaskTypeTimerStandbyTaskUserTimer                     = "TimerStandbyTaskUserTimer"
	TaskTypeTimerStandbyTaskWorkflowRunTimeout            = "TimerStandbyTaskWorkflowRunTimeout"
	TaskTypeTimerStandbyTaskWorkflowExecutionTimeout      = "TimerStandbyTaskWorkflowExecutionTimeout"
	TaskTypeTimerStandbyTaskActivityRetryTimer            = "TimerStandbyTaskActivityRetryTimer"
	TaskTypeTimerStandbyTaskWorkflowBackoffTimer          = "TimerStandbyTaskWorkflowBackoffTimer"
	TaskTypeTimerStandbyTaskDeleteHistoryEvent            = "TimerStandbyTaskDeleteHistoryEvent"
	TaskTypeTimerStandbyTaskChasmPureTask                 = "TimerStandbyTaskChasmPureTask"
	TaskTypeTimerStandbyTaskTimeSkippingTimer             = "TimerStandbyTaskTimeSkippingTimer"
)

History task type

View Source
const (
	ScheduleActionTypeTag                = "schedule_action"
	ScheduleActionStartWorkflow          = "start_workflow"
	ScheduleBackendTag                   = "scheduler_backend"
	ScheduleBackendChasm                 = "chasm"
	ScheduleBackendLegacy                = "legacy"
	ScheduleBackendWorkflow              = "workflow"
	ScheduleOverlapPolicyTag             = "schedule_overlap_policy"
	ScheduleMissedReasonTag              = "reason"
	ScheduleMissedReasonNotBuffered      = "not_buffered"
	ScheduleMissedReasonBufferExpired    = "buffer_expired"
	ScheduleActionRunningTag             = "action_running"
	ScheduleMigrationDirectionTag        = "schedule_migration_direction"
	ScheduleMigrationDirectionToChasm    = "to_chasm"
	ScheduleMigrationDirectionToWorkflow = "to_workflow"
)

Schedule action types

View Source
const (
	DroppedTaskReasonNotFound      = "not_found"
	DroppedTaskReasonInternalError = "internal_error"
	DroppedTaskReasonDataLoss      = "data_loss"
	DroppedTaskReasonExpiredRead   = "expired_read"
	DroppedTaskReasonExpiredMemory = "expired_memory"
	DroppedTaskReasonInvalid       = "invalid"
)

Matching task dropped reason tag values

View Source
const (
	TaskAddResultSyncMatch        = "sync_match"
	TaskAddResultSyncMatchUnavail = "sync_match_unavailable"
	TaskAddResultBacklog          = "backlog"
	TaskAddResultThrottled        = "throttled"
	TaskAddResultFailure          = "failure"
)
View Source
const (
	PollerScaleDecisionUp   = "scale_up"
	PollerScaleDecisionDown = "scale_down"
	PollerScaleDecisionHold = "hold"
)
View Source
const (
	// AdminClientStreamWorkflowReplicationMessagesScope tracks RPC calls to admin service
	AdminClientStreamWorkflowReplicationMessagesScope = "AdminClientStreamWorkflowReplicationMessages"
)

Admin Client Operations

View Source
const (
	// HistoryClientStreamWorkflowReplicationMessagesScope tracks RPC calls to history service
	HistoryClientStreamWorkflowReplicationMessagesScope = "HistoryClientStreamWorkflowReplicationMessages"
)

History Client Operations

View Source
const (
	ScalerShadowModeTagName = "scaler_shadow_mode"
)

Variables

View Source
var (
	ServiceRequests = NewCounterDef(
		"service_requests",
		WithDescription("The number of RPC requests received by the service."),
	)
	ServicePendingRequests = NewGaugeDef("service_pending_requests")
	ServiceFailures        = NewCounterDef(
		"service_errors",
		WithDescription("The number of unexpected service request errors."),
	)
	ServicePanic         = NewCounterDef("service_panics")
	ServiceErrorWithType = NewCounterDef(
		"service_error_with_type",
		WithDescription("The number of all service request errors by error type."),
	)
	ServiceConnAccepted = NewCounterDef(
		"service_grpc_conn_accepted",
		WithDescription("Number of gRPC's TCP connections accepted by the service."),
	)
	ServiceConnClosed = NewCounterDef(
		"service_grpc_conn_closed",
		WithDescription("Number of gRPC's TCP connections closed on the service."),
	)
	ServiceConnActive = NewGaugeDef(
		"service_grpc_conn_active",
		WithDescription("Current number of gRPC's active TCP connections."),
	)
	ServiceDialLatency                       = NewTimerDef("service_dial_latency", WithDescription("The latency of establishing a new TCP connection."))
	ServiceDialSuccessCount                  = NewCounterDef("service_dial_success", WithDescription("Number of TCP dial attempts that successfully established a connection."))
	ServiceDialErrorCount                    = NewCounterDef("service_dial_error", WithDescription("Number of TCP dial attempts that failed to establish a connection."))
	DynamicConfigUpdateFailure               = NewGaugeDef("dynamic_config_update_failure")
	ServiceLatency                           = NewTimerDef("service_latency")
	ServiceLatencyNoUserLatency              = NewTimerDef("service_latency_nouserlatency")
	ServiceLatencyUserLatency                = NewTimerDef("service_latency_userlatency")
	ServiceErrInvalidArgumentCounter         = NewCounterDef("service_errors_invalid_argument")
	ServiceErrNamespaceNotActiveCounter      = NewCounterDef("service_errors_namespace_not_active")
	ServiceErrResourceExhaustedCounter       = NewCounterDef("service_errors_resource_exhausted")
	ServiceErrNotFoundCounter                = NewCounterDef("service_errors_entity_not_found")
	ServiceErrExecutionAlreadyStartedCounter = NewCounterDef("service_errors_execution_already_started")
	ServiceErrContextTimeoutCounter          = NewCounterDef("service_errors_context_timeout")
	ServiceErrRetryTaskCounter               = NewCounterDef("service_errors_retry_task")
	ServiceErrIncompleteHistoryCounter       = NewCounterDef("service_errors_incomplete_history")
	ServiceErrNonDeterministicCounter        = NewCounterDef("service_errors_nondeterministic")
	ServiceErrUnauthorizedCounter            = NewCounterDef("service_errors_unauthorized")
	ServiceErrAuthorizeFailedCounter         = NewCounterDef("service_errors_authorize_failed")
	ActionCounter                            = NewCounterDef("action")
	OperationCounter                         = NewCounterDef("operation")
	TlsCertsExpired                          = NewGaugeDef("certificates_expired")
	TlsCertsExpiring                         = NewGaugeDef("certificates_expiring")
	ServiceAuthorizationLatency              = NewTimerDef("service_authorization_latency")
	NamespaceRateLimitWaitLatency            = NewTimerDef("namespace_rate_limit_poll_wait_latency")
	EventBlobSize                            = NewBytesHistogramDef("event_blob_size")
	BlobSizeError                            = NewCounterDef(
		"blob_size_error",
		WithDescription("The number of requests that failed due to blob size exceeding limits configured with BlobSizeLimitError and MemoSizeLimitError."),
	)
	HeaderSize        = NewBytesHistogramDef("header_size", WithDescription("The size of the header in bytes passed to the server by the client. This metric is experimental and can be removed in the future."))
	LockRequests      = NewCounterDef("lock_requests")
	LockLatency       = NewTimerDef("lock_latency")
	SemaphoreRequests = NewCounterDef("semaphore_requests")
	SemaphoreFailures = NewCounterDef("semaphore_failures")
	SemaphoreLatency  = NewTimerDef("semaphore_latency")
	ClientRequests    = NewCounterDef(
		"client_requests",
		WithDescription("The number of requests sent by the client to an individual service, keyed by `service_role` and `operation`."),
	)
	ClientFailures                   = NewCounterDef("client_errors")
	ClientLatency                    = NewTimerDef("client_latency")
	ClientRedirectionRequests        = NewCounterDef("client_redirection_requests")
	ClientRedirectionFailures        = NewCounterDef("client_redirection_errors")
	ClientRedirectionLatency         = NewTimerDef("client_redirection_latency")
	StateTransitionCount             = NewDimensionlessHistogramDef("state_transition_count")
	HistorySize                      = NewBytesHistogramDef("history_size")
	HistoryCount                     = NewDimensionlessHistogramDef("history_count")
	TasksCompletedPerShardInfoUpdate = NewDimensionlessHistogramDef("tasks_per_shardinfo_update")
	TimeBetweenShardInfoUpdates      = NewTimerDef("time_between_shardinfo_update")
	SearchAttributesSize             = NewBytesHistogramDef("search_attributes_size")
	MemoSize                         = NewBytesHistogramDef("memo_size")
	TooManyPendingChildWorkflows     = NewCounterDef(
		"wf_too_many_pending_child_workflows",
		WithDescription("The number of Workflow Tasks failed because they would cause the limit on the number of pending child workflows to be exceeded. See https://t.mp/limits for more information."),
	)
	TooManyPendingActivities = NewCounterDef(
		"wf_too_many_pending_activities",
		WithDescription("The number of Workflow Tasks failed because they would cause the limit on the number of pending activities to be exceeded. See https://t.mp/limits for more information."),
	)
	TooManyPendingCancelRequests = NewCounterDef(
		"wf_too_many_pending_cancel_requests",
		WithDescription("The number of Workflow Tasks failed because they would cause the limit on the number of pending cancel requests to be exceeded. See https://t.mp/limits for more information."),
	)
	TooManyPendingSignalsToExternalWorkflows = NewCounterDef(
		"wf_too_many_pending_external_workflow_signals",
		WithDescription("The number of Workflow Tasks failed because they would cause the limit on the number of pending signals to external workflows to be exceeded. See https://t.mp/limits for more information."),
	)
	TotalNamespaces = NewGaugeDef("total_namespaces")

	// Frontend
	AddSearchAttributesWorkflowSuccessCount  = NewCounterDef("add_search_attributes_workflow_success")
	AddSearchAttributesWorkflowFailuresCount = NewCounterDef("add_search_attributes_workflow_failure")
	VersionCheckSuccessCount                 = NewCounterDef("version_check_success")
	VersionCheckFailedCount                  = NewCounterDef("version_check_failed")
	VersionCheckRequestFailedCount           = NewCounterDef("version_check_request_failed")
	VersionCheckLatency                      = NewTimerDef("version_check_latency")
	HTTPServiceRequests                      = NewCounterDef(
		"http_service_requests",
		WithDescription("The number of HTTP requests received by the service."),
	)
	NexusRequests = NewCounterDef(
		"nexus_requests",
		WithDescription("The number of Nexus requests received by the service."),
	)
	NexusRequestPreProcessErrors = NewCounterDef(
		"nexus_request_preprocess_errors",
		WithDescription("The number of Nexus requests for which pre-processing failed."),
	)
	NexusRequestErrors = NewCounterDef(
		"nexus_request_errors",
		WithDescription("The number of Nexus requests that resulted in errors."),
	)
	NexusLatency = NewTimerDef(
		"nexus_latency",
		WithDescription("Latency of Nexus requests."),
	)
	NexusCompletionRequests = NewCounterDef(
		"nexus_completion_requests",
		WithDescription("The number of Nexus completion (callback) requests received by the service."),
	)
	NexusCompletionLatencyHistogram = NewTimerDef(
		"nexus_completion_latency",
		WithDescription("Latency histogram of Nexus completion (callback) requests."),
	)
	NexusCompletionRequestPreProcessErrors = NewCounterDef(
		"nexus_completion_request_preprocess_errors",
		WithDescription("The number of Nexus completion requests for which pre-processing failed."),
	)
	WorkerCommandsSent = NewCounterDef(
		"worker_commands_sent",
		WithDescription("The number of worker command dispatches, tagged by outcome (e.g. success, no_poller, rpc_error)."),
	)

	HostRPSLimit          = NewGaugeDef("host_rps_limit")
	NamespaceHostRPSLimit = NewGaugeDef("namespace_host_rps_limit")
	HandoverWaitLatency   = NewTimerDef("handover_wait_latency")

	VisibilityListWorkflowsQueryLength = NewDimensionlessHistogramDef("visibility_list_workflows_query_length")

	// History
	CacheRequests                                = NewCounterDef("cache_requests")
	CacheFailures                                = NewCounterDef("cache_errors")
	CacheLatency                                 = NewTimerDef("cache_latency")
	CacheMissCounter                             = NewCounterDef("cache_miss")
	CacheSize                                    = NewGaugeDef("cache_size")
	CacheUsage                                   = NewGaugeDef("cache_usage")
	CachePinnedUsage                             = NewGaugeDef("cache_pinned_usage")
	CacheTtl                                     = NewTimerDef("cache_ttl")
	CacheEntryAgeOnGet                           = NewTimerDef("cache_entry_age_on_get")
	CacheEntryAgeOnEviction                      = NewTimerDef("cache_entry_age_on_eviction")
	HistoryEventNotificationQueueingLatency      = NewTimerDef("history_event_notification_queueing_latency")
	HistoryEventNotificationFanoutLatency        = NewTimerDef("history_event_notification_fanout_latency")
	HistoryEventNotificationInFlightMessageGauge = NewGaugeDef("history_event_notification_inflight_message_gauge")
	HistoryEventNotificationFailDeliveryCount    = NewCounterDef("history_event_notification_fail_delivery_count")
	HistoryHostHealthGauge                       = NewGaugeDef("host_health")
	// ArchivalTaskInvalidURI is emitted by the archival queue task executor when the history or visibility URI for an
	// archival task is not a valid URI.
	// We may emit this metric several times for a single task if the task is retried.
	ArchivalTaskInvalidURI              = NewCounterDef("archival_task_invalid_uri")
	ArchiverArchiveLatency              = NewTimerDef("archiver_archive_latency")
	ArchiverArchiveTargetLatency        = NewTimerDef("archiver_archive_target_latency")
	ShardContextClosedCounter           = NewCounterDef("shard_closed_count")
	ShardContextCreatedCounter          = NewCounterDef("sharditem_created_count")
	ShardContextRemovedCounter          = NewCounterDef("sharditem_removed_count")
	ShardContextAcquisitionLatency      = NewTimerDef("sharditem_acquisition_latency")
	ShardInfoImmediateQueueLagHistogram = NewDimensionlessHistogramDef(
		"shardinfo_immediate_queue_lag",
		WithDescription("A histogram across history shards for the difference between the smallest taskID of pending history tasks and the last generated history task ID."),
	)
	ShardInfoScheduledQueueLagTimer = NewTimerDef(
		"shardinfo_scheduled_queue_lag",
		WithDescription("A histogram across history shards for the difference between the earliest scheduled time of pending history tasks and current time."),
	)
	SyncShardFromRemoteCounter = NewCounterDef("syncshard_remote_count")
	SyncShardFromRemoteFailure = NewCounterDef("syncshard_remote_failed")
	FinalizerRuns              = NewCounterDef(
		"finalizer_runs",
		WithDescription("The number of finalizer runs."),
	)
	FinalizerRunTimeouts = NewCounterDef(
		"finalizer_run_timeouts",
		WithDescription("The number of finalizer run timeouts."),
	)
	FinalizerItemsCompleted = NewCounterDef(
		"finalizer_items_completed",
		WithDescription("The number of finalizer items that were completed successfully."),
	)
	FinalizerItemsUnfinished = NewCounterDef(
		"finalizer_items_unfinished",
		WithDescription("The number of finalizer items that were aborted before completion."),
	)
	FinalizerLatency = NewTimerDef("finalizer_latency")
	TaskRequests     = NewCounterDef(
		"task_requests",
		WithDescription("The number of history tasks processed."),
	)
	TaskLoadLatency = NewTimerDef(
		"task_latency_load",
		WithDescription("Latency from history task generation to loading into memory (persistence schedule to start latency)."),
	)
	TaskScheduleLatency = NewTimerDef(
		"task_latency_schedule",
		WithDescription("Latency from history task loading to start processing (in-memory schedule to start latency)."),
	)
	TaskProcessingLatency = NewTimerDef(
		"task_latency_processing",
		WithDescription("Latency for processing a history task one time."),
	)
	// TaskPersistenceLatency is used only as a context key for accumulating persistence duration (ContextCounterAdd/Get); not emitted as a metric.
	TaskPersistenceLatency = NewTimerDef(
		"task_persistence_latency",
		WithDescription("Context key for persistence duration; not emitted."),
	)
	TaskProcessingNoPersistenceLatency = NewTimerDef(
		"task_processing_no_persistence_latency",
		WithDescription("Latency for processing a history task one time excluding persistence."),
	)
	TaskLatency = NewTimerDef(
		"task_latency",
		WithDescription("Latency for procsssing and completing a history task. This latency is across all attempts but excludes any latencies related to workflow lock or user qutoa limit."),
	)
	TaskQueueLatency = NewTimerDef(
		"task_latency_queue",
		WithDescription("End-to-end latency for processing and completing a history task, from task generation to completion."),
	)
	TaskAttempt = NewDimensionlessHistogramDef(
		"task_attempt",
		WithDescription("The number of attempts took to complete a history task."),
	)
	TaskFailures = NewCounterDef(
		"task_errors",
		WithDescription("The number of unexpected history task processing errors."),
	)
	TaskTerminalFailures = NewCounterDef(
		"task_terminal_failures",
		WithDescription("The number of times a history task failed with a terminal failure, causing it to be sent to the DLQ."),
	)
	TaskDLQFailures = NewCounterDef(
		"task_dlq_failures",
		WithDescription("The number of times we failed to send a history task to the DLQ."),
	)
	TaskDLQSendLatency = NewTimerDef(
		"task_dlq_latency",
		WithDescription("The amount of time it took to successfully send a task to the DLQ. This only records the"+
			" latency of the final attempt to send the task to the DLQ, not the cumulative latency of all attempts."),
	)
	TaskDiscarded                   = NewCounterDef("task_errors_discarded")
	TaskSkipped                     = NewCounterDef("task_skipped")
	TaskVersionMisMatch             = NewCounterDef("task_errors_version_mismatch")
	TasksDependencyTaskNotCompleted = NewCounterDef("task_dependency_task_not_completed")
	TaskStandbyRetryCounter         = NewCounterDef("task_errors_standby_retry_counter")
	TaskWorkflowBusyCounter         = NewCounterDef(
		"task_errors_workflow_busy",
		WithDescription("The number of history task processing errors caused by failing to acquire workflow lock within the configured timeout (history.cacheNonUserContextLockTimeout)."),
	)
	TaskNotActiveCounter         = NewCounterDef("task_errors_not_active_counter")
	TaskNamespaceHandoverCounter = NewCounterDef("task_errors_namespace_handover")
	TaskInternalErrorCounter     = NewCounterDef("task_errors_internal")
	TaskThrottledCounter         = NewCounterDef(
		"task_errors_throttled",
		WithDescription("The number of history task processing errors caused by resource exhausted errors, excluding workflow busy case."),
	)
	TaskCorruptionCounter = NewCounterDef("task_errors_corruption")
	ChasmPureTaskRequests = NewCounterDef(
		"chasm_pure_task_requests",
		WithDescription("The number of CHASM pure tasks executed."),
	)
	ChasmPureTaskErrors = NewCounterDef(
		"chasm_pure_task_errors",
		WithDescription("The number of errors during CHASM pure task execution."),
	)
	ChasmIncomingSignalWritten = NewCounterDef(
		"chasm_incoming_signal_written",
		WithDescription("The number of signal backlinks written to the CHASM IncomingSignals map."),
	)
	ChasmIncomingSignalDuplicate = NewCounterDef(
		"chasm_incoming_signal_duplicate",
		WithDescription("The number of duplicate signal request IDs detected when writing to the CHASM IncomingSignals map. Non-zero values indicate unexpected signal redelivery."),
	)
	TaskScheduleToStartLatency  = NewTimerDef("task_schedule_to_start_latency")
	TaskBatchCompleteCounter    = NewCounterDef("task_batch_complete_counter")
	TaskReschedulerPendingTasks = NewDimensionlessHistogramDef("task_rescheduler_pending_tasks")
	PendingTasksCounter         = NewDimensionlessHistogramDef(
		"pending_tasks",
		WithDescription("A histogram across history shards for the number of in-memory pending history tasks."),
	)
	TaskSchedulerThrottled       = NewCounterDef("task_scheduler_throttled")
	QueueScheduleLatency         = NewTimerDef("queue_latency_schedule") // latency for scheduling 100 tasks in one task channel
	QueueReaderCountHistogram    = NewDimensionlessHistogramDef("queue_reader_count")
	QueueSliceCountHistogram     = NewDimensionlessHistogramDef("queue_slice_count")
	QueueActionCounter           = NewCounterDef("queue_actions")
	QueuePredicateResolutionLoss = NewCounterDef(
		"queue_predicate_resolution_loss",
		WithDescription("The number of times a queue slice lost predicate resolution by keeping a broad predicate "+
			"or falling back to the universal predicate, causing extra tasks to be reprocessed. Tagged by reason."),
	)
	ActivityE2ELatency = NewTimerDef(
		"activity_end_to_end_latency",
		WithDescription("DEPRECATED: Will be removed in one of the next releases. Duration of an activity attempt. Use activity_start_to_close_latency instead."),
	)
	ActivityStartToCloseLatency = NewTimerDef(
		"activity_start_to_close_latency",
		WithDescription("Duration of a single activity attempt. Doesn't include retries or backoffs."),
	)
	ActivityScheduleToCloseLatency = NewTimerDef(
		"activity_schedule_to_close_latency",
		WithDescription("Duration of activity execution from scheduled time to terminal state. Includes retries and backoffs."),
	)
	ActivitySuccess                                  = NewCounterDef("activity_success", WithDescription("Number of activities that succeeded (doesn't include retries)."))
	ActivityFail                                     = NewCounterDef("activity_fail", WithDescription("Number of activities that failed and won't be retried anymore."))
	ActivityTaskFail                                 = NewCounterDef("activity_task_fail", WithDescription("Number of activity task failures (includes retries)."))
	ActivityCancel                                   = NewCounterDef("activity_cancel", WithDescription("Number of activities that are cancelled."))
	ActivityTerminate                                = NewCounterDef("activity_terminate", WithDescription("Number of activities that are terminated."))
	ActivityTaskTimeout                              = NewCounterDef("activity_task_timeout", WithDescription("Number of activity task timeouts (including retries)."))
	ActivityUpdateOptions                            = NewCounterDef("activity_update_options", WithDescription("Number of activity update options calls."))
	ActivityPause                                    = NewCounterDef("activity_pause", WithDescription("Number of activity pauses."))
	ActivityUnpause                                  = NewCounterDef("activity_unpause", WithDescription("Number of activity unpauses."))
	ActivityReset                                    = NewCounterDef("activity_reset", WithDescription("Number of activity resets."))
	ActivityTimeout                                  = NewCounterDef("activity_timeout", WithDescription("Number of terminal activity timeouts."))
	ActivityPayloadSize                              = NewCounterDef("activity_payload_size", WithDescription("Size of activity payloads in bytes."))
	ActivityHeartbeatCount                           = NewCounterDef("activity_heartbeat_count", WithDescription("Count of activity heartbeats, with has_details tag indicating whether the heartbeat carried a payload."))
	AckLevelUpdateCounter                            = NewCounterDef("ack_level_update")
	AckLevelUpdateFailedCounter                      = NewCounterDef("ack_level_update_failed")
	CommandCounter                                   = NewCounterDef("command")
	MessageTypeRequestWorkflowExecutionUpdateCounter = NewCounterDef("request_workflow_update_message")
	MessageTypeAcceptWorkflowExecutionUpdateCounter  = NewCounterDef("accept_workflow_update_message")
	MessageTypeRespondWorkflowExecutionUpdateCounter = NewCounterDef("respond_workflow_update_message")
	MessageTypeRejectWorkflowExecutionUpdateCounter  = NewCounterDef("reject_workflow_update_message")
	WorkflowExecutionUpdateRegistrySize              = NewBytesHistogramDef("workflow_update_registry_size")
	WorkflowExecutionUpdateRegistrySizeLimited       = NewCounterDef("workflow_update_registry_size_limited")
	WorkflowExecutionUpdateRequestRateLimited        = NewCounterDef("workflow_update_request_rate_limited")
	BusinessIDReuseRateLimited                       = NewCounterDef("business_id_reuse_rate_limited")
	WorkflowExecutionUpdateTooMany                   = NewCounterDef("workflow_update_request_too_many")
	WorkflowExecutionUpdateAborted                   = NewCounterDef("workflow_update_aborted")
	WorkflowExecutionUpdateSentToWorker              = NewCounterDef("workflow_update_sent_to_worker")
	WorkflowExecutionUpdateSentToWorkerAgain         = NewCounterDef("workflow_update_sent_to_worker_again")
	WorkflowExecutionUpdateWaitStageAccepted         = NewCounterDef("workflow_update_wait_stage_accepted")
	WorkflowExecutionUpdateWaitStageCompleted        = NewCounterDef("workflow_update_wait_stage_completed")
	WorkflowExecutionUpdateClientTimeout             = NewCounterDef("workflow_update_client_timeout")
	WorkflowExecutionUpdateServerTimeout             = NewCounterDef("workflow_update_server_timeout")
	SpeculativeWorkflowTaskCommits                   = NewCounterDef("speculative_workflow_task_commits")
	SpeculativeWorkflowTaskRollbacks                 = NewCounterDef("speculative_workflow_task_rollbacks")

	ActivityEagerExecutionCounter = NewCounterDef("activity_eager_execution")
	// WorkflowEagerExecutionCounter is emitted any time eager workflow start is requested.
	WorkflowEagerExecutionCounter = NewCounterDef("workflow_eager_execution")
	// WorkflowEagerExecutionDeniedCounter is emitted any time eager workflow start is requested and the serer fell back
	// to standard dispatch.
	// Timeouts and failures are not counted in this metric.
	// This metric has a "reason" tag attached to it to understand why eager start was denied.
	WorkflowEagerExecutionDeniedCounter           = NewCounterDef("workflow_eager_execution_denied")
	StartWorkflowRequestDeduped                   = NewCounterDef("start_workflow_request_deduped")
	EmptyCompletionCommandsCounter                = NewCounterDef("empty_completion_commands")
	MultipleCompletionCommandsCounter             = NewCounterDef("multiple_completion_commands")
	FailedWorkflowTasksCounter                    = NewCounterDef("failed_workflow_tasks")
	WorkflowTaskAttempt                           = NewDimensionlessHistogramDef("workflow_task_attempt")
	StaleMutableStateCounter                      = NewCounterDef("stale_mutable_state")
	PaginationTokenBranchMismatchCounter          = NewCounterDef("pagination_token_branch_mismatch")
	AutoResetPointsLimitExceededCounter           = NewCounterDef("auto_reset_points_exceed_limit")
	AutoResetPointCorruptionCounter               = NewCounterDef("auto_reset_point_corruption")
	BatchableTaskBatchCount                       = NewGaugeDef("batchable_task_batch_count")
	ConcurrencyUpdateFailureCounter               = NewCounterDef("concurrency_update_failure")
	ServiceErrShardOwnershipLostCounter           = NewCounterDef("service_errors_shard_ownership_lost")
	HeartbeatTimeoutCounter                       = NewCounterDef("heartbeat_timeout")
	ScheduleToStartTimeoutCounter                 = NewCounterDef("schedule_to_start_timeout")
	StartToCloseTimeoutCounter                    = NewCounterDef("start_to_close_timeout")
	ScheduleToCloseTimeoutCounter                 = NewCounterDef("schedule_to_close_timeout")
	NewTimerNotifyCounter                         = NewCounterDef("new_timer_notifications")
	StateMachineTimerProcessingFailuresCounter    = NewCounterDef("state_machine_timer_processing_failures")
	StateMachineTimerSkipsCounter                 = NewCounterDef("state_machine_timer_skips")
	AcquireShardsCounter                          = NewCounterDef("acquire_shards_count")
	AcquireShardsLatency                          = NewTimerDef("acquire_shards_latency")
	MembershipChangedCounter                      = NewCounterDef("membership_changed_count")
	NumShardsGauge                                = NewGaugeDef("numshards_gauge")
	GetEngineForShardErrorCounter                 = NewCounterDef("get_engine_for_shard_errors")
	GetEngineForShardLatency                      = NewTimerDef("get_engine_for_shard_latency")
	RemoveEngineForShardLatency                   = NewTimerDef("remove_engine_for_shard_latency")
	CompleteWorkflowTaskWithStickyEnabledCounter  = NewCounterDef("complete_workflow_task_sticky_enabled_count")
	CompleteWorkflowTaskWithStickyDisabledCounter = NewCounterDef("complete_workflow_task_sticky_disabled_count")
	WorkflowTaskHeartbeatTimeoutCounter           = NewCounterDef("workflow_task_heartbeat_timeout_count")
	SignalWithStartSkipDelayCounter               = NewCounterDef("signal_with_start_skip_delay_count")
	DuplicateReplicationEventsCounter             = NewCounterDef("duplicate_replication_events")
	AcquireLockFailedCounter                      = NewCounterDef("acquire_lock_failed")
	WorkflowContextCleared                        = NewCounterDef("workflow_context_cleared")
	MutableStateSize                              = NewBytesHistogramDef(
		"mutable_state_size",
		WithDescription("The size of an individual Workflow Execution's state, emitted each time a workflow execution is retrieved or updated."),
	)
	PersistedMutableStateSize = NewBytesHistogramDef(
		"persisted_mutable_state_size",
		WithDescription("Size of the persisted Workflow Execution's state in DB, emitted each time a workflow execution is updated."),
	)
	ExecutionInfoSize                    = NewBytesHistogramDef("execution_info_size")
	ExecutionStateSize                   = NewBytesHistogramDef("execution_state_size")
	ActivityInfoSize                     = NewBytesHistogramDef("activity_info_size")
	TimerInfoSize                        = NewBytesHistogramDef("timer_info_size")
	ChildInfoSize                        = NewBytesHistogramDef("child_info_size")
	RequestCancelInfoSize                = NewBytesHistogramDef("request_cancel_info_size")
	SignalInfoSize                       = NewBytesHistogramDef("signal_info_size")
	SignalRequestIDSize                  = NewBytesHistogramDef("signal_request_id_size")
	BufferedEventsSize                   = NewBytesHistogramDef("buffered_events_size")
	ChasmTotalSize                       = NewBytesHistogramDef("chasm_total_size")
	ActivityInfoCount                    = NewDimensionlessHistogramDef("activity_info_count")
	TimerInfoCount                       = NewDimensionlessHistogramDef("timer_info_count")
	ChildInfoCount                       = NewDimensionlessHistogramDef("child_info_count")
	SignalInfoCount                      = NewDimensionlessHistogramDef("signal_info_count")
	RequestCancelInfoCount               = NewDimensionlessHistogramDef("request_cancel_info_count")
	SignalRequestIDCount                 = NewDimensionlessHistogramDef("signal_request_id_count")
	BufferedEventsCount                  = NewDimensionlessHistogramDef("buffered_events_count")
	TaskCount                            = NewDimensionlessHistogramDef("task_count")
	TotalActivityCount                   = NewDimensionlessHistogramDef("total_activity_count")
	TotalUserTimerCount                  = NewDimensionlessHistogramDef("total_user_timer_count")
	TotalChildExecutionCount             = NewDimensionlessHistogramDef("total_child_execution_count")
	TotalRequestCancelExternalCount      = NewDimensionlessHistogramDef("total_request_cancel_external_count")
	TotalSignalExternalCount             = NewDimensionlessHistogramDef("total_signal_external_count")
	TotalSignalCount                     = NewDimensionlessHistogramDef("total_signal_count")
	DescribeWorkflowSignalBacklinksCount = NewCounterDef(
		"describe_workflow_signal_backlinks",
		WithDescription("The number of signal backlinks resolved from the CHASM IncomingSignals map in DescribeWorkflow responses."),
	)
	WorkflowBackoffCount                  = NewCounterDef("workflow_backoff_timer")
	WorkflowRetryBackoffTimerCount        = NewCounterDef("workflow_retry_backoff_timer")
	WorkflowCronBackoffTimerCount         = NewCounterDef("workflow_cron_backoff_timer")
	WorkflowDelayedStartBackoffTimerCount = NewCounterDef("workflow_delayed_start_backoff_timer")
	WorkflowCleanupDeleteCount            = NewCounterDef("workflow_cleanup_delete")
	WorkflowSuccessCount                  = NewCounterDef("workflow_success")
	WorkflowCancelCount                   = NewCounterDef("workflow_cancel")
	WorkflowFailedCount                   = NewCounterDef("workflow_failed")
	WorkflowTimeoutCount                  = NewCounterDef("workflow_timeout")
	WorkflowTerminateCount                = NewCounterDef("workflow_terminate")
	WorkflowContinuedAsNewCount           = NewCounterDef("workflow_continued_as_new")
	WorkflowScheduleToCloseLatency        = NewTimerDef("workflow_schedule_to_close_latency")
	ReplicationStreamPanic                = NewCounterDef("replication_stream_panic")
	ReplicationStreamError                = NewCounterDef("replication_stream_error")
	ReplicationServiceError               = NewCounterDef("replication_service_error")
	ReplicationStreamStuck                = NewCounterDef("replication_stream_stuck")
	ReplicationStreamChannelFull          = NewCounterDef("replication_stream_channel_full")
	ReplicationTasksSend                  = NewCounterDef("replication_tasks_send")
	// ReplicationStreamReadBufferHits counts replication queue read pages served from the
	// shard's read-through buffer; ReplicationStreamReadBufferMisses counts pages that fell
	// through to persistence while the buffer was enabled. With N streams/lanes scanning the
	// same tip, the ideal shape is one miss (the fetch that fills the buffer) per N-1 hits.
	ReplicationStreamReadBufferHits   = NewCounterDef("replication_stream_read_buffer_hits")
	ReplicationStreamReadBufferMisses = NewCounterDef("replication_stream_read_buffer_misses")
	// ReplicationStreamReadBufferMissLag records, for misses that start below the buffered
	// range, how far below coverage the read began (in task ids). Small values mean a larger
	// buffer would convert these misses to hits; large values mean the reader is deep in
	// backlog, where no tip buffer helps and reads are paced by the reader itself.
	ReplicationStreamReadBufferMissLag = NewDimensionlessHistogramDef("replication_stream_read_buffer_miss_lag")
	ReplicationTaskSendAttempt         = NewDimensionlessHistogramDef("replication_task_send_attempt")
	ReplicationTaskSendError           = NewCounterDef("replication_task_send_error")
	ReplicationTaskGenerationLatency   = NewTimerDef("replication_task_generation_latency")
	ReplicationTaskLoadLatency         = NewTimerDef("replication_task_load_latency")
	ReplicationTaskLoadSize            = NewDimensionlessHistogramDef("replication_task_load_size")
	ReplicationTaskSendLatency         = NewTimerDef("replication_task_send_latency")
	ReplicationTaskSendBacklog         = NewDimensionlessHistogramDef("replication_task_send_backlog")
	ReplicationTasksRecv               = NewCounterDef("replication_tasks_recv")
	ReplicationTasksRecvBacklog        = NewDimensionlessHistogramDef("replication_tasks_recv_backlog")
	ReplicationTasksSkipped            = NewCounterDef("replication_tasks_skipped")
	ReplicationTasksApplied            = NewCounterDef("replication_tasks_applied")
	ReplicationTasksFailed             = NewCounterDef("replication_tasks_failed")
	ReplicationTasksBackFill           = NewCounterDef("replication_tasks_back_fill")
	ReplicationTasksBackFillLatency    = NewTimerDef("replication_tasks_back_fill_latency")
	// ReplicationOrphanedHistoryBranch tracks cases where history branch cleanup was skipped on error
	// to avoid deleting successfully written history. These orphaned branches will be cleaned up by GC.
	ReplicationOrphanedHistoryBranch = NewCounterDef("replication_orphaned_history_branch")
	// ReplicationBackfillEventsLatency measures the latency of bringing local events up to the
	// source cluster's current branch (backfilling history events) during workflow state replication.
	ReplicationBackfillEventsLatency = NewTimerDef("replication_backfill_events_latency")
	// ReplicationTasksLag is a heuristic for how far behind the remote DC is for a given cluster. It measures the
	// difference between task IDs so its unit should be "tasks".
	ReplicationTasksLag                             = NewDimensionlessHistogramDef("replication_tasks_lag")
	ReplicationDeleteExecutionTaskGenerationFailure = NewCounterDef("replication_delete_execution_task_generation_failure")
	// ReplicationTasksFetched records the number of tasks fetched by the poller.
	ReplicationTasksFetched                        = NewDimensionlessHistogramDef("replication_tasks_fetched")
	ReplicationLatency                             = NewTimerDef("replication_latency")
	ReplicationTaskQueueLatency                    = NewTimerDef("replication_task_queue_latency")
	ReplicationTaskProcessingLatency               = NewTimerDef("replication_task_processing_latency")
	ReplicationTaskTransmissionLatency             = NewTimerDef("replication_task_transmission_latency")
	ReplicationTasksAttempt                        = NewDimensionlessHistogramDef("replication_tasks_attempt")
	ReplicationTasksErrorByType                    = NewCounterDef("replication_tasks_error_by_type")
	ReplicationDLQFailed                           = NewCounterDef("replication_dlq_enqueue_failed")
	ReplicationDLQMaxLevelGauge                    = NewGaugeDef("replication_dlq_max_level")
	ReplicationDLQAckLevelGauge                    = NewGaugeDef("replication_dlq_ack_level")
	ReplicationNonEmptyDLQCount                    = NewCounterDef("replication_dlq_non_empty")
	ReplicationOutlierNamespace                    = NewCounterDef("replication_outlier_namespace")
	ReplicationDuplicatedTaskCount                 = NewCounterDef("replication_duplicated_task")
	ReplicationRateLimitLatency                    = NewTimerDef("replication_sender_rate_limit_latency")
	EventReapplySkippedCount                       = NewCounterDef("event_reapply_skipped_count")
	DirectQueryDispatchLatency                     = NewTimerDef("direct_query_dispatch_latency")
	DirectQueryDispatchStickyLatency               = NewTimerDef("direct_query_dispatch_sticky_latency")
	DirectQueryDispatchNonStickyLatency            = NewTimerDef("direct_query_dispatch_non_sticky_latency")
	DirectQueryDispatchStickySuccessCount          = NewCounterDef("direct_query_dispatch_sticky_success")
	DirectQueryDispatchNonStickySuccessCount       = NewCounterDef("direct_query_dispatch_non_sticky_success")
	DirectQueryDispatchClearStickinessLatency      = NewTimerDef("direct_query_dispatch_clear_stickiness_latency")
	DirectQueryDispatchClearStickinessSuccessCount = NewCounterDef("direct_query_dispatch_clear_stickiness_success")
	DirectQueryDispatchTimeoutBeforeNonStickyCount = NewCounterDef("direct_query_dispatch_timeout_before_non_sticky")
	WorkflowTaskQueryLatency                       = NewTimerDef("workflow_task_query_latency")
	ConsistentQueryTimeoutCount                    = NewCounterDef("consistent_query_timeout")
	QueryBufferExceededCount                       = NewCounterDef("query_buffer_exceeded")
	QueryRegistryInvalidStateCount                 = NewCounterDef("query_registry_invalid_state")
	WorkflowTaskTimeoutOverrideCount               = NewCounterDef("workflow_task_timeout_overrides")
	WorkflowRunTimeoutOverrideCount                = NewCounterDef("workflow_run_timeout_overrides")
	ReplicationTaskCleanupCount                    = NewCounterDef("replication_task_cleanup_count")
	ReplicationTaskCleanupFailure                  = NewCounterDef("replication_task_cleanup_failed")
	MutableStateDirty                              = NewCounterDef("mutable_state_dirty")
	MutableStateChecksumMismatch                   = NewCounterDef("mutable_state_checksum_mismatch")
	MutableStateChecksumInvalidated                = NewCounterDef("mutable_state_checksum_invalidated")
	ClosedWorkflowBufferEventCount                 = NewCounterDef("closed_workflow_buffer_event_counter")
	OutOfOrderBufferedEventsCounter                = NewCounterDef("out_of_order_buffered_events")
	ShardLingerSuccess                             = NewTimerDef("shard_linger_success")
	ShardLingerTimeouts                            = NewCounterDef("shard_linger_timeouts")
	DynamicRateLimiterMultiplier                   = NewGaugeDef("dynamic_rate_limit_multiplier")
	DLQWrites                                      = NewCounterDef(
		"dlq_writes",
		WithDescription("The number of times a message is enqueued to DLQ. DLQ can be inspected using tdbg dlq command."),
	)
	DLQMessageCount = NewGaugeDef(
		"dlq_message_count",
		WithDescription("The number of messages currently in DLQ."),
	)
	DataLossCounter = NewCounterDef(
		"data_loss_errors",
		WithDescription("Total number of data loss errors encountered. This is a high cardinality metrics that has namespace, workflowID and runID tags."+
			"It is only emitted when system.enableDataLossMetrics is enabled. Only enable this if metrics system can handle it's cardinality"),
	)
	ReadNamespaceErrors                     = NewCounterDef("read_namespace_errors")
	RateLimitedTaskRunnableWaitTime         = NewTimerDef("rate_limited_task_runnable_wait_time")
	CircuitBreakerExecutableBlocked         = NewCounterDef("circuit_breaker_executable_blocked")
	DynamicWorkerPoolSchedulerBufferSize    = NewGaugeDef("dynamic_worker_pool_scheduler_buffer_size")
	DynamicWorkerPoolSchedulerActiveWorkers = NewGaugeDef("dynamic_worker_pool_scheduler_active_workers")
	DynamicWorkerPoolSchedulerEnqueuedTasks = NewCounterDef("dynamic_worker_pool_scheduler_enqueued_tasks")
	DynamicWorkerPoolSchedulerDequeuedTasks = NewCounterDef("dynamic_worker_pool_scheduler_dequeued_tasks")
	DynamicWorkerPoolSchedulerRejectedTasks = NewCounterDef("dynamic_worker_pool_scheduler_rejected_tasks")

	// ExecutionQueueScheduler metrics
	ExecutionQueueSchedulerQueueCount     = NewGaugeDef("execution_queue_scheduler_queue_count")
	ExecutionQueueSchedulerTasksSubmitted = NewCounterDef("execution_queue_scheduler_tasks_submitted")
	ExecutionQueueSchedulerTasksCompleted = NewCounterDef("execution_queue_scheduler_tasks_completed")
	ExecutionQueueSchedulerTasksFailed    = NewCounterDef("execution_queue_scheduler_tasks_failed")
	ExecutionQueueSchedulerSubmitRejected = NewCounterDef("execution_queue_scheduler_submit_rejected")
	ExecutionQueueSchedulerTaskLatency    = NewTimerDef("execution_queue_scheduler_task_latency")
	ExecutionQueueSchedulerQueueWaitTime  = NewTimerDef("execution_queue_scheduler_queue_wait_time")

	PausedActivitiesCounter   = NewCounterDef("paused_activities")
	ExternalPayloadUploadSize = NewBytesHistogramDef("external_payload_upload_size", WithDescription("The histogram of sizes in bytes of uploaded external payloads."))

	// Deadlock detector metrics
	DDSuspectedDeadlocks                 = NewCounterDef("dd_suspected_deadlocks")
	DDCurrentSuspectedDeadlocks          = NewGaugeDef("dd_current_suspected_deadlocks")
	DDClusterMetadataLockLatency         = NewTimerDef("dd_cluster_metadata_lock_latency")
	DDClusterMetadataCallbackLockLatency = NewTimerDef("dd_cluster_metadata_callback_lock_latency")
	DDShardControllerLockLatency         = NewTimerDef("dd_shard_controller_lock_latency")
	DDShardLockLatency                   = NewTimerDef("dd_shard_lock_latency")
	DDShardIOSemaphoreLatency            = NewTimerDef("dd_shard_io_semaphore_latency")
	DDNamespaceRegistryLockLatency       = NewTimerDef("dd_namespace_registry_lock_latency")

	// Namespace registry watch metrics
	NamespaceRegistryWatchReconnections = NewCounterDef("namespace_registry_watch_reconnections")
	NamespaceRegistryWatchStartFailures = NewCounterDef("namespace_registry_watch_start_failures")
	NamespaceRegistrySlowCallbacks      = NewCounterDef("namespace_registry_slow_callbacks")
	NamespaceRegistryRefreshFailures    = NewCounterDef("namespace_registry_refresh_failures")
	NamespaceRegistryRefreshLatency     = NewTimerDef("namespace_registry_refresh_latency")

	ExecutionTimeSkippingTransitionedCounter      = NewCounterDef("execution_time_skipping_transitioned_count")
	ExecutionTimeSkippingTransitionedErrorCounter = NewCounterDef("execution_time_skipping_transitioned_error_count")

	// Pagination of RespondWorkflowTaskCompleted requests
	WorkflowTaskCompletionPaginatedBytes = NewBytesHistogramDef(
		"workflow_task_completion_paginated_bytes",
		WithDescription("Total wire size of successfully completed paginated RespondWorkflowTaskCompleted requests. count givens the total number of successful paginated requests."),
	)
	WorkflowTaskCompletionBufferInflightBytes = NewGaugeDef(
		"workflow_task_completion_buffer_inflight_bytes",
		WithDescription("Process-wide total bytes currently held across all in-flight workflow task completion pagination buffers."),
	)
	WorkflowTaskCompletionBufferLost = NewCounterDef(
		"workflow_task_completion_buffer_lost",
		WithDescription("Paginated workflow task completions aborted because the buffer was lost (evicted, process limit exceeded, or a page was missing)."),
	)

	// Matching
	MatchingClientForwardedCounter            = NewCounterDef("forwarded")
	MatchingClientInvalidTaskQueueName        = NewCounterDef("invalid_task_queue_name")
	MatchingClientInvalidTaskQueuePartition   = NewCounterDef("invalid_task_queue_partition")
	SyncMatchLatencyPerTaskQueue              = NewTimerDef("syncmatch_latency")
	AsyncMatchLatencyPerTaskQueue             = NewTimerDef("asyncmatch_latency")
	PollSuccessPerTaskQueueCounter            = NewCounterDef("poll_success")
	PollTimeoutPerTaskQueueCounter            = NewCounterDef("poll_timeouts")
	PollSuccessWithSyncPerTaskQueueCounter    = NewCounterDef("poll_success_sync")
	PollLatencyPerTaskQueue                   = NewTimerDef("poll_latency")
	LeaseRequestPerTaskQueueCounter           = NewCounterDef("lease_requests")
	LeaseFailurePerTaskQueueCounter           = NewCounterDef("lease_failures")
	ConditionFailedErrorPerTaskQueueCounter   = NewCounterDef("condition_failed_errors")
	RespondQueryTaskFailedPerTaskQueueCounter = NewCounterDef("respond_query_failed")
	RespondNexusTaskFailedPerTaskQueueCounter = NewCounterDef("respond_nexus_failed")
	NexusTaskRequests                         = NewCounterDef(
		"nexus_task_requests",
		WithDescription("The number of Nexus task poll and respond requests received by the matching service, broken down by namespace, operation, client_name, and is_internal."),
	)
	SyncThrottlePerTaskQueueCounter                   = NewCounterDef("sync_throttle_count")
	BufferThrottlePerTaskQueueCounter                 = NewCounterDef("buffer_throttle_count")
	ForwardedPerTaskQueueCounter                      = NewCounterDef("forwarded_per_tl")
	PriorityBacklogForwardedPerTaskQueueCounter       = NewCounterDef("priority_backlog_forwarded")
	ForwardTaskErrorsPerTaskQueue                     = NewCounterDef("forward_task_errors")
	LocalToLocalMatchPerTaskQueueCounter              = NewCounterDef("local_to_local_matches")
	LocalToRemoteMatchPerTaskQueueCounter             = NewCounterDef("local_to_remote_matches")
	RemoteToLocalMatchPerTaskQueueCounter             = NewCounterDef("remote_to_local_matches")
	RemoteToRemoteMatchPerTaskQueueCounter            = NewCounterDef("remote_to_remote_matches")
	LoadedTaskQueueFamilyGauge                        = NewGaugeDef("loaded_task_queue_family_count")
	LoadedTaskQueueGauge                              = NewGaugeDef("loaded_task_queue_count")
	LoadedTaskQueuePartitionGauge                     = NewGaugeDef("loaded_task_queue_partition_count")
	ForceLoadedTaskQueuePartitions                    = NewCounterDef("force_loaded_task_queue_partitions_count")
	ForceLoadedTaskQueuePartitionUnnecessarilyCounter = NewCounterDef("force_loaded_task_queue_partition_unnecessarily_count")
	LoadedPhysicalTaskQueueGauge                      = NewGaugeDef("loaded_physical_task_queue_count")
	PendingPolls                                      = NewGaugeDef("pending_polls")
	TaskQueueStartedCounter                           = NewCounterDef("task_queue_started")
	TaskQueueStoppedCounter                           = NewCounterDef("task_queue_stopped")
	TasksAddedCounter                                 = NewCounterDef(
		"tasks_added",
		WithDescription("Number of tasks arriving at a physical task queue, broken down by add result, forwarding, and versioning behavior"),
	)
	TaskWriteThrottlePerTaskQueueCounter = NewCounterDef("task_write_throttle_count")
	TaskWriteLatencyPerTaskQueue         = NewTimerDef("task_write_latency")
	TaskRewrites                         = NewCounterDef(
		"task_rewrites",
		WithDescription("Number of times tasks are rewritten to persistence after failing to process"),
	)
	TaskLagPerTaskQueueGauge               = NewGaugeDef("task_lag_per_tl")
	NoRecentPollerTasksPerTaskQueueCounter = NewCounterDef("no_poller_tasks")
	UnknownBuildPollsCounter               = NewCounterDef("unknown_build_polls")
	UnknownBuildTasksCounter               = NewCounterDef("unknown_build_tasks")
	TaskDispatchLatencyPerTaskQueue        = NewTimerDef("task_dispatch_latency")
	ApproximateBacklogCount                = NewGaugeDef("approximate_backlog_count")
	ApproximateBacklogAgeSeconds           = NewGaugeDef("approximate_backlog_age_seconds")
	PhysicalApproximateBacklogCount        = NewGaugeDef("physical_approximate_backlog_count")
	PhysicalApproximateBacklogAgeSeconds   = NewGaugeDef("physical_approximate_backlog_age_seconds")
	NonRetryableTasks                      = NewCounterDef(
		"non_retryable_tasks",
		WithDescription("The number of non-retryable matching tasks which are dropped due to specific errors"),
	)
	DroppedTasksCounter = NewCounterDef(
		"tasks_dropped",
		WithDescription("Backlog/spooled tasks dropped by matching (e.g. a Record(Workflow|Activity)TaskStarted call to history failed, the task expired, or it failed validation). Sync-match tasks are excluded. Per-task-queue, tagged with `reason` identifying the failure mode."),
	)
	TaskCompletedMissing = NewCounterDef(
		"task_completed_dropped",
		WithDescription("Count of tasks that were completed after being dropped from the matcher"),
	)
	TaskRetryTransient = NewCounterDef(
		"task_retry_transient",
		WithDescription("Count of tasks that hit a transient error during match or forward and are retried immediately"),
	)
	FairReaderStuckDetected = NewCounterDef(
		"fair_reader_stuck_detected",
		WithDescription("Count of times the fair task reader detected a stuck state (atEnd=false, loadedTasks=0, readPending=false, backoffTimer=nil) on the write path"),
	)
	PartitionScaleEvents = NewCounterDef("partition_scale_events")
	PartitionScaleRead   = NewGaugeDef("partition_scale_read")
	PartitionScaleWrite  = NewGaugeDef("partition_scale_write")
	PartitionScaleTarget = NewGaugeDef("partition_scale_target")

	// ----------------------------------------------------------------------------------------------------------------
	// Matching service: Metrics to track the health of worker registry.
	WorkerRegistryEvictionBlockedByAgeMetric = NewGaugeDef(
		"worker_registry_eviction_blocked_by_age",
		WithDescription(
			"Set if entries could not be evicted due to minEvictAge policy in a given eviction iteration. "+
				"Reset once a subsequent eviction succeeds.",
		),
	)
	WorkerRegistryCapacityUtilizationMetric = NewGaugeDef(
		"worker_registry_capacity_utilization",
		WithDescription("Tracks the ratio of total entries to maxItems."),
	)
	WorkerRegistryWorkersAdded = NewCounterDef(
		"worker_registry_workers_added",
		WithDescription("Count of new workers registered in the worker registry."),
	)
	WorkerRegistryWorkersRemoved = NewCounterDef(
		"worker_registry_workers_removed",
		WithDescription("Count of workers removed from the worker registry."),
	)
	WorkerRegistryActivitySlotsUsed = NewDimensionlessHistogramDef(
		"worker_registry_activity_slots_used",
		WithDescription("Number of activity slots in use per worker."),
	)
	WorkerRegistryWorkerCount = NewGaugeDef(
		"worker_registry_worker_count",
		WithDescription("Number of workers per namespace."),
	)
	WorkerRegistryWorkersPerProcess = NewDimensionlessHistogramDef(
		"worker_registry_workers_per_process",
		WithDescription("Number of workers per SDK process."),
	)
	// ----------------------------------------------------------------------------------------------------------------
	// Matching service: Metrics to understand plugin adoption.
	WorkerPluginNameMetric = NewGaugeDef(
		"worker_plugin_name",
		WithDescription(
			"Set if the worker was configured with a plugin. Dimensions: namespace, plugin_name"),
	)

	// ----------------------------------------------------------------------------------------------------------------
	// Matching service: Metrics to understand storage driver adoption.
	WorkerStorageDriverTypeMetric = NewGaugeDef(
		"worker_storage_driver_type",
		WithDescription(
			"Set if the worker was configured with a storage driver. Dimensions: namespace, storage_driver_type."),
	)
	// ----------------------------------------------------------------------------------------------------------------
	// Matching service: Metrics to understand poller autoscaling adoption.
	PollerAutoscalingHeartbeatCount = NewCounterDef(
		"poller_autoscaling_heartbeat_count",
		WithDescription(
			"Count of worker heartbeats with poller autoscaling enabled. Dimensions: namespace, taskqueue, task_type"),
	)
	PollerScaleDecisionCounter = NewCounterDef(
		"poller_scale_decision",
		WithDescription(
			"Count of poller scaling decisions made by a physical task queue manager. Emitted only when the opt-in "+
				"dynamic config matching.enablePollerScalingDecisionMetrics is enabled. Dimensions: namespace, taskqueue, "+
				"task_type, partition, decision (scale_up/scale_down/hold), reason (idle/backlog/task_rate/rate_limited)"),
	)

	PartitionCacheSize = NewGaugeDef(
		"partition_cache_size",
		WithDescription("Size of client-size matching partition cache (# entries)"),
	)

	// Versioning and Reachability
	ReachabilityExitPointCounter = NewCounterDef("reachability_exit_point_count")

	// Worker
	ExecutorTasksDoneCount                        = NewCounterDef("executor_done")
	ExecutorTasksErrCount                         = NewCounterDef("executor_err")
	ExecutorTasksDeferredCount                    = NewCounterDef("executor_deferred")
	ExecutorTasksDroppedCount                     = NewCounterDef("executor_dropped")
	StartedCount                                  = NewCounterDef("started")
	StoppedCount                                  = NewCounterDef("stopped")
	TaskProcessedCount                            = NewGaugeDef("task_processed")
	TaskDeletedCount                              = NewGaugeDef("task_deleted")
	TaskQueueProcessedCount                       = NewGaugeDef("taskqueue_processed")
	TaskQueueDeletedCount                         = NewGaugeDef("taskqueue_deleted")
	TaskQueueOutstandingCount                     = NewGaugeDef("taskqueue_outstanding")
	HistoryArchiverArchiveNonRetryableErrorCount  = NewCounterDef("history_archiver_archive_non_retryable_error")
	HistoryArchiverArchiveTransientErrorCount     = NewCounterDef("history_archiver_archive_transient_error")
	HistoryArchiverArchiveSuccessCount            = NewCounterDef("history_archiver_archive_success")
	HistoryArchiverTotalUploadSize                = NewBytesHistogramDef("history_archiver_total_upload_size")
	HistoryArchiverHistorySize                    = NewBytesHistogramDef("history_archiver_history_size")
	HistoryArchiverDuplicateArchivalsCount        = NewCounterDef("history_archiver_duplicate_archivals")
	HistoryArchiverBlobExistsCount                = NewCounterDef("history_archiver_blob_exists")
	HistoryArchiverBlobSize                       = NewBytesHistogramDef("history_archiver_blob_size")
	HistoryWorkflowExecutionCacheLatency          = NewTimerDef("history_workflow_execution_cache_latency")
	HistoryWorkflowExecutionCacheLockHoldDuration = NewTimerDef("history_workflow_execution_cache_lock_hold_duration")

	VisibilityArchiverArchiveNonRetryableErrorCount           = NewCounterDef("visibility_archiver_archive_non_retryable_error")
	VisibilityArchiverArchiveTransientErrorCount              = NewCounterDef("visibility_archiver_archive_transient_error")
	VisibilityArchiveSuccessCount                             = NewCounterDef("visibility_archiver_archive_success")
	HistoryScavengerSuccessCount                              = NewCounterDef("scavenger_success")
	HistoryScavengerErrorCount                                = NewCounterDef("scavenger_errors")
	HistoryScavengerSkipCount                                 = NewCounterDef("scavenger_skips")
	ScheduleInvariantsScannerOverdueNextActionTimeCount       = NewCounterDef("schedule_invariants_scanner_overdue_next_action_time")
	ScheduleInvariantsScannerOverdueNextActionTimeCapHitCount = NewCounterDef("schedule_invariants_scanner_overdue_next_action_time_cap_hit")
	ScheduleInvariantsScannerStuckOpenCount                   = NewCounterDef("schedule_invariants_scanner_stuck_open")
	ScheduleInvariantsScannerUnknownStateCount                = NewCounterDef("schedule_invariants_scanner_unknown_state")
	ScheduleInvariantsScannerErrorCount                       = NewCounterDef("schedule_invariants_scanner_errors")
	ExecutionsOutstandingCount                                = NewGaugeDef("executions_outstanding")
	ScavengerValidationRequestsCount                          = NewCounterDef("scavenger_validation_requests")
	ScavengerValidationFailuresCount                          = NewCounterDef("scavenger_validation_failures")
	ScavengerValidationSkipsCount                             = NewCounterDef("scavenger_validation_skips")
	AddSearchAttributesFailuresCount                          = NewCounterDef("add_search_attributes_failures")

	// Delete Namespace metrics.
	ReclaimResourcesNamespaceDeleteSuccessCount = NewCounterDef(
		"reclaim_resources_namespace_delete_success",
		WithDescription("Incremented every time when ReclaimResources workflow deletes a namespace successfully"),
	)
	ReclaimResourcesNamespaceDeleteFailureCount = NewCounterDef(
		"reclaim_resources_namespace_delete_failure",
		WithDescription("Incremented every time when ReclaimResources workflow completes without deleting a namespace"),
	)
	ReclaimResourcesDeleteExecutionsSuccessCount = NewCounterDef(
		"reclaim_resources_delete_executions_success",
		WithDescription("The number of workflow executions that was successfully deleted when ReclaimResources workflow completes"),
	)
	ReclaimResourcesDeleteExecutionsFailureCount = NewCounterDef(
		"reclaim_resources_delete_executions_failure",
		WithDescription("The number of workflow executions that got error when ReclaimResources workflow completes"),
	)

	DeleteExecutionsSuccessCount = NewCounterDef(
		"delete_executions_success",
		WithDescription("The number of workflow executions that was successfully deleted by DeleteExecutions workflow"),
	)
	DeleteExecutionsFailureCount = NewCounterDef(
		"delete_executions_failure",
		WithDescription("The number of workflow executions that got error while deleting by DeleteExecutions workflow"),
	)
	DeleteExecutionsNotFoundCount = NewCounterDef(
		"delete_executions_not_found",
		WithDescription("The number of workflow executions that wasn't found by DeleteExecutions workflow"),
	)

	// Batcher metrics.
	BatcherProcessorSuccess = NewCounterDef(
		"batcher_processor_requests",
		WithDescription("The number of individual workflow execution tasks successfully processed by the batch request processor"),
	)
	BatcherProcessorFailures                          = NewCounterDef("batcher_processor_errors")
	BatcherOperationFailures                          = NewCounterDef("batcher_operation_errors")
	ElasticsearchBulkProcessorRequests                = NewCounterDef("elasticsearch_bulk_processor_requests")
	ElasticsearchBulkProcessorQueuedRequests          = NewDimensionlessHistogramDef("elasticsearch_bulk_processor_queued_requests")
	ElasticsearchBulkProcessorFailures                = NewCounterDef("elasticsearch_bulk_processor_errors")
	ElasticsearchBulkProcessorCorruptedData           = NewCounterDef("elasticsearch_bulk_processor_corrupted_data")
	ElasticsearchBulkProcessorDuplicateRequest        = NewCounterDef("elasticsearch_bulk_processor_duplicate_request")
	ElasticsearchBulkProcessorRequestLatency          = NewTimerDef("elasticsearch_bulk_processor_request_latency")
	ElasticsearchBulkProcessorCommitLatency           = NewTimerDef("elasticsearch_bulk_processor_commit_latency")
	ElasticsearchBulkProcessorWaitAddLatency          = NewTimerDef("elasticsearch_bulk_processor_wait_add_latency")
	ElasticsearchBulkProcessorWaitStartLatency        = NewTimerDef("elasticsearch_bulk_processor_wait_start_latency")
	ElasticsearchBulkProcessorBulkSize                = NewDimensionlessHistogramDef("elasticsearch_bulk_processor_bulk_size")
	ElasticsearchBulkProcessorBulkResquestTookLatency = NewTimerDef("elasticsearch_bulk_processor_bulk_request_took_latency")
	ElasticsearchDocumentParseFailuresCount           = NewCounterDef("elasticsearch_document_parse_failures_counter")
	ElasticsearchDocumentGenerateFailuresCount        = NewCounterDef("elasticsearch_document_generate_failures_counter")
	ElasticsearchCustomOrderByClauseCount             = NewCounterDef("elasticsearch_custom_order_by_clause_counter")
	CatchUpReadyShardCountGauge                       = NewGaugeDef("catchup_ready_shard_count")
	CatchUpNotReadyShardCountGauge                    = NewGaugeDef("catchup_not_ready_shard_count")
	HandoverReadyShardCountGauge                      = NewGaugeDef("handover_ready_shard_count")
	ReplicatorMessages                                = NewCounterDef("replicator_messages")
	ReplicatorFailures                                = NewCounterDef("replicator_errors")
	ReplicatorLatency                                 = NewTimerDef("replicator_latency")
	ReplicatorDLQFailures                             = NewCounterDef("replicator_dlq_enqueue_fails")
	NamespaceReplicationEnqueueDLQCount               = NewCounterDef("namespace_replication_dlq_enqueue_requests")

	TaskQueueUserDataReplicationIncomingPerTypeDataDropped = NewCounterDef(
		"task_queue_user_data_replication_incoming_per_type_data_dropped",
		WithDescription("The number of task queue user data replication merges that discarded incoming, non-empty per-type data."),
	)

	ParentClosePolicyProcessorSuccess       = NewCounterDef("parent_close_policy_processor_requests")
	ParentClosePolicyProcessorFailures      = NewCounterDef("parent_close_policy_processor_errors")
	SignalExternalWorkflowExecutionFailures = NewCounterDef(
		"signal_external_workflow_execution_failures",
		WithDescription("The number of signal external workflow execution failures by cause."),
	)
	ScheduleMissedCatchupWindow = NewCounterDef(
		"schedule_missed_catchup_window",
		WithDescription("The number of times a schedule missed an action due to the configured catchup window"),
	)
	ScheduleRateLimited = NewCounterDef(
		"schedule_rate_limited",
		WithDescription("The number of times a schedule action was delayed by more than 1s due to rate limiting"),
	)
	ScheduleBufferOverruns = NewCounterDef(
		"schedule_buffer_overruns",
		WithDescription("The number of schedule actions that were dropped due to the action buffer being full"),
	)
	ScheduleActionSuccess = NewCounterDef(
		"schedule_action_success",
		WithDescription("The number of successful StartWorkflow RPCs issued by a schedule."),
	)
	ScheduleActionErrors = NewCounterDef(
		"schedule_action_errors",
		WithDescription("The number of failed attempts from starting schedule actions"),
	)
	ScheduleCancelWorkflowErrors = NewCounterDef(
		"schedule_cancel_workflow_errors",
		WithDescription("The number of times a schedule got an error trying to cancel a previous run"),
	)
	ScheduleTerminateWorkflowErrors = NewCounterDef(
		"schedule_terminate_workflow_errors",
		WithDescription("The number of times a schedule got an error trying to terminate a previous run"),
	)
	ScheduleActionDelay = NewTimerDef(
		"schedule_action_delay",
		WithDescription("Delay between when scheduled actions should/actually happen"),
	)
	ScheduleActionE2EDelay = NewTimerDef(
		"schedule_action_e2e_delay",
		WithDescription("End-to-end delay between the action's original schedule time and when it was actually started, including overlap policy wait"),
	)
	ScheduleGenerateLatency = NewTimerDef(
		"schedule_generate_latency",
		WithDescription("Delay between when a scheduled action was due and when the generator buffered it"),
	)
	ScheduleGeneratorTicks = NewCounterDef(
		"schedule_generator_ticks",
		WithDescription("The number of times a scheduler's generator task fired. Compare with schedule_generator_paused_ticks to attribute task throughput to paused vs. active schedules."),
	)
	ScheduleGeneratorPausedTicks = NewCounterDef(
		"schedule_generator_paused_ticks",
		WithDescription("The number of times a scheduler's generator task fired while the schedule was paused."),
	)
	SchedulerGeneratorLoopCompleted = NewCounterDef(
		"scheduler_generator_loop_completed",
		WithDescription("The number of times a scheduler's generator stopped rescheduling itself without arming an idle task. The schedule is held open waiting for an external trigger (unpause, spec update, backfill completion)."),
	)
	ScheduleComputeLimitExceeded = NewCounterDef(
		"schedule_compute_limit_exceeded",
		WithDescription("The number of times a schedule's next-time search hit the hard compute iteration bound and stopped the schedule"),
	)
	ScheduleComputeLimitWarning = NewCounterDef(
		"schedule_compute_limit_warning",
		WithDescription("The number of times a schedule's next-time search crossed the warn compute iteration threshold; the search continued and the schedule was not stopped"),
	)
	ScheduleIdleTask = NewCounterDef(
		"schedule_idle_task",
		WithDescription("The number of times a schedule's idle task ran. Tagged with outcome and reason (reason is \"none\" when outcome is \"fired\")."),
	)
	ScheduleInvokerProcessBufferTask = NewCounterDef(
		"schedule_invoker_process_buffer_task",
		WithDescription("The number of times a scheduler's ProcessBuffer task ran. Tagged with outcome and reason (reason is \"none\" when outcome is \"fired\")."),
	)
	ScheduleInvokerExecuteTask = NewCounterDef(
		"schedule_invoker_execute_task",
		WithDescription("The number of times a scheduler's Execute side-effect task ran. Tagged with outcome and reason (reason is \"none\" when outcome is \"fired\")."),
	)
	ScheduleBackfillerTask = NewCounterDef(
		"schedule_backfiller_task",
		WithDescription("The number of times a scheduler's Backfiller task ran. Tagged with outcome and reason (reason is \"none\" when outcome is \"fired\")."),
	)
	ScheduleBackfillerCompleted = NewCounterDef(
		"schedule_backfiller_completed",
		WithDescription("The number of times a scheduler's Backfiller drained its requested time range and deleted itself. End-to-end signal for backfill request lifecycle."),
	)
	ScheduleBufferedStartDropped = NewCounterDef(
		"schedule_buffered_start_dropped",
		WithDescription("The number of buffered starts dropped by ProcessBuffer before execution. Tagged with reason (missed_catchup_window, paused_or_limited)."),
	)
	SchedulePayloadSize = NewCounterDef(
		"schedule_payload_size",
		WithDescription("The size in bytes of a customer payload (including action results and update signals)"),
	)
	ScheduleMigrationStarted = NewCounterDef(
		"schedule_migration_started",
		WithDescription("The number of times a schedule migration is started"),
	)
	ScheduleMigrationCompleted = NewCounterDef(
		"schedule_migration_completed",
		WithDescription("The number of times a schedule migration completes successfully"),
	)
	ScheduleMigrationFailed = NewCounterDef(
		"schedule_migration_failed",
		WithDescription("The number of times a schedule migration fails"),
	)
	ScheduleOverlapSkipped = NewCounterDef(
		"schedule_overlap_skipped",
		WithDescription("The number of schedule actions skipped due to overlap policy"),
	)
	ScheduleCallbackLatency = NewTimerDef(
		"schedule_callback_latency",
		WithDescription("Latency between a scheduled action completing and the scheduler receiving the completion callback"),
	)
	ScheduleCallbackIgnored = NewCounterDef(
		"schedule_callback_ignored",
		WithDescription("Scheduler received a completion callback unassociated with any known running actions"),
	)

	// Worker Versioning
	WorkerDeploymentCreated                           = NewCounterDef("worker_deployment_created")
	WorkerDeploymentVersionCreated                    = NewCounterDef("worker_deployment_version_created")
	WorkerDeploymentVersionCreatedManagedByController = NewCounterDef("worker_deployment_version_created_managed_by_controller")
	WorkerDeploymentVersionNotFoundDuringDelete       = NewCounterDef("worker_deployment_version_not_found_during_delete")
	WorkerDeploymentVersionVisibilityQueryCount       = NewCounterDef("worker_deployment_version_visibility_query_count")
	WorkerDeploymentVersioningOverrideCounter         = NewCounterDef("worker_deployment_versioning_override_count")
	WorkerDeploymentVersioningOneTimeOverrideCounter  = NewCounterDef("worker_deployment_versioning_one_time_override_count")
	StartDeploymentTransitionCounter                  = NewCounterDef("start_deployment_transition_count")
	VersioningDataPropagationLatency                  = NewTimerDef("versioning_data_propagation_latency")
	SlowVersioningDataPropagationCounter              = NewCounterDef("slow_versioning_data_propagation")
	WorkflowTargetVersionChangedCount                 = NewCounterDef("workflow_target_version_changed_count")

	// Continue-as-new
	WorkflowContinueAsNewCount        = NewCounterDef("workflow_continue_as_new_count")
	WorkflowSuggestContinueAsNewCount = NewCounterDef("workflow_suggest_continue_as_new_count")

	WorkflowResetCount        = NewCounterDef("workflow_reset_count")
	WorkflowQuerySuccessCount = NewCounterDef("workflow_query_success_count")
	WorkflowQueryFailureCount = NewCounterDef("workflow_query_failure_count")
	WorkflowQueryTimeoutCount = NewCounterDef("workflow_query_timeout_count")
	WorkflowTasksCompleted    = NewCounterDef("workflow_tasks_completed")

	// Force replication
	EncounterZombieWorkflowCount        = NewCounterDef("encounter_zombie_workflow_count")
	EncounterNotFoundWorkflowCount      = NewCounterDef("encounter_not_found_workflow_count")
	EncounterPassRetentionWorkflowCount = NewCounterDef("encounter_pass_retention_workflow_count")
	GenerateReplicationTasksLatency     = NewTimerDef("generate_replication_tasks_latency")
	VerifyReplicationTaskSuccess        = NewCounterDef("verify_replication_task_success")
	VerifyReplicationTaskNotFound       = NewCounterDef("verify_replication_task_not_found")
	VerifyReplicationTaskFailed         = NewCounterDef("verify_replication_task_failed")
	VerifyReplicationTasksLatency       = NewTimerDef("verify_replication_tasks_latency")
	VerifyDescribeMutableStateLatency   = NewTimerDef("verify_describe_mutable_state_latency")

	// Replication
	NamespaceReplicationTaskAckLevelGauge = NewGaugeDef("namespace_replication_task_ack_level")
	NamespaceReplicationDLQAckLevelGauge  = NewGaugeDef("namespace_dlq_ack_level")
	NamespaceReplicationDLQMaxLevelGauge  = NewGaugeDef("namespace_dlq_max_level")

	// Persistence
	PersistenceRequests = NewCounterDef(
		"persistence_requests",
		WithDescription("Persistence requests, keyed by `operation`"),
	)
	PersistenceFailures      = NewCounterDef("persistence_errors")
	PersistenceErrorWithType = NewCounterDef(
		"persistence_error_with_type",
		WithDescription("Persistence errors, keyed by `error_type`"),
	)
	PersistenceLatency = NewTimerDef(
		"persistence_latency",
		WithDescription("Persistence latency, keyed by `operation`"),
	)
	PersistenceShardRPS                    = NewDimensionlessHistogramDef("persistence_shard_rps")
	PersistenceErrResourceExhaustedCounter = NewCounterDef("persistence_errors_resource_exhausted")
	VisibilityPersistenceRequests          = NewCounterDef("visibility_persistence_requests")
	VisibilityPersistenceErrorWithType     = NewCounterDef("visibility_persistence_error_with_type")
	VisibilityPersistenceFailures          = NewCounterDef("visibility_persistence_errors")
	VisibilityPersistenceResourceExhausted = NewCounterDef("visibility_persistence_resource_exhausted")
	VisibilityPersistenceLatency           = NewTimerDef("visibility_persistence_latency")
	CassandraInitSessionLatency            = NewTimerDef("cassandra_init_session_latency")
	CassandraSessionRefreshFailures        = NewCounterDef("cassandra_session_refresh_failures")
	PersistenceSessionRefreshFailures      = NewCounterDef("persistence_session_refresh_failures")
	PersistenceSessionRefreshAttempts      = NewCounterDef("persistence_session_refresh_attempts")
	PersistenceSQLMaxOpenConn              = NewGaugeDef("persistence_sql_max_open_conn")
	PersistenceSQLOpenConn                 = NewGaugeDef("persistence_sql_open_conn")
	PersistenceSQLIdleConn                 = NewGaugeDef("persistence_sql_idle_conn")
	PersistenceSQLInUse                    = NewGaugeDef("persistence_sql_in_use")

	// Common service base metrics
	RestartCount            = NewCounterDef("restarts")
	NumGoRoutinesGauge      = NewGaugeDef("num_goroutines")
	GoMaxProcsGauge         = NewGaugeDef("gomaxprocs")
	MemoryAllocatedGauge    = NewGaugeDef("memory_allocated")
	MemoryHeapGauge         = NewGaugeDef("memory_heap")
	MemoryHeapObjectsGauge  = NewGaugeDef("memory_heap_objects")
	MemoryHeapIdleGauge     = NewGaugeDef("memory_heapidle")
	MemoryHeapInuseGauge    = NewGaugeDef("memory_heapinuse")
	MemoryHeapReleasedGauge = NewGaugeDef("memory_heapreleased")
	MemoryStackGauge        = NewGaugeDef("memory_stack")
	MemoryMallocsGauge      = NewGaugeDef("memory_mallocs")
	MemoryFreesGauge        = NewGaugeDef("memory_frees")
	NumGCCounter            = NewBytesHistogramDef("memory_num_gc")
	GcPauseMsTimer          = NewTimerDef("memory_gc_pause_ms")
	NumGCGauge              = NewGaugeDef("memory_num_gc_last",
		WithDescription("Last runtime.MemStats.NumGC"),
	)
	GcPauseNsTotal = NewGaugeDef("memory_pause_total_ns_last",
		WithDescription("Last runtime.MemStats.PauseTotalNs"),
	)
)
View Source
var NoopCounterMetricFunc = CounterFunc(func(i int64, t ...Tag) {})
View Source
var NoopGaugeMetricFunc = GaugeFunc(func(f float64, t ...Tag) {})
View Source
var NoopHistogramMetricFunc = HistogramFunc(func(i int64, t ...Tag) {})
View Source
var NoopTimerMetricFunc = TimerFunc(func(d time.Duration, t ...Tag) {})
View Source
var RuntimeMetricsReporterLifetimeHooksModule = fx.Options(
	fx.Invoke(RuntimeMetricsReporterLifetimeHooks),
)
View Source
var RuntimeMetricsReporterModule = fx.Options(
	RuntimeMetricsReporterLifetimeHooksModule,
)

Functions

func AddMetricsContext

func AddMetricsContext(ctx context.Context) context.Context

func CapturePanic

func CapturePanic(logger log.Logger, metricHandler Handler, retError *error)

CapturePanic is used to capture panic, it will emit the service panic metric, log the panic and also return the error through pointer. If the panic value is not error then a default error is returned We have to use pointer is because in golang: "recover return nil if was not called directly by a deferred function." And we have to set the returned error otherwise our handler will return nil as error which is incorrect

func ContextCounterAdd

func ContextCounterAdd(ctx context.Context, name string, value int64) bool

ContextCounterAdd adds value to counter within metrics context.

func ContextCounterGet

func ContextCounterGet(ctx context.Context, name string) (int64, bool)

ContextCounterGet returns value and true if successfully retrieved value

func NewBytesHistogramDef

func NewBytesHistogramDef(name string, opts ...Option) histogramDefinition

func NewClientMetricsTrailerPropagatorInterceptor

func NewClientMetricsTrailerPropagatorInterceptor(logger log.Logger) grpc.UnaryClientInterceptor

NewClientMetricsTrailerPropagatorInterceptor returns grpc client interceptor that injects metrics received in trailer into metrics context.

func NewCounterDef

func NewCounterDef(name string, opts ...Option) counterDefinition

func NewDimensionlessHistogramDef

func NewDimensionlessHistogramDef(name string, opts ...Option) histogramDefinition

func NewGaugeDef

func NewGaugeDef(name string, opts ...Option) gaugeDefinition

func NewOpenTelemetryProviderWithPrometheus

func NewOpenTelemetryProviderWithPrometheus(
	logger log.Logger,
	prometheusConfig *PrometheusConfig,
	clientConfig *ClientConfig,
	fatalOnListenerError bool,
) (*openTelemetryProviderImpl, error)

NewOpenTelemetryProviderWithPrometheus creates a new OpenTelemetry provider with a Prometheus exporter.

func NewOpenTelemetryProviderWithStatsd

func NewOpenTelemetryProviderWithStatsd(
	logger log.Logger,
	statsdConfig *StatsdConfig,
	clientConfig *ClientConfig,
) (*openTelemetryProviderImpl, error)

NewOpenTelemetryProviderWithStatsd creates a new OpenTelemetry provider with a StatsD exporter.

func NewOtelMetricsHandler

func NewOtelMetricsHandler(
	l log.Logger,
	o OpenTelemetryProvider,
	cfg ClientConfig,
	shouldRecordTimerInSeconds bool,
) (*otelMetricsHandler, error)

NewOtelMetricsHandler returns a new Handler that uses the provided OpenTelemetry [metric.Meter] to record metrics. This OTel handler supports metric descriptions for metrics registered with the New*Def functions. However, those functions must be called before this constructor. Otherwise, the descriptions will be empty. This is because the OTel metric descriptions are generated from the globalRegistry. You may also record metrics that are not registered via the New*Def functions. In that case, the metric description will be the OTel default (the metric name itself).

func NewScope

func NewScope(logger log.Logger, c *Config) tally.Scope

NewScope builds a new tally scope for this metrics configuration

If the underlying configuration is valid for multiple reporter types, only one of them will be used for reporting.

Current priority order is: statsd > prometheus

func NewServerMetricsContextInjectorInterceptor

func NewServerMetricsContextInjectorInterceptor() grpc.UnaryServerInterceptor

NewServerMetricsContextInjectorInterceptor returns grpc server interceptor that adds metrics context to golang context.

func NewServerMetricsTrailerPropagatorInterceptor

func NewServerMetricsTrailerPropagatorInterceptor(logger log.Logger) grpc.UnaryServerInterceptor

NewServerMetricsTrailerPropagatorInterceptor returns grpc server interceptor that injects metrics from context into gRPC trailer.

func NewStatsdExporter

func NewStatsdExporter(config *StatsdConfig, logger log.Logger) (*statsdExporter, error)

NewStatsdExporter creates a new StatsD exporter that implements the OpenTelemetry metric.Exporter interface

func NewTallyMetricsHandler

func NewTallyMetricsHandler(cfg ClientConfig, scope tally.Scope) *tallyMetricsHandler

func NewTimerDef

func NewTimerDef(name string, opts ...Option) timerDefinition

func RuntimeMetricsReporterLifetimeHooks

func RuntimeMetricsReporterLifetimeHooks(
	lc fx.Lifecycle,
	reporter *RuntimeMetricsReporter,
)

Types

type BatchHandler

type BatchHandler interface {
	Handler
	io.Closer
}

Mostly cribbed from https://github.com/temporalio/sdk-go/blob/master/internal/common/metrics/handler.go and adapted to depend on golang.org/x/exp/event

type ClientConfig

type ClientConfig struct {
	// Tags is the set of key-value pairs to be reported as part of every metric
	Tags map[string]string `yaml:"tags"`
	// ExcludeTags is a map from tag name string to tag values string list.
	// Each value present in keys will have relevant tag value replaced with "_tag_excluded_"
	// Each value in values list will white-list tag values to be reported as usual.
	ExcludeTags map[string][]string `yaml:"excludeTags"`
	// Prefix sets the prefix to all outgoing metrics
	// When migrating from tally to opentelemetry and to be backward compatible with the existing metric names,
	// if the prefix has a "_" suffix, add an additional "_" at the end.
	// i.e. "temporal" -> "temporal", but "temporal_" -> "temporal__", "temporal__" -> "temporal___".
	// This is because tally implementation blindly adds "_" as the separator between the prefix
	// and the metric name, while opentelemetry implementation only adds it if it's not already there.
	Prefix string `yaml:"prefix"`

	// DefaultHistogramBoundaries defines the default histogram bucket
	// boundaries.
	// Configuration of histogram boundaries for given metric unit.
	//
	// Supported values:
	// - "dimensionless"
	// - "milliseconds"
	// - "bytes"
	PerUnitHistogramBoundaries map[string][]float64 `yaml:"perUnitHistogramBoundaries"`

	// WithoutUnitSuffix controls the additional of unit suffixes to metric names.
	// This config only takes effect when using opentelemetry framework.
	// Note: this config only takes effect when using prometheus via opentelemetry framework
	WithoutUnitSuffix bool `yaml:"withoutUnitSuffix"`
	// WithoutCounterSuffix controls the additional of _total suffixes to counter metric names.
	// This config only takes effect when using opentelemetry framework.
	// Note: this config only takes effect when using prometheus via opentelemetry framework
	WithoutCounterSuffix bool `yaml:"withoutCounterSuffix"`
	// RecordTimerInSeconds controls if Timer metric should be emitted as number of seconds
	// (instead of milliseconds).
	// This config only takes effect when using prometheus via opentelemetry framework
	RecordTimerInSeconds bool `yaml:"recordTimerInSeconds"`
	// TagsCacheMaxSize controls the maximum number of entries in the metrics
	// tag cache. When the cache is full, all entries are cleared. Default: 10000.
	TagsCacheMaxSize int `yaml:"tagsCacheMaxSize"`
}

type Config

type Config struct {
	ClientConfig `yaml:"clientConfig,inline"`

	// Statsd is the configuration for statsd reporter
	Statsd *StatsdConfig `yaml:"statsd"`
	// Prometheus is the configuration for prometheus reporter
	Prometheus *PrometheusConfig `yaml:"prometheus"`
}

Config contains the config items for metrics subsystem

type CounterFunc

type CounterFunc func(int64, ...Tag)

Mostly cribbed from https://github.com/temporalio/sdk-go/blob/master/internal/common/metrics/handler.go and adapted to depend on golang.org/x/exp/event

func (CounterFunc) Record

func (c CounterFunc) Record(v int64, tags ...Tag)

type CounterIface

type CounterIface interface {
	// Record increments the counter value.
	// Tags provided are merged with the source MetricsHandler
	Record(int64, ...Tag)
}

CounterIface is an ever-increasing counter.

type GaugeFunc

type GaugeFunc func(float64, ...Tag)

Mostly cribbed from https://github.com/temporalio/sdk-go/blob/master/internal/common/metrics/handler.go and adapted to depend on golang.org/x/exp/event

func (GaugeFunc) Record

func (c GaugeFunc) Record(v float64, tags ...Tag)

type GaugeIface

type GaugeIface interface {
	// Record updates the gauge value.
	// Tags provided are merged with the source MetricsHandler
	Record(float64, ...Tag)
}

GaugeIface can be set to any float and represents a latest value instrument.

type Handler

type Handler interface {
	// WithTags creates a new Handler with provided Tag list.
	// Tags are merged with registered Tags from the source Handler.
	WithTags(...Tag) Handler

	// Counter obtains a counter for the given name.
	Counter(string) CounterIface

	// Gauge obtains a gauge for the given name.
	Gauge(string) GaugeIface

	// Timer obtains a timer for the given name.
	Timer(string) TimerIface

	// Histogram obtains a histogram for the given name.
	Histogram(string, MetricUnit) HistogramIface

	Stop(log.Logger)

	// StartBatch returns a BatchHandler that can emit a series of metrics as a single "wide event".
	// If wide events aren't supported in the underlying implementation, metrics can still be sent individually.
	StartBatch(string) BatchHandler
}

Handler is a wrapper around a metrics client. If you are interacting with metrics registered with New*Def functions, e.g. NewCounterDef, please use the With method of those definitions instead of calling Counter directly on the Handler. This will ensure that you don't accidentally use the wrong metric type, and you don't need to re-specify metric types or units.

Example
package main

import (
	"fmt"
	"slices"
	"time"

	"github.com/superdurable/xtemporal/common/metrics"
	"github.com/superdurable/xtemporal/common/metrics/metricstest"
	expmaps "golang.org/x/exp/maps"
)

var (
	bytesHist = metrics.NewBytesHistogramDef("test-bytes-histogram")
	counter   = metrics.NewCounterDef("test-counter")
	gauge     = metrics.NewGaugeDef("test-gauge")
	hist      = metrics.NewDimensionlessHistogramDef("test-histogram")
	timer     = metrics.NewTimerDef("test-timer")
)

func main() {
	handler := metricstest.NewCaptureHandler()
	capture := handler.StartCapture()

	// Instead of calling handler.Histogram(bytesHist.Name(), bytesHist.Unit()).Record(1), you should use the With
	// method of the metric definition instead.

	bytesHist.With(handler).Record(1)
	counter.With(handler).Record(2)
	gauge.With(handler).Record(3)
	hist.With(handler).Record(4)
	timer.With(handler).Record(5 * time.Second)

	snapshot := capture.Snapshot()
	keys := expmaps.Keys(snapshot)
	slices.Sort(keys)
	for _, key := range keys {
		fmt.Printf("%s:", key)
		for _, rec := range snapshot[key] {
			fmt.Printf(" %v (%v)", rec.Value, rec.Unit)
		}
		fmt.Println()
	}

	// Notice that the output includes the proper units without having to specify them in the call to Record.

}
Output:
test-bytes-histogram: 1 (By)
test-counter: 2 ()
test-gauge: 3 ()
test-histogram: 4 (1)
test-timer: 5s ()
var (
	NoopMetricsHandler Handler = newNoopMetricsHandler()
)

func GetPerActivityScope

func GetPerActivityScope(
	handler Handler,
	namespaceName string,
	taskQueueFamily *tqid.TaskQueueFamily,
	taskQueueBreakdown bool,
	operation string,
	activityType string,
	workflowType string,
	versioningBehavior enumspb.VersioningBehavior,
) Handler

GetPerActivityScope returns the standard tags for metrics associated with an activity.

func GetPerTaskQueueFamilyScope

func GetPerTaskQueueFamilyScope(
	handler Handler,
	namespaceName string,
	taskQueueFamily *tqid.TaskQueueFamily,
	taskQueueBreakdown bool,
	tags ...Tag,
) Handler

GetPerTaskQueueFamilyScope returns "namespace" and "taskqueue" tags. "taskqueue" will be "__omitted__" if taskQueueBreakdown is false.

func GetPerTaskQueuePartitionIDScope

func GetPerTaskQueuePartitionIDScope(
	handler Handler,
	namespaceName string,
	partition tqid.Partition,
	taskQueueBreakdown bool,
	partitionIDBreakdown bool,
	tags ...Tag,
) Handler

GetPerTaskQueuePartitionIDScope is similar to GetPerTaskQueuePartitionTypeScope, except that the partition tag will hold the normal partition ID if partitionIDBreakdown is true.

func GetPerTaskQueuePartitionTypeScope

func GetPerTaskQueuePartitionTypeScope(
	handler Handler,
	namespaceName string,
	partition tqid.Partition,
	taskQueueBreakdown bool,
	tags ...Tag,
) Handler

GetPerTaskQueuePartitionTypeScope returns GetPerTaskQueueScope scope plus a "partition" tag which can be "__normal__", "__sticky__", "__worker_commands__", or "_unknown_".

func GetPerTaskQueueScope

func GetPerTaskQueueScope(
	handler Handler,
	namespaceName string,
	taskQueue *tqid.TaskQueue,
	taskQueueBreakdown bool,
	tags ...Tag,
) Handler

GetPerTaskQueueScope returns GetPerTaskQueueFamilyScope plus the "task_type" tag.

func MetricsHandlerFromConfig

func MetricsHandlerFromConfig(logger log.Logger, c *Config) (Handler, error)

MetricsHandlerFromConfig is used at startup to construct a MetricsHandler

type HistogramFunc

type HistogramFunc func(int64, ...Tag)

Mostly cribbed from https://github.com/temporalio/sdk-go/blob/master/internal/common/metrics/handler.go and adapted to depend on golang.org/x/exp/event

func (HistogramFunc) Record

func (c HistogramFunc) Record(v int64, tags ...Tag)

type HistogramIface

type HistogramIface interface {
	// Record adds a value to the distribution
	// Tags provided are merged with the source MetricsHandler
	Record(int64, ...Tag)
}

HistogramIface records a distribution of values.

type HistogramObjective

type HistogramObjective struct {
	Upper float64 `yaml:"upper"`
}

Deprecated. HistogramObjective is a Prometheus histogram bucket. Added for backwards compatibility.

type MetricUnit

type MetricUnit string

type MockBatchHandler

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

MockBatchHandler is a mock of BatchHandler interface.

func NewMockBatchHandler

func NewMockBatchHandler(ctrl *gomock.Controller) *MockBatchHandler

NewMockBatchHandler creates a new mock instance.

func (*MockBatchHandler) Close

func (m *MockBatchHandler) Close() error

Close mocks base method.

func (*MockBatchHandler) Counter

func (m *MockBatchHandler) Counter(arg0 string) CounterIface

Counter mocks base method.

func (*MockBatchHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBatchHandler) Gauge

func (m *MockBatchHandler) Gauge(arg0 string) GaugeIface

Gauge mocks base method.

func (*MockBatchHandler) Histogram

func (m *MockBatchHandler) Histogram(arg0 string, arg1 MetricUnit) HistogramIface

Histogram mocks base method.

func (*MockBatchHandler) StartBatch

func (m *MockBatchHandler) StartBatch(arg0 string) BatchHandler

StartBatch mocks base method.

func (*MockBatchHandler) Stop

func (m *MockBatchHandler) Stop(arg0 log.Logger)

Stop mocks base method.

func (*MockBatchHandler) Timer

func (m *MockBatchHandler) Timer(arg0 string) TimerIface

Timer mocks base method.

func (*MockBatchHandler) WithTags

func (m *MockBatchHandler) WithTags(arg0 ...Tag) Handler

WithTags mocks base method.

type MockBatchHandlerMockRecorder

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

MockBatchHandlerMockRecorder is the mock recorder for MockBatchHandler.

func (*MockBatchHandlerMockRecorder) Close

Close indicates an expected call of Close.

func (*MockBatchHandlerMockRecorder) Counter

func (mr *MockBatchHandlerMockRecorder) Counter(arg0 any) *gomock.Call

Counter indicates an expected call of Counter.

func (*MockBatchHandlerMockRecorder) Gauge

func (mr *MockBatchHandlerMockRecorder) Gauge(arg0 any) *gomock.Call

Gauge indicates an expected call of Gauge.

func (*MockBatchHandlerMockRecorder) Histogram

func (mr *MockBatchHandlerMockRecorder) Histogram(arg0, arg1 any) *gomock.Call

Histogram indicates an expected call of Histogram.

func (*MockBatchHandlerMockRecorder) StartBatch

func (mr *MockBatchHandlerMockRecorder) StartBatch(arg0 any) *gomock.Call

StartBatch indicates an expected call of StartBatch.

func (*MockBatchHandlerMockRecorder) Stop

func (mr *MockBatchHandlerMockRecorder) Stop(arg0 any) *gomock.Call

Stop indicates an expected call of Stop.

func (*MockBatchHandlerMockRecorder) Timer

func (mr *MockBatchHandlerMockRecorder) Timer(arg0 any) *gomock.Call

Timer indicates an expected call of Timer.

func (*MockBatchHandlerMockRecorder) WithTags

func (mr *MockBatchHandlerMockRecorder) WithTags(arg0 ...any) *gomock.Call

WithTags indicates an expected call of WithTags.

type MockCounterIface

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

MockCounterIface is a mock of CounterIface interface.

func NewMockCounterIface

func NewMockCounterIface(ctrl *gomock.Controller) *MockCounterIface

NewMockCounterIface creates a new mock instance.

func (*MockCounterIface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCounterIface) Record

func (m *MockCounterIface) Record(arg0 int64, arg1 ...Tag)

Record mocks base method.

type MockCounterIfaceMockRecorder

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

MockCounterIfaceMockRecorder is the mock recorder for MockCounterIface.

func (*MockCounterIfaceMockRecorder) Record

func (mr *MockCounterIfaceMockRecorder) Record(arg0 any, arg1 ...any) *gomock.Call

Record indicates an expected call of Record.

type MockGaugeIface

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

MockGaugeIface is a mock of GaugeIface interface.

func NewMockGaugeIface

func NewMockGaugeIface(ctrl *gomock.Controller) *MockGaugeIface

NewMockGaugeIface creates a new mock instance.

func (*MockGaugeIface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGaugeIface) Record

func (m *MockGaugeIface) Record(arg0 float64, arg1 ...Tag)

Record mocks base method.

type MockGaugeIfaceMockRecorder

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

MockGaugeIfaceMockRecorder is the mock recorder for MockGaugeIface.

func (*MockGaugeIfaceMockRecorder) Record

func (mr *MockGaugeIfaceMockRecorder) Record(arg0 any, arg1 ...any) *gomock.Call

Record indicates an expected call of Record.

type MockHandler

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

MockHandler is a mock of Handler interface.

func NewMockHandler

func NewMockHandler(ctrl *gomock.Controller) *MockHandler

NewMockHandler creates a new mock instance.

func (*MockHandler) Counter

func (m *MockHandler) Counter(arg0 string) CounterIface

Counter mocks base method.

func (*MockHandler) EXPECT

func (m *MockHandler) EXPECT() *MockHandlerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockHandler) Gauge

func (m *MockHandler) Gauge(arg0 string) GaugeIface

Gauge mocks base method.

func (*MockHandler) Histogram

func (m *MockHandler) Histogram(arg0 string, arg1 MetricUnit) HistogramIface

Histogram mocks base method.

func (*MockHandler) StartBatch

func (m *MockHandler) StartBatch(arg0 string) BatchHandler

StartBatch mocks base method.

func (*MockHandler) Stop

func (m *MockHandler) Stop(arg0 log.Logger)

Stop mocks base method.

func (*MockHandler) Timer

func (m *MockHandler) Timer(arg0 string) TimerIface

Timer mocks base method.

func (*MockHandler) WithTags

func (m *MockHandler) WithTags(arg0 ...Tag) Handler

WithTags mocks base method.

type MockHandlerMockRecorder

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

MockHandlerMockRecorder is the mock recorder for MockHandler.

func (*MockHandlerMockRecorder) Counter

func (mr *MockHandlerMockRecorder) Counter(arg0 any) *gomock.Call

Counter indicates an expected call of Counter.

func (*MockHandlerMockRecorder) Gauge

func (mr *MockHandlerMockRecorder) Gauge(arg0 any) *gomock.Call

Gauge indicates an expected call of Gauge.

func (*MockHandlerMockRecorder) Histogram

func (mr *MockHandlerMockRecorder) Histogram(arg0, arg1 any) *gomock.Call

Histogram indicates an expected call of Histogram.

func (*MockHandlerMockRecorder) StartBatch

func (mr *MockHandlerMockRecorder) StartBatch(arg0 any) *gomock.Call

StartBatch indicates an expected call of StartBatch.

func (*MockHandlerMockRecorder) Stop

func (mr *MockHandlerMockRecorder) Stop(arg0 any) *gomock.Call

Stop indicates an expected call of Stop.

func (*MockHandlerMockRecorder) Timer

func (mr *MockHandlerMockRecorder) Timer(arg0 any) *gomock.Call

Timer indicates an expected call of Timer.

func (*MockHandlerMockRecorder) WithTags

func (mr *MockHandlerMockRecorder) WithTags(arg0 ...any) *gomock.Call

WithTags indicates an expected call of WithTags.

type MockHistogramIface

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

MockHistogramIface is a mock of HistogramIface interface.

func NewMockHistogramIface

func NewMockHistogramIface(ctrl *gomock.Controller) *MockHistogramIface

NewMockHistogramIface creates a new mock instance.

func (*MockHistogramIface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockHistogramIface) Record

func (m *MockHistogramIface) Record(arg0 int64, arg1 ...Tag)

Record mocks base method.

type MockHistogramIfaceMockRecorder

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

MockHistogramIfaceMockRecorder is the mock recorder for MockHistogramIface.

func (*MockHistogramIfaceMockRecorder) Record

func (mr *MockHistogramIfaceMockRecorder) Record(arg0 any, arg1 ...any) *gomock.Call

Record indicates an expected call of Record.

type MockTimerIface

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

MockTimerIface is a mock of TimerIface interface.

func NewMockTimerIface

func NewMockTimerIface(ctrl *gomock.Controller) *MockTimerIface

NewMockTimerIface creates a new mock instance.

func (*MockTimerIface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTimerIface) Record

func (m *MockTimerIface) Record(arg0 time.Duration, arg1 ...Tag)

Record mocks base method.

type MockTimerIfaceMockRecorder

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

MockTimerIfaceMockRecorder is the mock recorder for MockTimerIface.

func (*MockTimerIfaceMockRecorder) Record

func (mr *MockTimerIfaceMockRecorder) Record(arg0 any, arg1 ...any) *gomock.Call

Record indicates an expected call of Record.

type OpenTelemetryProvider

type OpenTelemetryProvider interface {
	Stop(logger log.Logger)
	GetMeter() metric.Meter
}

type Option

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

Option is used to configure a metric definition. Note that options are currently only supported when using the Prometheus reporter with the OpenTelemetry framework.

type PrometheusConfig

type PrometheusConfig struct {
	// Metric framework: Tally/OpenTelemetry
	Framework string `yaml:"framework"`
	// Address for prometheus to serve metrics from.
	ListenAddress string `yaml:"listenAddress"`

	// HandlerPath if specified will be used instead of using the default
	// HTTP handler path "/metrics".
	HandlerPath string `yaml:"handlerPath"`

	// LoggerRPS sets the RPS of the logger provided to prometheus. Default of 0 means no limit.
	LoggerRPS float64 `yaml:"loggerRPS"`

	// Deprecated. ListenNetwork if specified will be used instead of using tcp network.
	// Supported networks: tcp, tcp4, tcp6 and unix.
	ListenNetwork string `yaml:"listenNetwork"`

	// Deprecated. TimerType is the default Prometheus type to use for Tally timers.
	// TimerType is always histogram.
	TimerType string `yaml:"timerType"`

	// Deprecated. Please use PerUnitHistogramBoundaries in ClientConfig.
	// DefaultHistogramBoundaries defines the default histogram bucket boundaries for tally timer metrics.
	DefaultHistogramBoundaries []float64 `yaml:"defaultHistogramBoundaries"`

	// Deprecated. Please use PerUnitHistogramBoundaries in ClientConfig.
	// DefaultHistogramBuckets if specified will set the default histogram
	// buckets to be used by the reporter for tally timer metrics.
	// The unit for value specified is Second.
	// If specified, will override DefaultSummaryObjectives and PerUnitHistogramBoundaries["milliseconds"].
	DefaultHistogramBuckets []HistogramObjective `yaml:"defaultHistogramBuckets"`

	// Deprecated. DefaultSummaryObjectives if specified will set the default summary
	// objectives to be used by the reporter.
	// The unit for value specified is Second.
	// If specified, will override PerUnitHistogramBoundaries["milliseconds"].
	DefaultSummaryObjectives []SummaryObjective `yaml:"defaultSummaryObjectives"`

	// Deprecated. OnError specifies what to do when an error either with listening
	// on the specified listen address or registering a metric with the
	// Prometheus. By default the registerer will panic.
	OnError string `yaml:"onError"`

	// Deprecated. SanitizeOptions is an optional field that enables a user to
	// specify which characters are valid and/or should be replaced before metrics
	// are emitted.
	SanitizeOptions *SanitizeOptions `yaml:"sanitizeOptions"`
}

PrometheusConfig is a new format for config for prometheus metrics.

type ReasonString

type ReasonString string

ReasonString is just a string but the special type is defined here to remind callers of ReasonTag to limit the cardinality of possible reasons.

const (
	PollerScaleReasonIdle        ReasonString = "idle"
	PollerScaleReasonBacklog     ReasonString = "backlog"
	PollerScaleReasonTaskRate    ReasonString = "task_rate"
	PollerScaleReasonRateLimited ReasonString = "rate_limited"
)

type RuntimeMetricsReporter

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

RuntimeMetricsReporter A struct containing the state of the RuntimeMetricsReporter.

func NewRuntimeMetricsReporter

func NewRuntimeMetricsReporter(
	handler Handler,
	reportInterval time.Duration,
	logger log.Logger,
	instanceID string,
) *RuntimeMetricsReporter

NewRuntimeMetricsReporter Creates a new RuntimeMetricsReporter.

func (*RuntimeMetricsReporter) Start

func (r *RuntimeMetricsReporter) Start()

Start Starts the reporter thread that periodically emits metrics.

func (*RuntimeMetricsReporter) Stop

func (r *RuntimeMetricsReporter) Stop()

Stop Stops reporting of runtime metrics. The reporter cannot be started again after it's been stopped.

type SanitizeOptions

type SanitizeOptions struct {
	NameCharacters       *ValidCharacters `yaml:"nameChars"`
	KeyCharacters        *ValidCharacters `yaml:"keyChars"`
	ValueCharacters      *ValidCharacters `yaml:"valueChars"`
	ReplacementCharacter string           `yaml:"replacementChar"`
}

type SanitizeRange

type SanitizeRange struct {
	StartRange string `yaml:"startRange"`
	EndRange   string `yaml:"endRange"`
}

type ServerStatsHandler

type ServerStatsHandler stats.Handler

func NewServerStatsHandler

func NewServerStatsHandler(mh Handler) ServerStatsHandler

type StatsdConfig

type StatsdConfig struct {
	// The host and port of the statsd server
	HostPort string `yaml:"hostPort" validate:"nonzero"`
	// The prefix to use in reporting to statsd
	Prefix string `yaml:"prefix" validate:"nonzero"`
	// FlushInterval is the maximum interval for sending packets.
	// If it is not specified, it defaults to 1 second.
	FlushInterval time.Duration `yaml:"flushInterval"`
	// FlushBytes specifies the maximum udp packet size you wish to send.
	// If FlushBytes is unspecified, it defaults  to 1432 bytes, which is
	// considered safe for local traffic.
	FlushBytes int `yaml:"flushBytes"`
	// Reporter allows additional configuration of the stats reporter, e.g. with custom tagging options.
	Reporter StatsdReporterConfig `yaml:"reporter"`
	// Metric framework: tally/opentelemetry. If not specified, it defaults to tally.
	Framework string `yaml:"framework"`
}

StatsdConfig contains the config items for statsd metrics reporter

type StatsdReporterConfig

type StatsdReporterConfig struct {
	// TagSeparator allows tags to be appended with a separator. If not specified tag keys and values
	// are embedded to the stat name directly.
	TagSeparator string `yaml:"tagSeparator"`
}

type SummaryObjective

type SummaryObjective struct {
	Percentile   float64 `yaml:"percentile"`
	AllowedError float64 `yaml:"allowedError"`
}

Deprecated. SummaryObjective is a Prometheus summary objective. Added for backwards compatibility.

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag is a struct to define metrics tags

func ActionType

func ActionType(value string) Tag

func ActivityTypeTag

func ActivityTypeTag(value string) Tag

ActivityTypeTag returns a new activity type tag.

func ArchetypeTag

func ArchetypeTag(value string) Tag

func CacheTypeTag

func CacheTypeTag(value string) Tag

func ChasmTaskTypeTag

func ChasmTaskTypeTag(value string) Tag

func ClientNameTag

func ClientNameTag(value string) Tag

ClientNameTag returns a new client_name tag for the SDK client name.

func CommandTypeTag

func CommandTypeTag(value string) Tag

CommandTypeTag returns a new command type tag.

func ContinueAsNewVersioningBehaviorTag

func ContinueAsNewVersioningBehaviorTag(canBehavior enumspb.ContinueAsNewVersioningBehavior) Tag

func DestinationTag

func DestinationTag(value string) Tag

DestinationTag is a tag for metrics emitted by outbound task executors for the task's destination.

func FailureSourceTag

func FailureSourceTag(value string) Tag

func FailureTag

func FailureTag(value string) Tag

Returns a new failure type tag

func FirstAttemptTag

func FirstAttemptTag(attempt int32) Tag

func ForwardedTag

func ForwardedTag(forwarded bool) Tag

func FromClusterIDTag

func FromClusterIDTag(value int32) Tag

FromClusterIDTag returns a new from cluster tag.

func FromUnversionedTag

func FromUnversionedTag(version string) Tag

func HeaderCallsiteTag

func HeaderCallsiteTag(kind string) Tag

func HttpStatusTag

func HttpStatusTag(value int) Tag

HttpStatusTag returns a new httpStatusTag.

func InstanceTag

func InstanceTag(value string) Tag

InstanceTag returns a new instance tag

func IsInternalTag

func IsInternalTag(internal bool) Tag

func MatchingTaskPriorityTag

func MatchingTaskPriorityTag(value int32) Tag

func NamespaceIDTag

func NamespaceIDTag(value string) Tag

NamespaceIDTag returns a new namespace ID tag.

func NamespaceStateTag

func NamespaceStateTag(value string) Tag

NamespaceStateTag returns a new namespace state tag.

func NamespaceTag

func NamespaceTag(value string) Tag

NamespaceTag returns a new namespace tag. For timers, this also ensures that we dual emit the metric with the all tag. If a blank namespace is provided then this converts that to an unknown namespace.

func NamespaceUnknownTag

func NamespaceUnknownTag() Tag

NamespaceUnknownTag returns a new namespace:unknown tag-value

func NexusEndpointTag

func NexusEndpointTag(value string) Tag

func NexusMethodTag

func NexusMethodTag(value string) Tag

func NexusOperationTag

func NexusOperationTag(value string) Tag

func NexusServiceTag

func NexusServiceTag(value string) Tag

func OperationTag

func OperationTag(value string) Tag

func OutcomeTag

func OutcomeTag(outcome string) Tag

func PartitionTag

func PartitionTag(partition string) Tag

func PersistenceDBKindTag

func PersistenceDBKindTag(kind string) Tag

func PollResultTag

func PollResultTag(result string) Tag

func PollerScaleDecisionTag

func PollerScaleDecisionTag(decision string) Tag

PollerScaleDecisionTag records the direction of a poller scaling decision (scale up, scale down, or hold). Pair it with ReasonTag for the cause. See metrics.PollerScaleDecisionCounter.

func PriorityTag

func PriorityTag(value locks.Priority) Tag

func QueryTypeTag

func QueryTypeTag(queryType string) Tag

func QueueActionTag

func QueueActionTag(value string) Tag

func QueueReaderIDTag

func QueueReaderIDTag(readerID int64) Tag

func QueueTypeTag

func QueueTypeTag(value string) Tag

func ReasonTag

func ReasonTag(value ReasonString) Tag

ReasonTag is a generic tag can be used anywhere a reason is needed. Make sure that the value is of limited cardinality.

func ReplicationTaskPriorityTag

func ReplicationTaskPriorityTag(value enumsspb.TaskPriority) Tag

ReplicationTaskPriorityTag returns a replication task priority tag.

func ReplicationTaskTypeTag

func ReplicationTaskTypeTag(value enumsspb.ReplicationTaskType) Tag

ReplicationTaskTypeTag returns a new replication task type tag.

func ResourceExhaustedCauseTag

func ResourceExhaustedCauseTag(cause enumspb.ResourceExhaustedCause) Tag

func ResourceExhaustedScopeTag

func ResourceExhaustedScopeTag(scope enumspb.ResourceExhaustedScope) Tag

func RunInitiatorTag

func RunInitiatorTag(prevRunID string, attributes *historypb.WorkflowExecutionStartedEventAttributes) Tag

RunInitiatorTag creates a tag indicating how a workflow run was initiated. It handles both new workflow runs and continuations from previous runs. When attributes is nil (e.g. during AddWorkflowExecutionOptionsUpdatedEvent), it returns a tag indicating an existing run.

func ScalerShadowModeTag

func ScalerShadowModeTag(enabled bool) Tag

func ServiceErrorTypeTag

func ServiceErrorTypeTag(err error) Tag

func ServiceNameTag

func ServiceNameTag(value primitives.ServiceName) Tag

func ServiceRoleTag

func ServiceRoleTag(value string) Tag

Returns a new service role tag.

func SourceClusterTag

func SourceClusterTag(value string) Tag

SourceClusterTag returns a new source cluster tag.

func StringTag

func StringTag(key string, value string) Tag

func SuggestContinueAsNewReasonHistorySizeTooLargeTag

func SuggestContinueAsNewReasonHistorySizeTooLargeTag(present bool) Tag

func SuggestContinueAsNewReasonTooManyHistoryEventsTag

func SuggestContinueAsNewReasonTooManyHistoryEventsTag(present bool) Tag

func SuggestContinueAsNewReasonTooManyUpdatesTag

func SuggestContinueAsNewReasonTooManyUpdatesTag(present bool) Tag

func TargetClusterTag

func TargetClusterTag(value string) Tag

TargetClusterTag returns a new target cluster tag.

func TaskAddResultTag

func TaskAddResultTag(result string) Tag

func TaskCategoryTag

func TaskCategoryTag(value string) Tag

func TaskPriorityTag

func TaskPriorityTag(value string) Tag

func TaskQueueTypeTag

func TaskQueueTypeTag(tqType enumspb.TaskQueueType) Tag

func TaskQueueUnknownTag

func TaskQueueUnknownTag() Tag

TaskQueueUnknownTag returns a new taskqueue:unknown tag-value

func TaskSourceTag

func TaskSourceTag(source enumsspb.TaskSource) Tag

func TaskTypeTag

func TaskTypeTag(value string) Tag

func TimeoutTypeTag

func TimeoutTypeTag(timeoutType string) Tag

func ToClusterIDTag

func ToClusterIDTag(value int32) Tag

ToClusterIDTag returns a new to cluster tag.

func ToUnversionedTag

func ToUnversionedTag(version string) Tag

func UnsafeTaskQueueTag

func UnsafeTaskQueueTag(value string) Tag

UnsafeTaskQueueTag returns a new task queue tag. WARNING: Do not use this function directly in production code as it may create high number of unique task queue tag values that can trouble the observability stack. Instead, use one of the following helper functions and pass a proper breakdown boolean (typically based on the task queue dynamic configs): - `workflow.PerTaskQueueFamilyScope` - `tqid.PerTaskQueueFamilyScope` - `tqid.PerTaskQueueScope` - `tqid.PerTaskQueuePartitionScope`

func VersionedTag

func VersionedTag(versioned string) Tag

VersionedTag represents whether a loaded task queue manager represents a specific version set or build ID or not.

func VersioningBehaviorAfterOverrideTag

func VersioningBehaviorAfterOverrideTag(behavior enumspb.VersioningBehavior) Tag

func VersioningBehaviorBeforeOverrideTag

func VersioningBehaviorBeforeOverrideTag(behavior enumspb.VersioningBehavior) Tag

func VersioningBehaviorTag

func VersioningBehaviorTag(behavior enumspb.VersioningBehavior) Tag

func VisibilityIndexNameTag

func VisibilityIndexNameTag(value string) Tag

func VisibilityPluginNameTag

func VisibilityPluginNameTag(value string) Tag

func WorkerDeploymentBuildIDTag

func WorkerDeploymentBuildIDTag(buildID string, versionBreakdown bool) Tag

func WorkerDeploymentNameTag

func WorkerDeploymentNameTag(deploymentName string, versionBreakdown bool) Tag

func WorkerPluginNameTag

func WorkerPluginNameTag(value string) Tag

func WorkerStorageDriverTypeTag

func WorkerStorageDriverTypeTag(value string) Tag

func WorkerVersionTag

func WorkerVersionTag(version string, versionBreakdown bool) Tag

Consider passing the value of "metrics.breakdownByBuildID" dynamic config to this function.

func WorkflowStatusTag

func WorkflowStatusTag(status string) Tag

func WorkflowTypeTag

func WorkflowTypeTag(value string) Tag

WorkflowTypeTag returns a new workflow type tag.

func (Tag) String

func (v Tag) String() string

type TimerFunc

type TimerFunc func(time.Duration, ...Tag)

Mostly cribbed from https://github.com/temporalio/sdk-go/blob/master/internal/common/metrics/handler.go and adapted to depend on golang.org/x/exp/event

func (TimerFunc) Record

func (c TimerFunc) Record(v time.Duration, tags ...Tag)

type TimerIface

type TimerIface interface {
	// Record sets the timer value.
	// Tags provided are merged with the source MetricsHandler
	Record(time.Duration, ...Tag)
}

TimerIface records time durations.

type ValidCharacters

type ValidCharacters struct {
	Ranges         []SanitizeRange `yaml:"ranges"`
	SafeCharacters string          `yaml:"safeChars"`
}

type WithDescription

type WithDescription string

WithDescription sets the description, or "help text", of a metric. See ServiceRequests for an example.

type WithUnit

type WithUnit MetricUnit

WithUnit sets the unit of a metric. See NewBytesHistogramDef for an example.

Directories

Path Synopsis
tally

Jump to

Keyboard shortcuts

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