GrpcInstrumentation
class GrpcInstrumentation extends AbstractInstrumentation implements GrpcOperationObserver
Constants
| protected CLIENT_DURATION_METRIC |
|
| protected SERVER_DURATION_METRIC |
|
| protected RPC_METHOD_OTHER |
|
| protected ATTEMPT_COUNT_ATTRIBUTE |
|
| protected DURATION_BOUNDARIES |
|
Properties
| protected InstrumentationOptions | $options | from AbstractInstrumentation | |
| protected TracerInterface|null | $tracer | ||
| protected HistogramInterface|null | $clientDuration | ||
| protected HistogramInterface|null | $serverDuration | ||
| protected bool | $serverMetricAddress |
Methods
Register the instrumentation with normalized options.
Register the logical gRPC operation observer and instruments.
Determine whether a metric is enabled.
Determine whether the throwable is a direct coroutine cancellation.
Return the semantic conventions schema URL for Hypervel instrumentation scopes.
Index callback observers by their matching instrument name.
Create gRPC instrumentation.
Finish observing a logical gRPC operation.
Complete one logical gRPC call.
Return truthful configured server endpoint attributes.
Return the semantic error type for a completed call.
Reject a gRPC operation type the instrumentation cannot classify.
Return the standard gRPC status name.
Details
in
AbstractInstrumentation at line 21
final void
register(array $options)
Register the instrumentation with normalized options.
at line 91
protected void
registerInstrumentation()
Register the logical gRPC operation observer and instruments.
in
AbstractInstrumentation at line 35
protected bool
tracesEnabled()
Determine whether trace output is enabled.
in
AbstractInstrumentation at line 43
protected bool
metricEnabled(string $name)
Determine whether a metric is enabled.
in
AbstractInstrumentation at line 53
protected bool
isDirectCancellation(Throwable|null $exception)
Determine whether the throwable is a direct coroutine cancellation.
Ending an operation by direct cancellation is control flow, not a failure.
in
AbstractInstrumentation at line 64
protected string
schemaUrl()
Return the semantic conventions schema URL for Hypervel instrumentation scopes.
Every tracer, meter and logger obtained for one scope must pass the same URL.
in
AbstractInstrumentation at line 79
protected array
indexObservers(array $names, array $observers)
Index callback observers by their matching instrument name.
The SDK supplies observers in the same order as the instruments passed to batchObserve(), so the unchanged name order is the mapping contract.
at line 74
__construct(GrpcOperationRunner $operations, TracerProviderInterface $tracerProvider, MeterProviderInterface $meterProvider, ClockInterface $clock, TextMapPropagatorInterface $propagator, GrpcMetadataSetter $metadataSetter, LogContextScopeFactory $logContextScopes, ExceptionContextRegistry $exceptionContexts, OperationOrigin $origins, ProcessIdentity $identity)
Create gRPC instrumentation.
at line 128
mixed
starting(GrpcOperation $operation)
Start observing a logical gRPC operation.
at line 144
void
finished(GrpcOperation $operation, mixed $token, GrpcOperationResult $result)
Finish observing a logical gRPC operation.
at line 161
protected GrpcTelemetryState
startClient(ClientGrpcOperation $operation)
Start a logical client call.
at line 213
protected GrpcTelemetryState
startServer(ServerGrpcOperation $operation)
Start a logical server call.
at line 268
protected void
complete(GrpcOperation $operation, GrpcTelemetryState $state, GrpcOperationResult $result)
Complete one logical gRPC call.
at line 341
protected array
sharedAttributes(GrpcOperation $operation)
Return shared logical RPC attributes.
at line 354
protected array
clientAttributes(ClientGrpcOperation $operation)
Return logical client-call attributes.
at line 367
protected array
serverEndpointAttributes(ServerGrpcOperation $operation)
Return truthful configured server endpoint attributes.
at line 381
protected string
method(GrpcOperation $operation)
Return the recognized RPC method or its bounded fallback.
at line 393
protected HistogramInterface|null
duration(GrpcOperation $operation)
Return the enabled duration instrument for an operation.
at line 405
protected string|null
errorType(GrpcOperation $operation, StatusCode|null $status, string|null $statusName, Throwable|null $exception)
Return the semantic error type for a completed call.
at line 436
protected never
unsupportedOperation(GrpcOperation $operation)
Reject a gRPC operation type the instrumentation cannot classify.
at line 447
protected string
statusName(StatusCode $status)
Return the standard gRPC status name.