class Grpc implements IntegrationInterface

This class handles instrumenting grpc requests using the opencensus extension.

Example:

use OpenCensus\Trace\Integrations\Grpc;

Grpc::load();

Methods

static 
load()

Static method to add instrumentation to grpc requests

static array
updateMetadata(array $metadata, string $jwtAuthUri)

Update metadata handler for grpc clients.

Details

at line 40
static load()

Static method to add instrumentation to grpc requests

at line 119
static array updateMetadata(array $metadata, string $jwtAuthUri)

Update metadata handler for grpc clients.

Example:

use OpenCensus\Trace\Integrations\Grpc;

# MathClient is the generated client from the proto definition
$client = new Math\MathClient($host, ['update_metadata' => [Grpc::class, 'updateMetadata']]);

# The call will pass the current trace context using the GrpcMetadataPropagator and BinaryFormatter
$call = $client->Div($divArgs);
$response = $call->wait();

Parameters

array $metadata
string $jwtAuthUri

Return Value

array