github.com/v2fly/tools@v0.100.0/internal/lsp/debug/tag/tag.go (about) 1 // Copyright 2019 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 tag provides the labels used for telemetry throughout gopls. 6 package tag 7 8 import ( 9 "github.com/v2fly/tools/internal/event/keys" 10 ) 11 12 var ( 13 // create the label keys we use 14 Method = keys.NewString("method", "") 15 StatusCode = keys.NewString("status.code", "") 16 StatusMessage = keys.NewString("status.message", "") 17 RPCID = keys.NewString("id", "") 18 RPCDirection = keys.NewString("direction", "") 19 File = keys.NewString("file", "") 20 Directory = keys.New("directory", "") 21 URI = keys.New("URI", "") 22 Package = keys.NewString("package", "") // Package ID 23 PackagePath = keys.NewString("package_path", "") 24 Query = keys.New("query", "") 25 Snapshot = keys.NewUInt64("snapshot", "") 26 Operation = keys.NewString("operation", "") 27 28 Position = keys.New("position", "") 29 Category = keys.NewString("category", "") 30 PackageCount = keys.NewInt("packages", "") 31 Files = keys.New("files", "") 32 Port = keys.NewInt("port", "") 33 Type = keys.New("type", "") 34 HoverKind = keys.NewString("hoverkind", "") 35 36 NewServer = keys.NewString("new_server", "A new server was added") 37 EndServer = keys.NewString("end_server", "A server was shut down") 38 39 ServerID = keys.NewString("server", "The server ID an event is related to") 40 Logfile = keys.NewString("logfile", "") 41 DebugAddress = keys.NewString("debug_address", "") 42 GoplsPath = keys.NewString("gopls_path", "") 43 ClientID = keys.NewString("client_id", "") 44 45 Level = keys.NewInt("level", "The logging level") 46 ) 47 48 var ( 49 // create the stats we measure 50 Started = keys.NewInt64("started", "Count of started RPCs.") 51 ReceivedBytes = keys.NewInt64("received_bytes", "Bytes received.") //, unit.Bytes) 52 SentBytes = keys.NewInt64("sent_bytes", "Bytes sent.") //, unit.Bytes) 53 Latency = keys.NewFloat64("latency_ms", "Elapsed time in milliseconds") //, unit.Milliseconds) 54 ) 55 56 const ( 57 Inbound = "in" 58 Outbound = "out" 59 )