diagnostics

package
v0.5.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: MIT Imports: 22 Imported by: 3

README

Dapr Runtime metrics

Dapr metric name starts with dapr_ prefix except for health metrics.

Health metrics

Dapr uses prometheus process and go collectors by default.

service metrics

Component
  • dapr_runtime_component_loaded: The number of successfully loaded components
  • dapr_runtime_component_init_total: The number of initialized components
  • dapr_runtime_component_init_fail_total: The number of component initialization failures
Security
  • dapr_runtime_mtls_init_total: The number of successful mTLS authenticator initialization.
  • dapr_runtime_mtls_init_fail_total: The number of mTLS authenticator init failures
  • dapr_runtime_mtls_workload_cert_rotated_total: The number of the successful workload certificate rotations
  • dapr_runtime_mtls_workload_cert_rotated_fail_total: The number of the failed workload certificate rotations
Actors
  • dapr_runtime_actor_status_report_total: The number of the successful status reports to placement service.
  • dapr_runtime_actor_status_report_fail_total: The number of the failed status reports to placement service
  • dapr_runtime_actor_table_operation_recv_total: The number of the received actor placement table operations.
  • dapr_runtime_actor_reblanaced_total: The number of the actor rebalance requests.
  • dapr_runtime_actor_activated_total: The number of the actor activation.
  • dapr_runtime_actor_activated_failed_total: The number of the actor activation failures.
  • dapr_runtime_actor_deactivated_total: The number of the successful actor deactivation.
  • dapr_runtime_actor_deactivated_failed_total: The number of the failed actor deactivation.

gRPC monitoring metrics

Dapr leverages opencensus ocgrpc plugin to generate gRPC server and client metrics.

gRPC Server metrics
  • dapr_grpc_io_server_received_bytes_per_rpc: Distribution of received bytes per RPC, by method.
  • dapr_grpc_io_server_sent_bytes_per_rpc: Distribution of total sent bytes per RPC, by method.
  • dapr_grpc_io_server_server_latency: Distribution of server latency in milliseconds, by method.
  • dapr_grpc_io_server_completed_rpcs: Count of RPCs by method and status.
  • dapr_grpc_io_server_received_messages_per_rpc: Distribution of messages received count per RPC, by method.
  • dapr_grpc_io_server_sent_messages_per_rpc: Distribution of messages sent count per RPC, by method.
gRPC Client metrics
  • dapr_grpc_io_client_sent_bytes_per_rpc: Distribution of bytes sent per RPC, by method.
  • dapr_grpc_io_client_received_bytes_per_rpc: Distribution of bytes received per RPC, by method.
  • dapr_grpc_io_client_roundtrip_latency: Distribution of round-trip latency, by method.
  • dapr_grpc_io_client_completed_rpcs: Count of RPCs by method and status.
  • dapr_grpc_io_client_sent_messages_per_rpc: Distribution of sent messages count per RPC, by method.
  • dapr_grpc_io_client_received_messages_per_rpc: Distribution of received messages count per RPC, by method.
  • dapr_grpc_io_client_server_latency: Distribution of server latency as viewed by client, by method.

HTTP monitoring metrics

We support only server side metrics.

Server metrics
  • dapr_http_server_request_count: Number of HTTP requests started in server
  • dapr_http_server_request_bytes: HTTP request body size if set as ContentLength (uncompressed) in server
  • dapr_http_server_response_bytes: HTTP response body size (uncompressed) in server.
  • dapr_http_server_latency: HTTP request end to end latency in server.
Client metrics
  • dapr_http/client/sent_bytes: Total bytes sent in request body (not including headers)
  • dapr_http/client/received_bytes: Total bytes received in response bodies (not including headers but including error responses with bodies)
  • dapr_http/client/roundtrip_latency: End-to-end latency
  • dapr_http/client/completed_count: Count of completed requests

Documentation

Index

Constants

View Source
const (
	// CorrelationID is the header key name of correlation id for trace
	CorrelationID = "X-Correlation-ID"
)

Variables

View Source
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 middleswares
	DefaultGRPCMonitoring = newGRPCMetrics()
	// DefaultHTTPMonitoring holds default HTTP monitoring handlers and middleswares
	DefaultHTTPMonitoring = newHTTPMetrics()
)

Functions

func DeserializeSpanContext

func DeserializeSpanContext(ctx string) trace.SpanContext

DeserializeSpanContext deserializes a span context from a string

func DeserializeSpanContextPointer

func DeserializeSpanContextPointer(ctx string) *trace.SpanContext

DeserializeSpanContextPointer deserializes a span context from a trace pointer

func InitMetrics added in v0.5.0

func InitMetrics(appID string) error

InitMetrics initializes metrics

func ProjectStatusCode added in v0.5.0

func ProjectStatusCode(code int) int32

func SerializeSpanContext

func SerializeSpanContext(ctx trace.SpanContext) string

SerializeSpanContext serializes a span context into a simple string

func TraceSpanFromFastHTTPContext

func TraceSpanFromFastHTTPContext(c *fasthttp.RequestCtx, spec config.TracingSpec) (TracerSpan, TracerSpan)

TraceSpanFromFastHTTPContext creates a tracing span form a fasthttp request context

func TraceSpanFromFastHTTPRequest added in v0.5.0

func TraceSpanFromFastHTTPRequest(r *fasthttp.Request, spec config.TracingSpec) (TracerSpan, TracerSpan)

TraceSpanFromFastHTTPRequest creates a tracing span form a fasthttp request

func TracingGRPCMiddlewareStream added in v0.5.0

func TracingGRPCMiddlewareStream(spec config.TracingSpec) grpc_go.StreamServerInterceptor

TracingGRPCMiddlewareStream plugs tracer into gRPC stream

func TracingGRPCMiddlewareUnary

func TracingGRPCMiddlewareUnary(spec config.TracingSpec) grpc_go.UnaryServerInterceptor

TracingGRPCMiddlewareUnary plugs tracer into gRPC unary calls

func TracingHTTPMiddleware

func TracingHTTPMiddleware(spec config.TracingSpec, next fasthttp.RequestHandler) fasthttp.RequestHandler

TracingHTTPMiddleware plugs tracer into fasthttp pipeline

func TracingSpanFromGRPCContext

func TracingSpanFromGRPCContext(c context.Context, req interface{}, method string, spec config.TracingSpec) (TracerSpan, TracerSpan)

TracingSpanFromGRPCContext creates a span from an incoming gRPC method call

func UpdateSpanPairStatusesFromError added in v0.5.0

func UpdateSpanPairStatusesFromError(span, spanc TracerSpan, err error, method string)

UpdateSpanPairStatusesFromError updates tracer span statuses based on error object

func UpdateSpanPairStatusesFromHTTPResponse added in v0.5.0

func UpdateSpanPairStatusesFromHTTPResponse(span, spanc TracerSpan, resp *fasthttp.Response)

UpdateSpanPairStatusesFromHTTPResponse updates tracer span statuses based on HTTP response

Types

type TracerSpan

type TracerSpan struct {
	Context     context.Context
	Span        *trace.Span
	SpanContext *trace.SpanContext
}

TracerSpan defines a tracing span that a tracer users to keep track of call scopes

Directories

Path Synopsis
mocks
Package mock_helloworld is a generated GoMock package.
Package mock_helloworld is a generated GoMock package.

Jump to

Keyboard shortcuts

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