metrics

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: MIT Imports: 6 Imported by: 49

Documentation

Index

Constants

View Source
const (
	Common = iota
	Frontend
	History
	Matching
	NumServices
)

Service names for all services that emit metrics.

View Source
const (
	HostnameTagName  = "hostname"
	OperationTagName = "operation"
	// ShardTagName is temporary until we can get all metric data removed for the service
	ShardTagName = "shard"
)

Common tags for all services

View Source
const (
	UnknownDirectoryTagValue = "Unknown"
	AllShardsTagValue        = "ALL"
	NoneShardsTagValue       = "NONE"
)

This package should hold all the metrics and tags for cadence

View Source
const (
	RestartCount         = "restarts"
	NumGoRoutinesGauge   = "num-goroutines"
	GoMaxProcsGauge      = "gomaxprocs"
	MemoryAllocatedGauge = "memory.allocated"
	MemoryHeapGauge      = "memory.heap"
	MemoryHeapIdleGauge  = "memory.heapidle"
	MemoryHeapInuseGauge = "memory.heapinuse"
	MemoryStackGauge     = "memory.stack"
	NumGCCounter         = "memory.num-gc"
	GcPauseMsTimer       = "memory.gc-pause-ms"
)

Common service base metrics

View Source
const (

	// PersistenceCreateShardScope tracks CreateShard calls made by service to persistence layer
	PersistenceCreateShardScope = iota
	// PersistenceGetShardScope tracks GetShard calls made by service to persistence layer
	PersistenceGetShardScope
	// PersistenceUpdateShardScope tracks UpdateShard calls made by service to persistence layer
	PersistenceUpdateShardScope
	// PersistenceCreateWorkflowExecutionScope tracks CreateWorkflowExecution calls made by service to persistence layer
	PersistenceCreateWorkflowExecutionScope
	// PersistenceGetWorkflowExecutionScope tracks GetWorkflowExecution calls made by service to persistence layer
	PersistenceGetWorkflowExecutionScope
	// PersistenceUpdateWorkflowExecutionScope tracks UpdateWorkflowExecution calls made by service to persistence layer
	PersistenceUpdateWorkflowExecutionScope
	// PersistenceDeleteWorkflowExecutionScope tracks DeleteWorkflowExecution calls made by service to persistence layer
	PersistenceDeleteWorkflowExecutionScope
	// PersistenceGetCurrentExecutionScope tracks GetCurrentExecution calls made by service to persistence layer
	PersistenceGetCurrentExecutionScope
	// PersistenceGetTransferTasksScope tracks GetTransferTasks calls made by service to persistence layer
	PersistenceGetTransferTasksScope
	// PersistenceCompleteTransferTaskScope tracks CompleteTransferTasks calls made by service to persistence layer
	PersistenceCompleteTransferTaskScope
	// PersistenceGetTimerIndexTasksScope tracks GetTimerIndexTasks calls made by service to persistence layer
	PersistenceGetTimerIndexTasksScope
	// PersistenceCompleteTimerTaskScope tracks CompleteTimerTasks calls made by service to persistence layer
	PersistenceCompleteTimerTaskScope
	// PersistenceCreateTaskScope tracks CreateTask calls made by service to persistence layer
	PersistenceCreateTaskScope
	// PersistenceGetTasksScope tracks GetTasks calls made by service to persistence layer
	PersistenceGetTasksScope
	// PersistenceCompleteTaskScope tracks CompleteTask calls made by service to persistence layer
	PersistenceCompleteTaskScope
	// PersistenceLeaseTaskListScope tracks LeaseTaskList calls made by service to persistence layer
	PersistenceLeaseTaskListScope
	// PersistenceUpdateTaskListScope tracks PersistenceUpdateTaskListScope calls made by service to persistence layer
	PersistenceUpdateTaskListScope
	// PersistenceAppendHistoryEventsScope tracks AppendHistoryEvents calls made by service to persistence layer
	PersistenceAppendHistoryEventsScope
	// PersistenceGetWorkflowExecutionHistoryScope tracks GetWorkflowExecutionHistory calls made by service to persistence layer
	PersistenceGetWorkflowExecutionHistoryScope
	// PersistenceDeleteWorkflowExecutionHistoryScope tracks DeleteWorkflowExecutionHistory calls made by service to persistence layer
	PersistenceDeleteWorkflowExecutionHistoryScope
	// PersistenceCreateDomainScope tracks CreateDomain calls made by service to persistence layer
	PersistenceCreateDomainScope
	// PersistenceGetDomainScope tracks GetDomain calls made by service to persistence layer
	PersistenceGetDomainScope
	// PersistenceUpdateDomainScope tracks UpdateDomain calls made by service to persistence layer
	PersistenceUpdateDomainScope
	// PersistenceDeleteDomainScope tracks DeleteDomain calls made by service to persistence layer
	PersistenceDeleteDomainScope
	// PersistenceDeleteDomainByNameScope tracks DeleteDomainByName calls made by service to persistence layer
	PersistenceDeleteDomainByNameScope
	// PersistenceRecordWorkflowExecutionStartedScope tracks RecordWorkflowExecutionStarted calls made by service to persistence layer
	PersistenceRecordWorkflowExecutionStartedScope
	// PersistenceRecordWorkflowExecutionClosedScope tracks RecordWorkflowExecutionClosed calls made by service to persistence layer
	PersistenceRecordWorkflowExecutionClosedScope
	// PersistenceListOpenWorkflowExecutionsScope tracks ListOpenWorkflowExecutions calls made by service to persistence layer
	PersistenceListOpenWorkflowExecutionsScope
	// PersistenceListClosedWorkflowExecutionsScope tracks ListClosedWorkflowExecutions calls made by service to persistence layer
	PersistenceListClosedWorkflowExecutionsScope
	// PersistenceListOpenWorkflowExecutionsByTypeScope tracks ListOpenWorkflowExecutionsByType calls made by service to persistence layer
	PersistenceListOpenWorkflowExecutionsByTypeScope
	// PersistenceListClosedWorkflowExecutionsByTypeScope tracks ListClosedWorkflowExecutionsByType calls made by service to persistence layer
	PersistenceListClosedWorkflowExecutionsByTypeScope
	// PersistenceListOpenWorkflowExecutionsByWorkflowIDScope tracks ListOpenWorkflowExecutionsByWorkflowID calls made by service to persistence layer
	PersistenceListOpenWorkflowExecutionsByWorkflowIDScope
	// PersistenceListClosedWorkflowExecutionsByWorkflowIDScope tracks ListClosedWorkflowExecutionsByWorkflowID calls made by service to persistence layer
	PersistenceListClosedWorkflowExecutionsByWorkflowIDScope
	// PersistenceListClosedWorkflowExecutionsByStatusScope tracks ListClosedWorkflowExecutionsByStatus calls made by service to persistence layer
	PersistenceListClosedWorkflowExecutionsByStatusScope
	// PersistenceGetClosedWorkflowExecutionScope tracks GetClosedWorkflowExecution calls made by service to persistence layer
	PersistenceGetClosedWorkflowExecutionScope
	// HistoryClientStartWorkflowExecutionScope tracks RPC calls to history service
	HistoryClientStartWorkflowExecutionScope
	// HistoryClientRecordActivityTaskHeartbeatScope tracks RPC calls to history service
	HistoryClientRecordActivityTaskHeartbeatScope
	// HistoryClientRespondDecisionTaskCompletedScope tracks RPC calls to history service
	HistoryClientRespondDecisionTaskCompletedScope
	// HistoryClientRespondDecisionTaskFailedScope tracks RPC calls to history service
	HistoryClientRespondDecisionTaskFailedScope
	// HistoryClientRespondActivityTaskCompletedScope tracks RPC calls to history service
	HistoryClientRespondActivityTaskCompletedScope
	// HistoryClientRespondActivityTaskFailedScope tracks RPC calls to history service
	HistoryClientRespondActivityTaskFailedScope
	// HistoryClientRespondActivityTaskCanceledScope tracks RPC calls to history service
	HistoryClientRespondActivityTaskCanceledScope
	// HistoryClientGetMutableStateScope tracks RPC calls to history service
	HistoryClientGetMutableStateScope
	// HistoryClientDescribeWorkflowExecutionScope tracks RPC calls to history service
	HistoryClientDescribeWorkflowExecutionScope
	// HistoryClientRecordDecisionTaskStartedScope tracks RPC calls to history service
	HistoryClientRecordDecisionTaskStartedScope
	// HistoryClientRecordActivityTaskStartedScope tracks RPC calls to history service
	HistoryClientRecordActivityTaskStartedScope
	// HistoryClientRequestCancelWorkflowExecutionScope tracks RPC calls to history service
	HistoryClientRequestCancelWorkflowExecutionScope
	// HistoryClientSignalWorkflowExecutionScope tracks RPC calls to history service
	HistoryClientSignalWorkflowExecutionScope
	// HistoryClientRemoveSignalMutableStateScope tracks RPC calls to history service
	HistoryClientRemoveSignalMutableStateScope
	// HistoryClientTerminateWorkflowExecutionScope tracks RPC calls to history service
	HistoryClientTerminateWorkflowExecutionScope
	// HistoryClientScheduleDecisionTaskScope tracks RPC calls to history service
	HistoryClientScheduleDecisionTaskScope
	// HistoryClientRecordChildExecutionCompletedScope tracks RPC calls to history service
	HistoryClientRecordChildExecutionCompletedScope
	// MatchingClientPollForDecisionTaskScope tracks RPC calls to matching service
	MatchingClientPollForDecisionTaskScope
	// MatchingClientPollForActivityTaskScope tracks RPC calls to matching service
	MatchingClientPollForActivityTaskScope
	// MatchingClientAddActivityTaskScope tracks RPC calls to matching service
	MatchingClientAddActivityTaskScope
	// MatchingClientAddDecisionTaskScope tracks RPC calls to matching service
	MatchingClientAddDecisionTaskScope
	// MatchingClientQueryWorkflowScope tracks RPC calls to matching service
	MatchingClientQueryWorkflowScope
	// MatchingClientRespondQueryTaskCompletedScope tracks RPC calls to matching service
	MatchingClientRespondQueryTaskCompletedScope
	// MatchingClientCancelOutstandingPollScope tracks RPC calls to matching service
	MatchingClientCancelOutstandingPollScope
	// MatchingClientDescribeTaskListScope tracks RPC calls to matching service
	MatchingClientDescribeTaskListScope

	NumCommonScopes
)

Scopes enum

View Source
const (
	// FrontendStartWorkflowExecutionScope is the metric scope for frontend.StartWorkflowExecution
	FrontendStartWorkflowExecutionScope = iota + NumCommonScopes
	// PollForDecisionTaskScope is the metric scope for frontend.PollForDecisionTask
	FrontendPollForDecisionTaskScope
	// FrontendPollForActivityTaskScope is the metric scope for frontend.PollForActivityTask
	FrontendPollForActivityTaskScope
	// FrontendRecordActivityTaskHeartbeatScope is the metric scope for frontend.RecordActivityTaskHeartbeat
	FrontendRecordActivityTaskHeartbeatScope
	// FrontendRespondDecisionTaskCompletedScope is the metric scope for frontend.RespondDecisionTaskCompleted
	FrontendRespondDecisionTaskCompletedScope
	// FrontendRespondDecisionTaskFailedScope is the metric scope for frontend.RespondDecisionTaskFailed
	FrontendRespondDecisionTaskFailedScope
	// FrontendRespondQueryTaskCompletedScope is the metric scope for frontend.RespondQueryTaskCompleted
	FrontendRespondQueryTaskCompletedScope
	// FrontendRespondActivityTaskCompletedScope is the metric scope for frontend.RespondActivityTaskCompleted
	FrontendRespondActivityTaskCompletedScope
	// FrontendRespondActivityTaskFailedScope is the metric scope for frontend.RespondActivityTaskFailed
	FrontendRespondActivityTaskFailedScope
	// FrontendRespondActivityTaskCanceledScope is the metric scope for frontend.RespondActivityTaskCanceled
	FrontendRespondActivityTaskCanceledScope
	// FrontendRespondActivityTaskCompletedScope is the metric scope for frontend.RespondActivityTaskCompletedByID
	FrontendRespondActivityTaskCompletedByIDScope
	// FrontendRespondActivityTaskFailedScope is the metric scope for frontend.RespondActivityTaskFailedByID
	FrontendRespondActivityTaskFailedByIDScope
	// FrontendRespondActivityTaskCanceledScope is the metric scope for frontend.RespondActivityTaskCanceledByID
	FrontendRespondActivityTaskCanceledByIDScope
	// FrontendGetWorkflowExecutionHistoryScope is the metric scope for frontend.GetWorkflowExecutionHistory
	FrontendGetWorkflowExecutionHistoryScope
	// FrontendSignalWorkflowExecutionScope is the metric scope for frontend.SignalWorkflowExecution
	FrontendSignalWorkflowExecutionScope
	// FrontendTerminateWorkflowExecutionScope is the metric scope for frontend.TerminateWorkflowExecution
	FrontendTerminateWorkflowExecutionScope
	// FrontendRequestCancelWorkflowExecutionScope is the metric scope for frontend.RequestCancelWorkflowExecution
	FrontendRequestCancelWorkflowExecutionScope
	// FrontendListOpenWorkflowExecutionsScope is the metric scope for frontend.ListOpenWorkflowExecutions
	FrontendListOpenWorkflowExecutionsScope
	// FrontendListClosedWorkflowExecutionsScope is the metric scope for frontend.ListClosedWorkflowExecutions
	FrontendListClosedWorkflowExecutionsScope
	// FrontendRegisterDomainScope is the metric scope for frontend.RegisterDomain
	FrontendRegisterDomainScope
	// FrontendDescribeDomainScope is the metric scope for frontend.DescribeDomain
	FrontendDescribeDomainScope
	// FrontendUpdateDomainScope is the metric scope for frontend.DescribeDomain
	FrontendUpdateDomainScope
	// FrontendDeprecateDomainScope is the metric scope for frontend.DeprecateDomain
	FrontendDeprecateDomainScope
	// FrontendQueryWorkflowScope is the metric scope for frontend.QueryWorkflow
	FrontendQueryWorkflowScope
	// FrontendDescribeWorkflowExecutionScope is the metric scope for frontend.DescribeWorkflowExecution
	FrontendDescribeWorkflowExecutionScope
	// FrontendDescribeTaskListScope is the metric scope for frontend.DescribeTaskList
	FrontendDescribeTaskListScope

	NumFrontendScopes
)

-- Operation scopes for Frontend service --

View Source
const (
	// HistoryStartWorkflowExecutionScope tracks StartWorkflowExecution API calls received by service
	HistoryStartWorkflowExecutionScope = iota + NumCommonScopes
	// HistoryRecordActivityTaskHeartbeatScope tracks RecordActivityTaskHeartbeat API calls received by service
	HistoryRecordActivityTaskHeartbeatScope
	// HistoryRespondDecisionTaskCompletedScope tracks RespondDecisionTaskCompleted API calls received by service
	HistoryRespondDecisionTaskCompletedScope
	// HistoryRespondDecisionTaskFailedScope tracks RespondDecisionTaskFailed API calls received by service
	HistoryRespondDecisionTaskFailedScope
	// HistoryRespondActivityTaskCompletedScope tracks RespondActivityTaskCompleted API calls received by service
	HistoryRespondActivityTaskCompletedScope
	// HistoryRespondActivityTaskFailedScope tracks RespondActivityTaskFailed API calls received by service
	HistoryRespondActivityTaskFailedScope
	// HistoryRespondActivityTaskCanceledScope tracks RespondActivityTaskCanceled API calls received by service
	HistoryRespondActivityTaskCanceledScope
	// HistoryGetMutableStateScope tracks GetWorkflowExecutionHistory API calls received by service
	HistoryGetMutableStateScope
	// HistoryDescribeWorkflowExecutionScope tracks DescribeWorkflowExecution API calls received by service
	HistoryDescribeWorkflowExecutionScope
	// HistoryRecordDecisionTaskStartedScope tracks RecordDecisionTaskStarted API calls received by service
	HistoryRecordDecisionTaskStartedScope
	// HistoryRecordActivityTaskStartedScope tracks RecordActivityTaskStarted API calls received by service
	HistoryRecordActivityTaskStartedScope
	// HistorySignalWorkflowExecutionScope tracks SignalWorkflowExecution API calls received by service
	HistorySignalWorkflowExecutionScope
	// HistoryRemoveSignalMutableStateScope tracks RemoveSignalMutableState API calls received by service
	HistoryRemoveSignalMutableStateScope
	// HistoryTerminateWorkflowExecutionScope tracks TerminateWorkflowExecution API calls received by service
	HistoryTerminateWorkflowExecutionScope
	// HistoryScheduleDecisionTaskScope tracks ScheduleDecisionTask API calls received by service
	HistoryScheduleDecisionTaskScope
	// HistoryRecordChildExecutionCompletedScope tracks CompleteChildExecution API calls received by service
	HistoryRecordChildExecutionCompletedScope
	// HistoryRequestCancelWorkflowExecutionScope tracks RequestCancelWorkflowExecution API calls received by service
	HistoryRequestCancelWorkflowExecutionScope
	// HistoryShardControllerScope is the scope used by shard controller
	HistoryShardControllerScope
	// TransferQueueProcessorScope is the scope used by all metric emitted by transfer queue processor
	TransferQueueProcessorScope
	// TransferTaskActivityScope is the scope used for activity task processing by transfer queue processor
	TransferTaskActivityScope
	// TransferTaskDecisionScope is the scope used for decision task processing by transfer queue processor
	TransferTaskDecisionScope
	// TransferTaskCloseExecutionScope is the scope used for close execution task processing by transfer queue processor
	TransferTaskCloseExecutionScope
	// TransferTaskCancelExecutionScope is the scope used for cancel execution task processing by transfer queue processor
	TransferTaskCancelExecutionScope
	// TransferTaskSignalExecutionScope is the scope used for signal execution task processing by transfer queue processor
	TransferTaskSignalExecutionScope
	// TransferTaskStartChildExecutionScope is the scope used for start child execution task processing by transfer queue processor
	TransferTaskStartChildExecutionScope
	// TimerQueueProcessorScope is the scope used by all metric emitted by timer queue processor
	TimerQueueProcessorScope
	// TimerTaskActivityTimeoutScope is the scope used by metric emitted by timer queue processor for processing activity timeouts
	TimerTaskActivityTimeoutScope
	// TimerTaskDecisionTimeoutScope is the scope used by metric emitted by timer queue processor for processing decision timeouts
	TimerTaskDecisionTimeoutScope
	// TimerTaskUserTimerScope is the scope used by metric emitted by timer queue processor for processing user timers
	TimerTaskUserTimerScope
	// TimerTaskWorkflowTimeoutScope is the scope used by metric emitted by timer queue processor for processing workflow timeouts.
	TimerTaskWorkflowTimeoutScope
	// TimerTaskDeleteHistoryEvent is the scope used by metric emitted by timer queue processor for processing history event cleanup
	TimerTaskDeleteHistoryEvent
	// HistoryEventNotificationScope is the scope used by shard history event nitification
	HistoryEventNotificationScope

	NumHistoryScopes
)

-- Operation scopes for History service --

View Source
const (
	// PollForDecisionTaskScope tracks PollForDecisionTask API calls received by service
	MatchingPollForDecisionTaskScope = iota + NumCommonScopes
	// PollForActivityTaskScope tracks PollForActivityTask API calls received by service
	MatchingPollForActivityTaskScope
	// MatchingAddActivityTaskScope tracks AddActivityTask API calls received by service
	MatchingAddActivityTaskScope
	// MatchingAddDecisionTaskScope tracks AddDecisionTask API calls received by service
	MatchingAddDecisionTaskScope
	// MatchingTaskListMgrScope is the metrics scope for matching.TaskListManager component
	MatchingTaskListMgrScope
	// MatchingQueryWorkflowScope tracks AddDecisionTask API calls received by service
	MatchingQueryWorkflowScope
	// MatchingRespondQueryTaskCompletedScope tracks AddDecisionTask API calls received by service
	MatchingRespondQueryTaskCompletedScope
	// MatchingCancelOutstandingPollScope tracks CancelOutstandingPoll API calls received by service
	MatchingCancelOutstandingPollScope
	// MatchingDescribeTaskListScope tracks DescribeTaskList API calls received by service
	MatchingDescribeTaskListScope

	NumMatchingScopes
)

-- Operation scopes for Matching service --

View Source
const (
	CadenceRequests = iota
	CadenceFailures
	CadenceLatency
	CadenceErrBadRequestCounter
	CadenceErrServiceBusyCounter
	CadenceErrEntityNotExistsCounter
	CadenceErrExecutionAlreadyStartedCounter
	CadenceErrDomainAlreadyExistsCounter
	CadenceErrCancellationAlreadyRequestedCounter
	CadenceErrQueryFailedCounter
	PersistenceRequests
	PersistenceFailures
	PersistenceLatency
	PersistenceErrShardExistsCounter
	PersistenceErrShardOwnershipLostCounter
	PersistenceErrConditionFailedCounter
	PersistenceErrTimeoutCounter
	PersistenceErrBusyCounter

	HistoryClientFailures
	MatchingClientFailures

	NumCommonMetrics // Needs to be last on this list for iota numbering
)

Common Metrics enum

View Source
const (
	TaskRequests = iota + NumCommonMetrics
	TaskFailures
	TaskLatency
	AckLevelUpdateCounter
	AckLevelUpdateFailedCounter
	DecisionTypeScheduleActivityCounter
	DecisionTypeCompleteWorkflowCounter
	DecisionTypeFailWorkflowCounter
	DecisionTypeCancelWorkflowCounter
	DecisionTypeStartTimerCounter
	DecisionTypeCancelActivityCounter
	DecisionTypeCancelTimerCounter
	DecisionTypeRecordMarkerCounter
	DecisionTypeCancelExternalWorkflowCounter
	DecisionTypeChildWorkflowCounter
	DecisionTypeContinueAsNewCounter
	DecisionTypeSignalExternalWorkflowCounter
	MultipleCompletionDecisionsCounter
	FailedDecisionsCounter
	StaleMutableStateCounter
	ConcurrencyUpdateFailureCounter
	CadenceErrEventAlreadyStartedCounter
	CadenceErrShardOwnershipLostCounter
	HeartbeatTimeoutCounter
	ScheduleToStartTimeoutCounter
	StartToCloseTimeoutCounter
	ScheduleToCloseTimeoutCounter
	NewTimerCounter
	NewTimerNotifyCounter
	AcquireShardsCounter
	AcquireShardsLatency
	ShardClosedCounter
	ShardItemCreatedCounter
	ShardItemRemovedCounter
	MembershipChangedCounter
	NumShardsGauge
	GetEngineForShardErrorCounter
	GetEngineForShardLatency
	RemoveEngineForShardLatency
	CompleteDecisionWithStickyEnabledCounter
	CompleteDecisionWithStickyDisabledCounter
	HistoryEventNotificationQueueingLatency
	HistoryEventNotificationFanoutLatency
	HistoryEventNotificationInFlightMessageGauge
	HistoryEventNotificationFailDeliveryCount
)

History Metrics enum

View Source
const (
	PollSuccessCounter = iota + NumCommonMetrics
	PollTimeoutCounter
	PollSuccessWithSyncCounter
	LeaseRequestCounter
	LeaseFailureCounter
	ConditionFailedErrorCounter
	RespondQueryTaskFailedCounter
	SyncThrottleCounter
	BufferThrottleCounter
)

Matching metrics enum

View Source
const (
	// NoError indicates that there is no error (error should be nil)
	NoError = ErrorClass(iota)
	// UserError indicates that this is NOT an SLA-reportable error
	UserError
	// InternalError indicates that this is an SLA-reportable error
	InternalError
)

Variables

GoRuntimeMetrics represent the runtime stats from go runtime

View Source
var MetricDefs = map[ServiceIdx]map[int]metricDefinition{
	Common: {
		CadenceRequests:                               {/* contains filtered or unexported fields */},
		CadenceFailures:                               {/* contains filtered or unexported fields */},
		CadenceLatency:                                {/* contains filtered or unexported fields */},
		CadenceErrBadRequestCounter:                   {/* contains filtered or unexported fields */},
		CadenceErrServiceBusyCounter:                  {/* contains filtered or unexported fields */},
		CadenceErrEntityNotExistsCounter:              {/* contains filtered or unexported fields */},
		CadenceErrExecutionAlreadyStartedCounter:      {/* contains filtered or unexported fields */},
		CadenceErrDomainAlreadyExistsCounter:          {/* contains filtered or unexported fields */},
		CadenceErrCancellationAlreadyRequestedCounter: {/* contains filtered or unexported fields */},
		CadenceErrQueryFailedCounter:                  {/* contains filtered or unexported fields */},
		PersistenceRequests:                           {/* contains filtered or unexported fields */},
		PersistenceFailures:                           {/* contains filtered or unexported fields */},
		PersistenceLatency:                            {/* contains filtered or unexported fields */},
		PersistenceErrShardExistsCounter:              {/* contains filtered or unexported fields */},
		PersistenceErrShardOwnershipLostCounter:       {/* contains filtered or unexported fields */},
		PersistenceErrConditionFailedCounter:          {/* contains filtered or unexported fields */},
		PersistenceErrTimeoutCounter:                  {/* contains filtered or unexported fields */},
		PersistenceErrBusyCounter:                     {/* contains filtered or unexported fields */},
		HistoryClientFailures:                         {/* contains filtered or unexported fields */},
		MatchingClientFailures:                        {/* contains filtered or unexported fields */},
	},
	Frontend: {},
	History: {
		TaskRequests:                                 {/* contains filtered or unexported fields */},
		TaskFailures:                                 {/* contains filtered or unexported fields */},
		TaskLatency:                                  {/* contains filtered or unexported fields */},
		AckLevelUpdateCounter:                        {/* contains filtered or unexported fields */},
		AckLevelUpdateFailedCounter:                  {/* contains filtered or unexported fields */},
		DecisionTypeScheduleActivityCounter:          {/* contains filtered or unexported fields */},
		DecisionTypeCompleteWorkflowCounter:          {/* contains filtered or unexported fields */},
		DecisionTypeFailWorkflowCounter:              {/* contains filtered or unexported fields */},
		DecisionTypeCancelWorkflowCounter:            {/* contains filtered or unexported fields */},
		DecisionTypeStartTimerCounter:                {/* contains filtered or unexported fields */},
		DecisionTypeCancelActivityCounter:            {/* contains filtered or unexported fields */},
		DecisionTypeCancelTimerCounter:               {/* contains filtered or unexported fields */},
		DecisionTypeRecordMarkerCounter:              {/* contains filtered or unexported fields */},
		DecisionTypeCancelExternalWorkflowCounter:    {/* contains filtered or unexported fields */},
		DecisionTypeContinueAsNewCounter:             {/* contains filtered or unexported fields */},
		DecisionTypeChildWorkflowCounter:             {/* contains filtered or unexported fields */},
		MultipleCompletionDecisionsCounter:           {/* contains filtered or unexported fields */},
		FailedDecisionsCounter:                       {/* contains filtered or unexported fields */},
		StaleMutableStateCounter:                     {/* contains filtered or unexported fields */},
		ConcurrencyUpdateFailureCounter:              {/* contains filtered or unexported fields */},
		CadenceErrShardOwnershipLostCounter:          {/* contains filtered or unexported fields */},
		CadenceErrEventAlreadyStartedCounter:         {/* contains filtered or unexported fields */},
		HeartbeatTimeoutCounter:                      {/* contains filtered or unexported fields */},
		ScheduleToStartTimeoutCounter:                {/* contains filtered or unexported fields */},
		StartToCloseTimeoutCounter:                   {/* contains filtered or unexported fields */},
		ScheduleToCloseTimeoutCounter:                {/* contains filtered or unexported fields */},
		NewTimerCounter:                              {/* contains filtered or unexported fields */},
		NewTimerNotifyCounter:                        {/* contains filtered or unexported fields */},
		AcquireShardsCounter:                         {/* contains filtered or unexported fields */},
		AcquireShardsLatency:                         {/* contains filtered or unexported fields */},
		ShardClosedCounter:                           {/* contains filtered or unexported fields */},
		ShardItemCreatedCounter:                      {/* contains filtered or unexported fields */},
		ShardItemRemovedCounter:                      {/* contains filtered or unexported fields */},
		MembershipChangedCounter:                     {/* contains filtered or unexported fields */},
		NumShardsGauge:                               {/* contains filtered or unexported fields */},
		GetEngineForShardErrorCounter:                {/* contains filtered or unexported fields */},
		GetEngineForShardLatency:                     {/* contains filtered or unexported fields */},
		RemoveEngineForShardLatency:                  {/* contains filtered or unexported fields */},
		CompleteDecisionWithStickyEnabledCounter:     {/* contains filtered or unexported fields */},
		CompleteDecisionWithStickyDisabledCounter:    {/* contains filtered or unexported fields */},
		HistoryEventNotificationQueueingLatency:      {/* contains filtered or unexported fields */},
		HistoryEventNotificationFanoutLatency:        {/* contains filtered or unexported fields */},
		HistoryEventNotificationInFlightMessageGauge: {/* contains filtered or unexported fields */},
		HistoryEventNotificationFailDeliveryCount:    {/* contains filtered or unexported fields */},
	},
	Matching: {
		PollSuccessCounter:            {/* contains filtered or unexported fields */},
		PollTimeoutCounter:            {/* contains filtered or unexported fields */},
		PollSuccessWithSyncCounter:    {/* contains filtered or unexported fields */},
		LeaseRequestCounter:           {/* contains filtered or unexported fields */},
		LeaseFailureCounter:           {/* contains filtered or unexported fields */},
		ConditionFailedErrorCounter:   {/* contains filtered or unexported fields */},
		RespondQueryTaskFailedCounter: {/* contains filtered or unexported fields */},
		SyncThrottleCounter:           {/* contains filtered or unexported fields */},
		BufferThrottleCounter:         {/* contains filtered or unexported fields */},
	},
}

MetricDefs record the metrics for all services

View Source
var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{

	Common: {
		PersistenceCreateShardScope:                              {/* contains filtered or unexported fields */},
		PersistenceGetShardScope:                                 {/* contains filtered or unexported fields */},
		PersistenceUpdateShardScope:                              {/* contains filtered or unexported fields */},
		PersistenceCreateWorkflowExecutionScope:                  {/* contains filtered or unexported fields */},
		PersistenceGetWorkflowExecutionScope:                     {/* contains filtered or unexported fields */},
		PersistenceUpdateWorkflowExecutionScope:                  {/* contains filtered or unexported fields */},
		PersistenceDeleteWorkflowExecutionScope:                  {/* contains filtered or unexported fields */},
		PersistenceGetCurrentExecutionScope:                      {/* contains filtered or unexported fields */},
		PersistenceGetTransferTasksScope:                         {/* contains filtered or unexported fields */},
		PersistenceCompleteTransferTaskScope:                     {/* contains filtered or unexported fields */},
		PersistenceGetTimerIndexTasksScope:                       {/* contains filtered or unexported fields */},
		PersistenceCompleteTimerTaskScope:                        {/* contains filtered or unexported fields */},
		PersistenceCreateTaskScope:                               {/* contains filtered or unexported fields */},
		PersistenceGetTasksScope:                                 {/* contains filtered or unexported fields */},
		PersistenceCompleteTaskScope:                             {/* contains filtered or unexported fields */},
		PersistenceLeaseTaskListScope:                            {/* contains filtered or unexported fields */},
		PersistenceUpdateTaskListScope:                           {/* contains filtered or unexported fields */},
		PersistenceAppendHistoryEventsScope:                      {/* contains filtered or unexported fields */},
		PersistenceGetWorkflowExecutionHistoryScope:              {/* contains filtered or unexported fields */},
		PersistenceDeleteWorkflowExecutionHistoryScope:           {/* contains filtered or unexported fields */},
		PersistenceCreateDomainScope:                             {/* contains filtered or unexported fields */},
		PersistenceGetDomainScope:                                {/* contains filtered or unexported fields */},
		PersistenceUpdateDomainScope:                             {/* contains filtered or unexported fields */},
		PersistenceDeleteDomainScope:                             {/* contains filtered or unexported fields */},
		PersistenceDeleteDomainByNameScope:                       {/* contains filtered or unexported fields */},
		PersistenceRecordWorkflowExecutionStartedScope:           {/* contains filtered or unexported fields */},
		PersistenceRecordWorkflowExecutionClosedScope:            {/* contains filtered or unexported fields */},
		PersistenceListOpenWorkflowExecutionsScope:               {/* contains filtered or unexported fields */},
		PersistenceListClosedWorkflowExecutionsScope:             {/* contains filtered or unexported fields */},
		PersistenceListOpenWorkflowExecutionsByTypeScope:         {/* contains filtered or unexported fields */},
		PersistenceListClosedWorkflowExecutionsByTypeScope:       {/* contains filtered or unexported fields */},
		PersistenceListOpenWorkflowExecutionsByWorkflowIDScope:   {/* contains filtered or unexported fields */},
		PersistenceListClosedWorkflowExecutionsByWorkflowIDScope: {/* contains filtered or unexported fields */},
		PersistenceListClosedWorkflowExecutionsByStatusScope:     {/* contains filtered or unexported fields */},
		PersistenceGetClosedWorkflowExecutionScope:               {/* contains filtered or unexported fields */},

		HistoryClientStartWorkflowExecutionScope:         {/* contains filtered or unexported fields */},
		HistoryClientRecordActivityTaskHeartbeatScope:    {/* contains filtered or unexported fields */},
		HistoryClientRespondDecisionTaskCompletedScope:   {/* contains filtered or unexported fields */},
		HistoryClientRespondDecisionTaskFailedScope:      {/* contains filtered or unexported fields */},
		HistoryClientRespondActivityTaskCompletedScope:   {/* contains filtered or unexported fields */},
		HistoryClientRespondActivityTaskFailedScope:      {/* contains filtered or unexported fields */},
		HistoryClientRespondActivityTaskCanceledScope:    {/* contains filtered or unexported fields */},
		HistoryClientGetMutableStateScope:                {/* contains filtered or unexported fields */},
		HistoryClientDescribeWorkflowExecutionScope:      {/* contains filtered or unexported fields */},
		HistoryClientRecordDecisionTaskStartedScope:      {/* contains filtered or unexported fields */},
		HistoryClientRecordActivityTaskStartedScope:      {/* contains filtered or unexported fields */},
		HistoryClientRequestCancelWorkflowExecutionScope: {/* contains filtered or unexported fields */},
		HistoryClientSignalWorkflowExecutionScope:        {/* contains filtered or unexported fields */},
		HistoryClientRemoveSignalMutableStateScope:       {/* contains filtered or unexported fields */},
		HistoryClientTerminateWorkflowExecutionScope:     {/* contains filtered or unexported fields */},
		HistoryClientScheduleDecisionTaskScope:           {/* contains filtered or unexported fields */},
		HistoryClientRecordChildExecutionCompletedScope:  {/* contains filtered or unexported fields */},
		MatchingClientPollForDecisionTaskScope:           {/* contains filtered or unexported fields */},
		MatchingClientPollForActivityTaskScope:           {/* contains filtered or unexported fields */},
		MatchingClientAddActivityTaskScope:               {/* contains filtered or unexported fields */},
		MatchingClientAddDecisionTaskScope:               {/* contains filtered or unexported fields */},
		MatchingClientQueryWorkflowScope:                 {/* contains filtered or unexported fields */},
		MatchingClientRespondQueryTaskCompletedScope:     {/* contains filtered or unexported fields */},
		MatchingClientCancelOutstandingPollScope:         {/* contains filtered or unexported fields */},
		MatchingClientDescribeTaskListScope:              {/* contains filtered or unexported fields */},
	},

	Frontend: {
		FrontendStartWorkflowExecutionScope:           {/* contains filtered or unexported fields */},
		FrontendPollForDecisionTaskScope:              {/* contains filtered or unexported fields */},
		FrontendPollForActivityTaskScope:              {/* contains filtered or unexported fields */},
		FrontendRecordActivityTaskHeartbeatScope:      {/* contains filtered or unexported fields */},
		FrontendRespondDecisionTaskCompletedScope:     {/* contains filtered or unexported fields */},
		FrontendRespondDecisionTaskFailedScope:        {/* contains filtered or unexported fields */},
		FrontendRespondQueryTaskCompletedScope:        {/* contains filtered or unexported fields */},
		FrontendRespondActivityTaskCompletedScope:     {/* contains filtered or unexported fields */},
		FrontendRespondActivityTaskFailedScope:        {/* contains filtered or unexported fields */},
		FrontendRespondActivityTaskCanceledScope:      {/* contains filtered or unexported fields */},
		FrontendRespondActivityTaskCompletedByIDScope: {/* contains filtered or unexported fields */},
		FrontendRespondActivityTaskFailedByIDScope:    {/* contains filtered or unexported fields */},
		FrontendRespondActivityTaskCanceledByIDScope:  {/* contains filtered or unexported fields */},
		FrontendGetWorkflowExecutionHistoryScope:      {/* contains filtered or unexported fields */},
		FrontendSignalWorkflowExecutionScope:          {/* contains filtered or unexported fields */},
		FrontendTerminateWorkflowExecutionScope:       {/* contains filtered or unexported fields */},
		FrontendRequestCancelWorkflowExecutionScope:   {/* contains filtered or unexported fields */},
		FrontendListOpenWorkflowExecutionsScope:       {/* contains filtered or unexported fields */},
		FrontendListClosedWorkflowExecutionsScope:     {/* contains filtered or unexported fields */},
		FrontendRegisterDomainScope:                   {/* contains filtered or unexported fields */},
		FrontendDescribeDomainScope:                   {/* contains filtered or unexported fields */},
		FrontendUpdateDomainScope:                     {/* contains filtered or unexported fields */},
		FrontendDeprecateDomainScope:                  {/* contains filtered or unexported fields */},
		FrontendQueryWorkflowScope:                    {/* contains filtered or unexported fields */},
		FrontendDescribeWorkflowExecutionScope:        {/* contains filtered or unexported fields */},
		FrontendDescribeTaskListScope:                 {/* contains filtered or unexported fields */},
	},

	History: {
		HistoryStartWorkflowExecutionScope:         {/* contains filtered or unexported fields */},
		HistoryRecordActivityTaskHeartbeatScope:    {/* contains filtered or unexported fields */},
		HistoryRespondDecisionTaskCompletedScope:   {/* contains filtered or unexported fields */},
		HistoryRespondDecisionTaskFailedScope:      {/* contains filtered or unexported fields */},
		HistoryRespondActivityTaskCompletedScope:   {/* contains filtered or unexported fields */},
		HistoryRespondActivityTaskFailedScope:      {/* contains filtered or unexported fields */},
		HistoryRespondActivityTaskCanceledScope:    {/* contains filtered or unexported fields */},
		HistoryGetMutableStateScope:                {/* contains filtered or unexported fields */},
		HistoryDescribeWorkflowExecutionScope:      {/* contains filtered or unexported fields */},
		HistoryRecordDecisionTaskStartedScope:      {/* contains filtered or unexported fields */},
		HistoryRecordActivityTaskStartedScope:      {/* contains filtered or unexported fields */},
		HistorySignalWorkflowExecutionScope:        {/* contains filtered or unexported fields */},
		HistoryRemoveSignalMutableStateScope:       {/* contains filtered or unexported fields */},
		HistoryTerminateWorkflowExecutionScope:     {/* contains filtered or unexported fields */},
		HistoryScheduleDecisionTaskScope:           {/* contains filtered or unexported fields */},
		HistoryRecordChildExecutionCompletedScope:  {/* contains filtered or unexported fields */},
		HistoryRequestCancelWorkflowExecutionScope: {/* contains filtered or unexported fields */},
		HistoryShardControllerScope:                {/* contains filtered or unexported fields */},
		TransferQueueProcessorScope:                {/* contains filtered or unexported fields */},
		TransferTaskActivityScope:                  {/* contains filtered or unexported fields */},
		TransferTaskDecisionScope:                  {/* contains filtered or unexported fields */},
		TransferTaskCloseExecutionScope:            {/* contains filtered or unexported fields */},
		TransferTaskCancelExecutionScope:           {/* contains filtered or unexported fields */},
		TransferTaskSignalExecutionScope:           {/* contains filtered or unexported fields */},
		TransferTaskStartChildExecutionScope:       {/* contains filtered or unexported fields */},
		TimerQueueProcessorScope:                   {/* contains filtered or unexported fields */},
		TimerTaskActivityTimeoutScope:              {/* contains filtered or unexported fields */},
		TimerTaskDecisionTimeoutScope:              {/* contains filtered or unexported fields */},
		TimerTaskUserTimerScope:                    {/* contains filtered or unexported fields */},
		TimerTaskWorkflowTimeoutScope:              {/* contains filtered or unexported fields */},
		TimerTaskDeleteHistoryEvent:                {/* contains filtered or unexported fields */},
		HistoryEventNotificationScope:              {/* contains filtered or unexported fields */},
	},

	Matching: {
		MatchingPollForDecisionTaskScope:       {/* contains filtered or unexported fields */},
		MatchingPollForActivityTaskScope:       {/* contains filtered or unexported fields */},
		MatchingAddActivityTaskScope:           {/* contains filtered or unexported fields */},
		MatchingAddDecisionTaskScope:           {/* contains filtered or unexported fields */},
		MatchingTaskListMgrScope:               {/* contains filtered or unexported fields */},
		MatchingQueryWorkflowScope:             {/* contains filtered or unexported fields */},
		MatchingRespondQueryTaskCompletedScope: {/* contains filtered or unexported fields */},
		MatchingCancelOutstandingPollScope:     {/* contains filtered or unexported fields */},
		MatchingDescribeTaskListScope:          {/* contains filtered or unexported fields */},
	},
}

ScopeDefs record the scopes for all services

View Source
var ServiceMetrics = map[MetricName]MetricType{
	RestartCount: Counter,
}

ServiceMetrics are types for common service base metrics

Functions

This section is empty.

Types

type Client

type Client interface {
	// IncCounter increments a counter metric
	IncCounter(scope int, counter int)
	// AddCounter adds delta to the counter metric
	AddCounter(scope int, counter int, delta int64)
	// StartTimer starts a timer for the given
	// metric name. Time will be recorded when stopwatch is stopped.
	StartTimer(scope int, timer int) tally.Stopwatch
	// RecordTimer starts a timer for the given
	// metric name
	RecordTimer(scope int, timer int, d time.Duration)
	// UpdateGauge reports Gauge type absolute value metric
	UpdateGauge(scope int, gauge int, value float64)
	// Tagged returns a client that adds the given tags to all metrics
	Tagged(tags map[string]string) Client
}

Client is the interface used to report metrics tally.

func NewClient

func NewClient(scope tally.Scope, serviceIdx ServiceIdx) Client

NewClient creates and returns a new instance of Client implementation reporter holds the common tags for the servcie serviceIdx indicates the service type in (InputhostIndex, ... StorageIndex)

type ClientImpl

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

ClientImpl is used for reporting metrics by various Cadence services

func (*ClientImpl) AddCounter

func (m *ClientImpl) AddCounter(scopeIdx int, counterIdx int, delta int64)

AddCounter adds delta to the counter and emits to the metrics backend

func (*ClientImpl) IncCounter

func (m *ClientImpl) IncCounter(scopeIdx int, counterIdx int)

IncCounter increments one for a counter and emits to metrics backend

func (*ClientImpl) RecordTimer

func (m *ClientImpl) RecordTimer(scopeIdx int, timerIdx int, d time.Duration)

RecordTimer record and emit a timer for the given metric name

func (*ClientImpl) StartTimer

func (m *ClientImpl) StartTimer(scopeIdx int, timerIdx int) tally.Stopwatch

StartTimer starts a timer for the given metric name

func (*ClientImpl) Tagged

func (m *ClientImpl) Tagged(tags map[string]string) Client

Tagged returns a client that adds the given tags to all metrics

func (*ClientImpl) UpdateGauge

func (m *ClientImpl) UpdateGauge(scopeIdx int, gaugeIdx int, value float64)

UpdateGauge reports Gauge type metric

type ErrorClass

type ErrorClass uint8

ErrorClass is an enum to help with classifying SLA vs. non-SLA errors (SLA = "service level agreement")

type MetricName

type MetricName string

MetricName is the name of the metric

type MetricType

type MetricType int

MetricType is the type of the metric

const (
	Counter MetricType = iota
	Timer
	Gauge
)

MetricTypes which are supported

type RuntimeMetricsReporter

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

RuntimeMetricsReporter A struct containing the state of the RuntimeMetricsReporter.

func NewRuntimeMetricsReporter

func NewRuntimeMetricsReporter(scope tally.Scope, reportInterval time.Duration, logger bark.Logger) *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 ServiceIdx

type ServiceIdx int

ServiceIdx is an index that uniquely identifies the service

Directories

Path Synopsis
tally

Jump to

Keyboard shortcuts

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