Documentation ¶
Index ¶
- Constants
- func ActivityTags(workflowType, activityType, taskQueueName string) map[string]string
- func LocalActivityTags(workflowType, activityType string) map[string]string
- func NewGRPCInterceptor(defaultHandler Handler, suffix string) grpc.UnaryClientInterceptor
- func PollerTags(pollerType string) map[string]string
- func RPCTags(workflowType, activityType, taskQueueName string) map[string]string
- func RootTags(namespace string) map[string]string
- func TaskQueueTags(taskQueue string) map[string]string
- func WorkerTags(workerType string) map[string]string
- func WorkflowTags(workflowType string) map[string]string
- type CapturedCounter
- type CapturedGauge
- type CapturedMetricMeta
- type CapturedTimer
- type CapturingHandler
- func (c *CapturingHandler) Clear()
- func (c *CapturingHandler) Counter(name string) Counter
- func (c *CapturingHandler) Counters() []*CapturedCounter
- func (c *CapturingHandler) Gauge(name string) Gauge
- func (c *CapturingHandler) Gauges() []*CapturedGauge
- func (c *CapturingHandler) Timer(name string) Timer
- func (c *CapturingHandler) Timers() []*CapturedTimer
- func (c *CapturingHandler) WithTags(tags map[string]string) Handler
- type Counter
- type CounterFunc
- type Gauge
- type GaugeFunc
- type Handler
- type HandlerContextKey
- type LongPollContextKey
- type Timer
- type TimerFunc
Constants ¶
const ( TemporalMetricsPrefix = "temporal_" WorkflowCompletedCounter = TemporalMetricsPrefix + "workflow_completed" WorkflowCanceledCounter = TemporalMetricsPrefix + "workflow_canceled" WorkflowFailedCounter = TemporalMetricsPrefix + "workflow_failed" WorkflowContinueAsNewCounter = TemporalMetricsPrefix + "workflow_continue_as_new" WorkflowEndToEndLatency = TemporalMetricsPrefix + "workflow_endtoend_latency" // measure workflow execution from start to close WorkflowTaskReplayLatency = TemporalMetricsPrefix + "workflow_task_replay_latency" WorkflowTaskQueuePollEmptyCounter = TemporalMetricsPrefix + "workflow_task_queue_poll_empty" WorkflowTaskQueuePollSucceedCounter = TemporalMetricsPrefix + "workflow_task_queue_poll_succeed" WorkflowTaskScheduleToStartLatency = TemporalMetricsPrefix + "workflow_task_schedule_to_start_latency" WorkflowTaskExecutionLatency = TemporalMetricsPrefix + "workflow_task_execution_latency" WorkflowTaskExecutionFailureCounter = TemporalMetricsPrefix + "workflow_task_execution_failed" WorkflowTaskNoCompletionCounter = TemporalMetricsPrefix + "workflow_task_no_completion" ActivityPollNoTaskCounter = TemporalMetricsPrefix + "activity_poll_no_task" ActivityScheduleToStartLatency = TemporalMetricsPrefix + "activity_schedule_to_start_latency" ActivityExecutionFailedCounter = TemporalMetricsPrefix + "activity_execution_failed" UnregisteredActivityInvocationCounter = TemporalMetricsPrefix + "unregistered_activity_invocation" ActivityExecutionLatency = TemporalMetricsPrefix + "activity_execution_latency" ActivitySucceedEndToEndLatency = TemporalMetricsPrefix + "activity_succeed_endtoend_latency" ActivityTaskErrorCounter = TemporalMetricsPrefix + "activity_task_error" LocalActivityTotalCounter = TemporalMetricsPrefix + "local_activity_total" LocalActivityCanceledCounter = TemporalMetricsPrefix + "local_activity_canceled" // Deprecated: Use LocalActivityExecutionCanceledCounter instead. LocalActivityExecutionCanceledCounter = TemporalMetricsPrefix + "local_activity_execution_cancelled" LocalActivityFailedCounter = TemporalMetricsPrefix + "local_activity_failed" // Deprecated: Use LocalActivityExecutionFailedCounter instead. LocalActivityExecutionFailedCounter = TemporalMetricsPrefix + "local_activity_execution_failed" LocalActivityErrorCounter = TemporalMetricsPrefix + "local_activity_error" LocalActivityExecutionLatency = TemporalMetricsPrefix + "local_activity_execution_latency" LocalActivitySucceedEndToEndLatency = TemporalMetricsPrefix + "local_activity_succeed_endtoend_latency" CorruptedSignalsCounter = TemporalMetricsPrefix + "corrupted_signals" WorkerStartCounter = TemporalMetricsPrefix + "worker_start" WorkerTaskSlotsAvailable = TemporalMetricsPrefix + "worker_task_slots_available" PollerStartCounter = TemporalMetricsPrefix + "poller_start" NumPoller = TemporalMetricsPrefix + "num_pollers" TemporalRequest = TemporalMetricsPrefix + "request" TemporalRequestFailure = TemporalRequest + "_failure" TemporalRequestLatency = TemporalRequest + "_latency" TemporalLongRequest = TemporalMetricsPrefix + "long_request" TemporalLongRequestFailure = TemporalLongRequest + "_failure" TemporalLongRequestLatency = TemporalLongRequest + "_latency" TemporalRequestResourceExhausted = TemporalRequest + "_resource_exhausted" TemporalLongRequestResourceExhausted = TemporalLongRequest + "_resource_exhausted" StickyCacheHit = TemporalMetricsPrefix + "sticky_cache_hit" StickyCacheMiss = TemporalMetricsPrefix + "sticky_cache_miss" StickyCacheTotalForcedEviction = TemporalMetricsPrefix + "sticky_cache_total_forced_eviction" StickyCacheSize = TemporalMetricsPrefix + "sticky_cache_size" WorkflowActiveThreadCount = TemporalMetricsPrefix + "workflow_active_thread_count" )
Metrics keys
const ( NamespaceTagName = "namespace" ClientTagName = "client_name" PollerTypeTagName = "poller_type" WorkerTypeTagName = "worker_type" WorkflowTypeNameTagName = "workflow_type" ActivityTypeNameTagName = "activity_type" TaskQueueTagName = "task_queue" OperationTagName = "operation" CauseTagName = "cause" )
Metric tag keys
const ( NoneTagValue = "none" ClientTagValue = "temporal_go" PollerTypeWorkflowTask = "workflow_task" PollerTypeWorkflowStickyTask = "workflow_sticky_task" PollerTypeActivityTask = "activity_task" )
Metric tag values
Variables ¶
This section is empty.
Functions ¶
func ActivityTags ¶
ActivityTags returns a set of tags for activities.
func LocalActivityTags ¶
LocalActivityTags returns a set of tags for local activities.
func NewGRPCInterceptor ¶
func NewGRPCInterceptor(defaultHandler Handler, suffix string) grpc.UnaryClientInterceptor
NewGRPCInterceptor creates a new gRPC unary interceptor to record metrics.
func PollerTags ¶
PollerTags returns a set of tags for pollers.
func TaskQueueTags ¶
TaskQueueTags returns a set of tags for a task queue.
func WorkerTags ¶
WorkerTags returns a set of tags for workers.
func WorkflowTags ¶
WorkflowTags returns a set of tags for workflows.
Types ¶
type CapturedCounter ¶
type CapturedCounter struct { CapturedMetricMeta // contains filtered or unexported fields }
CapturedCounter atomically implements Counter and provides an atomic getter.
func (*CapturedCounter) Value ¶
func (c *CapturedCounter) Value() int64
Value atomically returns the current value.
type CapturedGauge ¶
type CapturedGauge struct { CapturedMetricMeta // contains filtered or unexported fields }
CapturedGauge atomically implements Gauge and provides an atomic getter.
func (*CapturedGauge) Update ¶
func (c *CapturedGauge) Update(d float64)
Update implements Gauge.Update.
func (*CapturedGauge) Value ¶
func (c *CapturedGauge) Value() float64
Value atomically returns the current value.
type CapturedMetricMeta ¶
CapturedMetricMeta is common information for captured metrics. These fields should never by mutated.
type CapturedTimer ¶
type CapturedTimer struct { CapturedMetricMeta // contains filtered or unexported fields }
CapturedTimer atomically implements Timer and provides an atomic getter.
func (*CapturedTimer) Record ¶
func (c *CapturedTimer) Record(d time.Duration)
Record implements Timer.Record.
func (*CapturedTimer) Value ¶
func (c *CapturedTimer) Value() time.Duration
Value atomically returns the current value.
type CapturingHandler ¶
type CapturingHandler struct {
// contains filtered or unexported fields
}
CapturingHandler is a Handler that retains counted values locally.
func NewCapturingHandler ¶
func NewCapturingHandler() *CapturingHandler
NewCapturingHandler creates a new CapturingHandler.
func (*CapturingHandler) Clear ¶
func (c *CapturingHandler) Clear()
Clear removes all known metrics from the root handler.
func (*CapturingHandler) Counter ¶
func (c *CapturingHandler) Counter(name string) Counter
Counter implements Handler.Counter.
func (*CapturingHandler) Counters ¶
func (c *CapturingHandler) Counters() []*CapturedCounter
Counters returns shallow copy of the local counters. New counters will not get added here, but the value within the counter may still change.
func (*CapturingHandler) Gauge ¶
func (c *CapturingHandler) Gauge(name string) Gauge
Gauge implements Handler.Gauge.
func (*CapturingHandler) Gauges ¶
func (c *CapturingHandler) Gauges() []*CapturedGauge
Gauges returns shallow copy of the local gauges. New gauges will not get added here, but the value within the gauge may still change.
func (*CapturingHandler) Timer ¶
func (c *CapturingHandler) Timer(name string) Timer
Timer implements Handler.Timer.
func (*CapturingHandler) Timers ¶
func (c *CapturingHandler) Timers() []*CapturedTimer
Timers returns shallow copy of the local timers. New timers will not get added here, but the value within the timer may still change.
type Counter ¶
type Counter interface { // Inc increments the counter value. Inc(int64) }
Counter is an ever-increasing counter.
type CounterFunc ¶
type CounterFunc func(int64)
CounterFunc implements Counter with a single function.
type Gauge ¶
type Gauge interface { // Update updates the gauge value. Update(float64) }
Gauge can be set to any float.
type Handler ¶
type Handler interface { // WithTags returns a new handler with the given tags set for each metric // created from it. WithTags(map[string]string) Handler // Counter obtains a counter for the given name. Counter(name string) Counter // Gauge obtains a gauge for the given name. Gauge(name string) Gauge // Timer obtains a timer for the given name. Timer(name string) Timer }
Handler is a handler for metrics emitted by the SDK. This interface is intentionally limited to only what the SDK needs to emit metrics and is not built to be a general purpose metrics abstraction for all uses.
A common implementation is at go.temporal.io/sdk/contrib/tally.NewMetricsHandler. The NopHandler is a noop handler. A handler may implement "Unwrap() Handler" if it wraps a handler.
var NopHandler Handler = nopHandler{}
NopHandler is a noop handler that does nothing with the metrics.
func NewReplayAwareHandler ¶
NewReplayAwareHandler is a handler that will not record any metrics if the boolean pointed to by "replay" is true.
type HandlerContextKey ¶
type HandlerContextKey struct{}
HandlerContextKey is the context key for a MetricHandler value.
type LongPollContextKey ¶
type LongPollContextKey struct{}
LongPollContextKey is the context key for a boolean stating whether the gRPC call is a long poll.