| 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.NewInt("started", "count of started RPCs") |
| 15 | SentBytes = keys.NewInt("sent_bytes", "bytes sent") |
| 16 | ReceivedBytes = keys.NewInt("received_bytes", "bytes received") |
| 17 | StatusCode = keys.NewString("status.code", "") |
| 18 | Latency = keys.NewFloat("latency", "elapsed time in seconds") |
| 19 | ) |
| 20 | |
| 21 | const ( |
| 22 | Inbound = "in" |
| 23 | Outbound = "out" |
| 24 | ) |