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 RPCTags(workflowType, activityType, taskQueueName string) map[string]string
- func RootTags(namespace 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" LocalActivityFailedCounter = TemporalMetricsPrefix + "local_activity_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" TemporalRequest = TemporalMetricsPrefix + "request" TemporalRequestFailure = TemporalRequest + "_failure" TemporalRequestLatency = TemporalRequest + "_latency" TemporalLongRequest = TemporalMetricsPrefix + "long_request" TemporalLongRequestFailure = TemporalLongRequest + "_failure" TemporalLongRequestLatency = TemporalLongRequest + "_latency" 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" WorkerTypeTagName = "worker_type" WorkflowTypeNameTagName = "workflow_type" ActivityTypeNameTagName = "activity_type" TaskQueueTagName = "task_queue" OperationTagName = "operation" )
Metric tag keys
const ( NoneTagValue = "none" ClientTagValue = "temporal_go" )
Metric tag values
Variables ¶
This section is empty.
Functions ¶
func ActivityTags ¶ added in v1.12.0
ActivityTags returns a set of tags for activities.
func LocalActivityTags ¶ added in v1.12.0
LocalActivityTags returns a set of tags for local activities.
func NewGRPCInterceptor ¶ added in v1.12.0
func NewGRPCInterceptor(defaultHandler Handler, suffix string) grpc.UnaryClientInterceptor
NewGRPCInterceptor creates a new gRPC unary interceptor to record metrics.
func WorkerTags ¶ added in v1.12.0
WorkerTags returns a set of tags for workers.
func WorkflowTags ¶ added in v1.12.0
WorkflowTags returns a set of tags for workflows.
Types ¶
type CapturedCounter ¶ added in v1.12.0
type CapturedCounter struct { CapturedMetricMeta // contains filtered or unexported fields }
CapturedCounter atomically implements Counter and provides an atomic getter.
func (*CapturedCounter) Inc ¶ added in v1.12.0
func (c *CapturedCounter) Inc(d int64)
Inc implements Counter.Inc.
func (*CapturedCounter) Value ¶ added in v1.12.0
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 ¶ added in v1.12.0
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 ¶ added in v1.12.0
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 ¶ added in v1.12.0
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 ¶ added in v1.12.0
type CapturingHandler struct {
// contains filtered or unexported fields
}
CapturingHandler is a Handler that retains counted values locally.
func NewCapturingHandler ¶ added in v1.12.0
func NewCapturingHandler() *CapturingHandler
NewCapturingHandler creates a new CapturingHandler.
func (*CapturingHandler) Clear ¶ added in v1.12.0
func (c *CapturingHandler) Clear()
Clear removes all known metrics from the root handler.
func (*CapturingHandler) Counter ¶ added in v1.12.0
func (c *CapturingHandler) Counter(name string) Counter
Counter implements Handler.Counter.
func (*CapturingHandler) Counters ¶ added in v1.12.0
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 ¶ added in v1.12.0
func (c *CapturingHandler) Gauge(name string) Gauge
Gauge implements Handler.Gauge.
func (*CapturingHandler) Gauges ¶ added in v1.12.0
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 ¶ added in v1.12.0
func (c *CapturingHandler) Timer(name string) Timer
Timer implements Handler.Timer.
func (*CapturingHandler) Timers ¶ added in v1.12.0
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 ¶ added in v1.12.0
type Counter interface { // Inc increments the counter value. Inc(int64) }
Counter is an ever-increasing counter.
type CounterFunc ¶ added in v1.12.0
type CounterFunc func(int64)
CounterFunc implements Counter with a single function.
func (CounterFunc) Inc ¶ added in v1.12.0
func (c CounterFunc) Inc(d int64)
Inc implements Counter.Inc.
type Gauge ¶ added in v1.12.0
type Gauge interface { // Update updates the gauge value. Update(float64) }
Gauge can be set to any float.
type GaugeFunc ¶ added in v1.12.0
type GaugeFunc func(float64)
GaugeFunc implements Gauge with a single function.
type Handler ¶ added in v1.12.0
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 github.com/spiral/sdk-go/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 ¶ added in v1.12.0
NewReplayAwareHandler is a handler that will not record any metrics if the boolean pointed to by "replay" is true.
type HandlerContextKey ¶ added in v1.12.0
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.