Documentation
¶
Index ¶
- Constants
- Variables
- func AddAttributesToSpan(span trace.Span, attributes map[string]string)
- func ConstructInputBindingSpanAttributes(bindingName, url string) map[string]string
- func ConstructSubscriptionSpanAttributes(topic string) map[string]string
- func ElapsedSince(start time.Time) float64
- func GRPCTraceStreamServerInterceptor(appID string, spec config.TracingSpec) grpc.StreamServerInterceptor
- func GRPCTraceUnaryServerInterceptor(appID string, spec config.TracingSpec) grpc.UnaryServerInterceptor
- func HTTPTraceMiddleware(next http.Handler, appID string, spec config.TracingSpec) http.Handler
- func InitMetrics(meter view.Meter, appID, namespace string, metricSpec config.MetricSpec) error
- func NewDaprTraceSampler(samplingRateString string) sdktrace.Sampler
- func NormalizeHTTPPath(p string) string
- func RecordErrorCode(err error) bool
- func ResiliencyActorTarget(actorType string) string
- func ResiliencyAppTarget(app string) string
- func ResiliencyComponentTarget(name string, componentType string) string
- func SpanContextFromIncomingGRPCMetadata(ctx context.Context) (trace.SpanContext, bool)
- func SpanContextFromRequest(r *http.Request) (sc trace.SpanContext)
- func SpanContextFromW3CString(h string) (sc trace.SpanContext, ok bool)
- func SpanContextToGRPCMetadata(ctx context.Context, spanContext trace.SpanContext) context.Context
- func SpanContextToHTTPHeaders(sc trace.SpanContext, setHeader func(string, string))
- func SpanContextToW3CString(sc trace.SpanContext) string
- func StartGRPCProducerSpanChildFromParent(ct context.Context, parentSpan trace.Span, spanName string) (context.Context, trace.Span)
- func StartInternalCallbackSpan(ctx context.Context, spanName string, parent trace.SpanContext, ...) (context.Context, trace.Span)
- func StartProducerSpanChildFromParent(r *http.Request, parentSpan trace.Span) trace.Span
- func TraceIDAndStateFromSpan(span trace.Span) (string, string)
- func TraceStateFromW3CString(h string) *trace.TraceState
- func TraceStateToW3CString(sc trace.SpanContext) string
- func UpdateSpanStatusFromGRPCError(span trace.Span, err error)
- func UpdateSpanStatusFromHTTPStatus(span trace.Span, code int)
- type HTTPMonitoringConfig
- type PolicyFlowDirection
- type PolicyType
Constants ¶
const ( Delete = "delete" Get = "get" Set = "set" StateQuery = "query" ConfigurationSubscribe = "subscribe" ConfigurationUnsubscribe = "unsubscribe" StateTransaction = "transaction" BulkGet = "bulk_get" BulkDelete = "bulk_delete" CryptoOp = "crypto_op" JobTriggerOp = "job_trigger_op" )
const ( StatusSuccess = "success" StatusFailed = "failed" // The activity actor's escalation of a lost local drive to its durable // run-activity reminder. StatusEscalated = "escalated" StatusEscalateFailed = "escalate_failed" StatusEscalateSkipped = "escalate_skipped_shutdown" StatusJanitorRecovered = "janitor_recovered" // A janitor fire found completions held for folding with no live driver // (their arming drive was lost and their senders stopped re-delivering, // e.g. died with their pod at a placement handoff) and drove a turn to // commit them; the rescue event of the captive-fold stranding class // (~0 in healthy steady state). StatusJanitorFoldRecovered = "janitor_fold_recovered" // Local-activity fast path janitor re-dispatch outcomes: an unresolved // TaskScheduled event was re-dispatched (the recovery event; ~0 in // healthy steady state), found busy executing (benign), or the // re-dispatch call failed (the next janitor period retries). StatusJanitorRedispatched = "janitor_redispatched" StatusJanitorRedispatchBusy = "janitor_redispatch_busy" StatusJanitorRedispatchFailed = "janitor_redispatch_failed" // A janitor re-dispatch was accepted in an earlier period but its task is // still unresolved: acceptance only certifies that the target host armed // a detached local drive, so the arm is presumed lost and the re-dispatch // was escalated to the durable run-activity reminder the fast path elided // (a placement-handoff loss window). The durable rescue event; ~0 in // healthy steady state. StatusJanitorRedispatchEscalated = "janitor_redispatch_escalated" // The janitor skipped the re-dispatch check because the instance showed // recent progress (fresh durable commit or a running drive loop); the // next period re-checks. StatusJanitorRedispatchSuppressed = "janitor_redispatch_suppressed" // An escalated run-activity reminder was deleted because its task // resolved: the resolving execution predates the escalation and cannot // delete a reminder it never knew existed, so the escalating and // committing turns reap it (see reapEscalatedReminder). Without the // reap, the fire re-runs the body on a cold host. StatusJanitorEscalationReaped = "janitor_escalation_reaped" // An activity arrival found the in-flight claim held by a dead execution // (no engine-held work item after the stale grace) and evicted it so the // arrival re-executes; the rescue event of the janitor-livelock class // (~0 in healthy steady state). StatusClaimEvicted = "claim_evicted" // A turn's workflow response re-created an operation that already exists in // committed history: the response was computed from older history (a stale // or duplicate completion delivery adopted across turns) and the turn was // rejected for retry instead of committing a wedged state (the // janitor-livelock stranding source; ~0 in healthy steady state). StatusStaleTurnRejected = "stale_turn_rejected" // An instance whose durable state can never progress (its committed // start was lost) was terminally FAILED instead of silently dropping // its work; ~0 in healthy steady state. StatusUnstartableFailed = "unstartable_failed" // A wake-up reminder create failed after its inbox row was committed and // was handed to a detached retry, or that retry gave up; ~0 in healthy // steady state. StatusArmDetached = "reminder_arm_detached" StatusArmDetachedFailed = "reminder_arm_detached_failed" StatusArmDetachedSkipped = "reminder_arm_detached_skipped_shutdown" // A status read re-asserted the start reminder of an overdue pending // start; ~0 in healthy steady state. StatusPendingStartRedriven = "pending_start_redriven" // Completions-fold outcomes: a sender-retried completion committed // inside its folding turn (folded), or was nacked back into the // sender's retry chain (turn failure, timeout, deactivation). StatusFolded = "folded" StatusFoldNacked = "fold_nacked" StatusTerminated = "terminated" StatusRecoverable = "recoverable" CreateWorkflow = "create_workflow" GetWorkflow = "get_workflow" AddEvent = "add_event" PurgeWorkflow = "purge_workflow" WorkflowEvent = "event" Timer = "timer" // AttestationKindChild tags attestation events for child workflow // completions (ChildCompletionAttestation). AttestationKindChild = "child" // AttestationKindActivity tags attestation events for activity task // completions (ActivityCompletionAttestation). AttestationKindActivity = "activity" // AttestationResultOK tags an attestation that passed all verification // checks at ingestion. AttestationResultOK = "ok" // AttestationResultReject tags an attestation that was rejected // (missing, malformed, tampered, or bound to the wrong parent/task). AttestationResultReject = "reject" // CertCacheHit tags a lookup that found a cached chain-of-trust // verification result within the leaf cert's validity window. CertCacheHit = "hit" // CertCacheMiss tags a lookup that required a full chain-of-trust // verification (first use of this cert digest within the orchestrator // instance, or eventTime fell outside the cached window). CertCacheMiss = "miss" // Completion routes under WorkflowsClusteredDeployment. Wait side: the // waiter either blocks on the process-local pending map // (CompletionRouteWaitLocal, the expected steady state) or falls back to // a watch stream on the executor rendezvous actor // (CompletionRouteWaitWatch, legacy-format reminders or placement // disagreement). Complete side: the completion is either delivered // straight into the local pending map of the receiving daprd // (CompletionRouteCompleteLocal) or forwarded via the executor actor // (CompletionRouteCompleteActor). CompletionRouteWaitLocal = "wait_local" CompletionRouteWaitWatch = "wait_watch" CompletionRouteCompleteLocal = "complete_local" CompletionRouteCompleteActor = "complete_actor" )
Variables ¶
var ( KeyServerMethod = tag.MustNewKey("grpc_server_method") KeyServerStatus = tag.MustNewKey("grpc_server_status") KeyClientMethod = tag.MustNewKey("grpc_client_method") KeyClientStatus = tag.MustNewKey("grpc_client_status") )
Tag key definitions for http requests.
var ( // DefaultReportingPeriod is the default view reporting period. DefaultReportingPeriod = 1 * time.Minute // DefaultMonitoring holds service monitoring metrics definitions. DefaultMonitoring = newServiceMetrics() // DefaultGRPCMonitoring holds default gRPC monitoring handlers and middlewares. DefaultGRPCMonitoring = newGRPCMetrics() // DefaultHTTPMonitoring holds default HTTP monitoring handlers and middlewares. DefaultHTTPMonitoring = newHTTPMetrics() // DefaultComponentMonitoring holds component specific metrics. DefaultComponentMonitoring = newComponentMetrics() // DefaultResiliencyMonitoring holds resiliency specific metrics. DefaultResiliencyMonitoring = newResiliencyMetrics() // DefaultWorkflowMonitoring holds workflow specific metrics. DefaultWorkflowMonitoring = newWorkflowMetrics() // DefaultErrorCodeMonitoring holds error code specific metrics. DefaultErrorCodeMonitoring = newErrorCodeMetrics() )
var ( CircuitBreakerPolicy PolicyType = "circuitbreaker" RetryPolicy PolicyType = "retry" TimeoutPolicy PolicyType = "timeout" OutboundPolicyFlowDirection PolicyFlowDirection = "outbound" InboundPolicyFlowDirection PolicyFlowDirection = "inbound" )
Functions ¶
func AddAttributesToSpan ¶ added in v0.8.0
AddAttributesToSpan adds the given attributes in the span.
func ConstructInputBindingSpanAttributes ¶ added in v0.8.0
ConstructInputBindingSpanAttributes creates span attributes for InputBindings.
func ConstructSubscriptionSpanAttributes ¶ added in v0.8.0
ConstructSubscriptionSpanAttributes creates span attributes for Pubsub subscription.
func ElapsedSince ¶ added in v1.7.0
ElapsedSince returns the elapsed duration since start in milliseconds, including fractional milliseconds.
func GRPCTraceStreamServerInterceptor ¶ added in v1.3.0
func GRPCTraceStreamServerInterceptor(appID string, spec config.TracingSpec) grpc.StreamServerInterceptor
GRPCTraceStreamServerInterceptor sets the trace context or starts the trace client span based on request. This is used by proxy requests too.
func GRPCTraceUnaryServerInterceptor ¶ added in v0.8.0
func GRPCTraceUnaryServerInterceptor(appID string, spec config.TracingSpec) grpc.UnaryServerInterceptor
GRPCTraceUnaryServerInterceptor sets the trace context or starts the trace client span based on request.
func HTTPTraceMiddleware ¶ added in v0.8.0
HTTPTraceMiddleware sets the trace context or starts the trace client span based on request.
func InitMetrics ¶ added in v0.5.0
InitMetrics initializes metrics.
func NewDaprTraceSampler ¶ added in v1.9.3
func NormalizeHTTPPath ¶ added in v1.17.0
NormalizeHTTPPath merges double slashes and ensures leading slash.
func RecordErrorCode ¶ added in v1.15.0
RecordErrorCode is called at the end/middleware of HTTP/gRPC calls and will attempt to find the ErrorCode in an error and record it
func ResiliencyActorTarget ¶ added in v1.11.0
func ResiliencyAppTarget ¶ added in v1.11.0
func ResiliencyComponentTarget ¶ added in v1.11.0
func SpanContextFromIncomingGRPCMetadata ¶ added in v0.9.0
func SpanContextFromIncomingGRPCMetadata(ctx context.Context) (trace.SpanContext, bool)
SpanContextFromIncomingGRPCMetadata returns the SpanContext stored in incoming metadata of context, or empty if there isn't one.
func SpanContextFromRequest ¶ added in v0.7.0
func SpanContextFromRequest(r *http.Request) (sc trace.SpanContext)
SpanContextFromRequest extracts a span context from incoming requests.
func SpanContextFromW3CString ¶ added in v0.8.0
func SpanContextFromW3CString(h string) (sc trace.SpanContext, ok bool)
SpanContextFromW3CString extracts a span context from given string which got earlier from SpanContextToW3CString format.
func SpanContextToGRPCMetadata ¶ added in v0.8.0
SpanContextToGRPCMetadata appends binary serialized SpanContext to the outgoing GRPC context.
func SpanContextToHTTPHeaders ¶ added in v0.8.0
func SpanContextToHTTPHeaders(sc trace.SpanContext, setHeader func(string, string))
SpanContextToHTTPHeaders adds the spancontext in traceparent and tracestate headers.
func SpanContextToW3CString ¶ added in v0.8.0
func SpanContextToW3CString(sc trace.SpanContext) string
SpanContextToW3CString returns the SpanContext string representation.
func StartGRPCProducerSpanChildFromParent ¶ added in v1.10.0
func StartInternalCallbackSpan ¶ added in v0.8.0
func StartInternalCallbackSpan(ctx context.Context, spanName string, parent trace.SpanContext, spec *config.TracingSpec) (context.Context, trace.Span)
StartInternalCallbackSpan starts trace span for internal callback such as input bindings and pubsub subscription.
func StartProducerSpanChildFromParent ¶ added in v1.10.0
func TraceIDAndStateFromSpan ¶ added in v1.12.0
func TraceStateFromW3CString ¶ added in v0.8.0
func TraceStateFromW3CString(h string) *trace.TraceState
TraceStateFromW3CString extracts a span tracestate from given string which got earlier from TraceStateFromW3CString format.
func TraceStateToW3CString ¶ added in v0.10.0
func TraceStateToW3CString(sc trace.SpanContext) string
TraceStateToW3CString extracts the TraceState from given SpanContext and returns its string representation.
func UpdateSpanStatusFromGRPCError ¶ added in v0.8.0
UpdateSpanStatusFromGRPCError updates tracer span status based on error object.
func UpdateSpanStatusFromHTTPStatus ¶ added in v0.8.0
UpdateSpanStatusFromHTTPStatus updates trace span status based on response code.
Types ¶
type HTTPMonitoringConfig ¶ added in v1.14.0
type HTTPMonitoringConfig struct {
// contains filtered or unexported fields
}
func NewHTTPMonitoringConfig ¶ added in v1.14.0
func NewHTTPMonitoringConfig(pathMatching []string, legacy, excludeVerbs bool) HTTPMonitoringConfig
type PolicyFlowDirection ¶ added in v1.11.0
type PolicyFlowDirection string
type PolicyType ¶ added in v1.9.0
type PolicyType string