GrpcInstrumentation
class GrpcInstrumentation extends AbstractInstrumentation implements GrpcOperationObserver
Constants
| protected CLIENT_DURATION_METRIC |
|
| protected SERVER_DURATION_METRIC |
|
| protected RPC_SYSTEM_ATTRIBUTE |
|
| protected RPC_METHOD_ATTRIBUTE |
|
| protected RPC_STATUS_ATTRIBUTE |
|
| protected RPC_SYSTEM_GRPC |
|
| 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.
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 18
final void
register(array $options)
Register the instrumentation with normalized options.
at line 99
protected void
registerInstrumentation()
Register the logical gRPC operation observer and instruments.
in
AbstractInstrumentation at line 32
protected bool
tracesEnabled()
Determine whether trace output is enabled.
in
AbstractInstrumentation at line 40
protected bool
metricEnabled(string $name)
Determine whether a metric is enabled.
in
AbstractInstrumentation at line 55
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 82
__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 136
mixed
starting(GrpcOperation $operation)
Start observing a logical gRPC operation.
at line 152
void
finished(GrpcOperation $operation, mixed $token, GrpcOperationResult $result)
Finish observing a logical gRPC operation.
at line 169
protected GrpcTelemetryState
startClient(ClientGrpcOperation $operation)
Start a logical client call.
at line 223
protected GrpcTelemetryState
startServer(ServerGrpcOperation $operation)
Start a logical server call.
at line 278
protected void
complete(GrpcOperation $operation, GrpcTelemetryState $state, GrpcOperationResult $result)
Complete one logical gRPC call.
at line 349
protected array
sharedAttributes(GrpcOperation $operation)
Return shared logical RPC attributes.
at line 362
protected array
clientAttributes(ClientGrpcOperation $operation)
Return logical client-call attributes.
at line 375
protected array
serverEndpointAttributes(ServerGrpcOperation $operation)
Return truthful configured server endpoint attributes.
at line 389
protected string
method(GrpcOperation $operation)
Return the recognized RPC method or its bounded fallback.
at line 401
protected HistogramInterface|null
duration(GrpcOperation $operation)
Return the enabled duration instrument for an operation.
at line 413
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 444
protected never
unsupportedOperation(GrpcOperation $operation)
Reject a gRPC operation type the instrumentation cannot classify.
at line 455
protected string
statusName(StatusCode $status)
Return the standard gRPC status name.