golang.org/x/tools@v0.21.1-0.20240520172518-788d39e776b1/internal/jsonrpc2/labels.go (about)

     1  // Copyright 2024 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package jsonrpc2
     6  
     7  import "golang.org/x/tools/internal/event/keys"
     8  
     9  // These keys are used for creating labels to instrument jsonrpc2 events.
    10  var (
    11  	Method        = keys.NewString("method", "")
    12  	RPCID         = keys.NewString("id", "")
    13  	RPCDirection  = keys.NewString("direction", "")
    14  	Started       = keys.NewInt64("started", "Count of started RPCs.")
    15  	SentBytes     = keys.NewInt64("sent_bytes", "Bytes sent.")         //, unit.Bytes)
    16  	ReceivedBytes = keys.NewInt64("received_bytes", "Bytes received.") //, unit.Bytes)
    17  	StatusCode    = keys.NewString("status.code", "")
    18  	Latency       = keys.NewFloat64("latency_ms", "Elapsed time in milliseconds") //, unit.Milliseconds)
    19  )
    20  
    21  const (
    22  	Inbound  = "in"
    23  	Outbound = "out"
    24  )