constants.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package metrics
  2. import "errors"
  3. type propagateKey struct{}
  4. // PropagateCtxKey is the context key where the content that will be
  5. // propagated through rpc calls is set
  6. var PropagateCtxKey = propagateKey{}
  7. var ErrMetricNotKnown = errors.New("the provided metric does not exist")
  8. const (
  9. // ResponseTime reports the response time of handlers and rpc
  10. ResponseTime = "response_time_ns"
  11. // ConnectedClients represents the number of current connected clients in frontend servers
  12. ConnectedClients = "connected_clients"
  13. // CountServers counts the number of servers of different types
  14. CountServers = "count_servers"
  15. // ChannelCapacity represents the capacity of a channel (available slots)
  16. ChannelCapacity = "channel_capacity"
  17. // DroppedMessages reports the number of dropped messages in rpc server (messages that will not be handled)
  18. DroppedMessages = "dropped_messages"
  19. // ProcessDelay reports the message processing delay to handle the messages at the handler service
  20. ProcessDelay = "handler_delay_ns"
  21. // Goroutines reports the number of goroutines
  22. Goroutines = "goroutines"
  23. // HeapSize reports the size of heap
  24. HeapSize = "heapsize"
  25. // HeapObjects reports the number of allocated heap objects
  26. HeapObjects = "heapobjects"
  27. // WorkerJobsTotal reports the number of executed jobs
  28. WorkerJobsTotal = "worker_jobs_total"
  29. // WorkerJobsRetry reports the number of retried jobs
  30. WorkerJobsRetry = "worker_jobs_retry_total"
  31. // WorkerQueueSize reports the queue size on worker
  32. WorkerQueueSize = "worker_queue_size"
  33. // ExceededRateLimiting reports the number of requests made in a connection
  34. // after the rate limit was exceeded
  35. ExceededRateLimiting = "exceeded_rate_limiting"
  36. MessageHandler = "message_handler"
  37. // MessageResponseTime message response time in millisecond
  38. MessageResponseTime = "message_response_time"
  39. // StartTimeKey is the key holding the request start time (in ns) to be sent over the context
  40. StartTimeKey = "req-start-time"
  41. // RouteKey is the key holding the request route to be sent over the context
  42. RouteKey = "req-route"
  43. // MetricTagsKey is the key holding request tags to be sent over the context
  44. // to be reported
  45. MetricTagsKey = "metric-tags"
  46. )