...

Source file src/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go

Documentation: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc

     1  // Copyright The OpenTelemetry Authors
     2  // SPDX-License-Identifier: Apache-2.0
     3  
     4  package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
     5  
     6  import (
     7  	"go.opentelemetry.io/otel/attribute"
     8  	semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
     9  )
    10  
    11  // Semantic conventions for attribute keys for gRPC.
    12  const (
    13  	// Name of message transmitted or received.
    14  	RPCNameKey = attribute.Key("name")
    15  
    16  	// Type of message transmitted or received.
    17  	RPCMessageTypeKey = attribute.Key("message.type")
    18  
    19  	// Identifier of message transmitted or received.
    20  	RPCMessageIDKey = attribute.Key("message.id")
    21  
    22  	// The compressed size of the message transmitted or received in bytes.
    23  	RPCMessageCompressedSizeKey = attribute.Key("message.compressed_size")
    24  
    25  	// The uncompressed size of the message transmitted or received in
    26  	// bytes.
    27  	RPCMessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
    28  )
    29  
    30  // Semantic conventions for common RPC attributes.
    31  var (
    32  	// Semantic convention for gRPC as the remoting system.
    33  	RPCSystemGRPC = semconv.RPCSystemGRPC
    34  
    35  	// Semantic convention for a message named message.
    36  	RPCNameMessage = RPCNameKey.String("message")
    37  
    38  	// Semantic conventions for RPC message types.
    39  	RPCMessageTypeSent     = RPCMessageTypeKey.String("SENT")
    40  	RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED")
    41  )
    42  

View as plain text