9.2. Typed output format

  1. Both "show info" and "show stat" support a mode where each output value comes
  2. with its type and sufficient information to know how the value is supposed to
  3. be aggregated between processes and how it evolves.
  4.  
  5. In all cases, the output consists in having a single value per line with all
  6. the information split into fields delimited by colons (':').
  7.  
  8. The first column designates the object or metric being dumped. Its format is
  9. specific to the command producing this output and will not be described in this
  10. section. Usually it will consist in a series of identifiers and field names.
  11.  
  12. The second column contains 3 characters respectively indicating the origin, the
  13. nature and the scope of the value being reported. The first character (the
  14. origin) indicates where the value was extracted from. Possible characters are :
  15.  
  16. M The value is a metric. It is valid at one instant any may change depending
  17. on its nature .
  18.  
  19. S The value is a status. It represents a discrete value which by definition
  20. cannot be aggregated. It may be the status of a server ("UP" or "DOWN"),
  21. the PID of the process, etc.
  22.  
  23. K The value is a sorting key. It represents an identifier which may be used
  24. to group some values together because it is unique among its class. All
  25. internal identifiers are keys. Some names can be listed as keys if they
  26. are unique (eg: a frontend name is unique). In general keys come from the
  27. configuration, even though some of them may automatically be assigned. For
  28. most purposes keys may be considered as equivalent to configuration.
  29.  
  30. C The value comes from the configuration. Certain configuration values make
  31. sense on the output, for example a concurrent connection limit or a cookie
  32. name. By definition these values are the same in all processes started
  33. from the same configuration file.
  34.  
  35. P The value comes from the product itself. There are very few such values,
  36. most common use is to report the product name, version and release date.
  37. These elements are also the same between all processes.
  38.  
  39. The second character (the nature) indicates the nature of the information
  40. carried by the field in order to let an aggregator decide on what operation to
  41. use to aggregate multiple values. Possible characters are :
  42.  
  43. A The value represents an age since a last event. This is a bit different
  44. from the duration in that an age is automatically computed based on the
  45. current date. A typical example is how long ago did the last session
  46. happen on a server. Ages are generally aggregated by taking the minimum
  47. value and do not need to be stored.
  48.  
  49. a The value represents an already averaged value. The average response times
  50. and server weights are of this nature. Averages can typically be averaged
  51. between processes.
  52.  
  53. C The value represents a cumulative counter. Such measures perpetually
  54. increase until they wrap around. Some monitoring protocols need to tell
  55. the difference between a counter and a gauge to report a different type.
  56. In general counters may simply be summed since they represent events or
  57. volumes. Examples of metrics of this nature are connection counts or byte
  58. counts.
  59.  
  60. D The value represents a duration for a status. There are a few usages of
  61. this, most of them include the time taken by the last health check and
  62. the time a server has spent down. Durations are generally not summed,
  63. most of the time the maximum will be retained to compute an SLA.
  64.  
  65. G The value represents a gauge. It's a measure at one instant. The memory
  66. usage or the current number of active connections are of this nature.
  67. Metrics of this type are typically summed during aggregation.
  68.  
  69. L The value represents a limit (generally a configured one). By nature,
  70. limits are harder to aggregate since they are specific to the point where
  71. they were retrieved. In certain situations they may be summed or be kept
  72. separate.
  73.  
  74. M The value represents a maximum. In general it will apply to a gauge and
  75. keep the highest known value. An example of such a metric could be the
  76. maximum amount of concurrent connections that was encountered in the
  77. product's life time. To correctly aggregate maxima, you are supposed to
  78. output a range going from the maximum of all maxima and the sum of all
  79. of them. There is indeed no way to know if they were encountered
  80. simultaneously or not.
  81.  
  82. m The value represents a minimum. In general it will apply to a gauge and
  83. keep the lowest known value. An example of such a metric could be the
  84. minimum amount of free memory pools that was encountered in the product's
  85. life time. To correctly aggregate minima, you are supposed to output a
  86. range going from the minimum of all minima and the sum of all of them.
  87. There is indeed no way to know if they were encountered simultaneously
  88. or not.
  89.  
  90. N The value represents a name, so it is a string. It is used to report
  91. proxy names, server names and cookie names. Names have configuration or
  92. keys as their origin and are supposed to be the same among all processes.
  93.  
  94. O The value represents a free text output. Outputs from various commands,
  95. returns from health checks, node descriptions are of such nature.
  96.  
  97. R The value represents an event rate. It's a measure at one instant. It is
  98. quite similar to a gauge except that the recipient knows that this measure
  99. moves slowly and may decide not to keep all values. An example of such a
  100. metric is the measured amount of connections per second. Metrics of this
  101. type are typically summed during aggregation.
  102.  
  103. T The value represents a date or time. A field emitting the current date
  104. would be of this type. The method to aggregate such information is left
  105. as an implementation choice. For now no field uses this type.
  106.  
  107. The third character (the scope) indicates what extent the value reflects. Some
  108. elements may be per process while others may be per configuration or per system.
  109. The distinction is important to know whether or not a single value should be
  110. kept during aggregation or if values have to be aggregated. The following
  111. characters are currently supported :
  112.  
  113. C The value is valid for a whole cluster of nodes, which is the set of nodes
  114. communicating over the peers protocol. An example could be the amount of
  115. entries present in a stick table that is replicated with other peers. At
  116. the moment no metric use this scope.
  117.  
  118. P The value is valid only for the process reporting it. Most metrics use
  119. this scope.
  120.  
  121. S The value is valid for the whole service, which is the set of processes
  122. started together from the same configuration file. All metrics originating
  123. from the configuration use this scope. Some other metrics may use it as
  124. well for some shared resources (eg: shared SSL cache statistics).
  125.  
  126. s The value is valid for the whole system, such as the system's hostname,
  127. current date or resource usage. At the moment this scope is not used by
  128. any metric.
  129.  
  130. Consumers of these information will generally have enough of these 3 characters
  131. to determine how to accurately report aggregated information across multiple
  132. processes.
  133.  
  134. After this column, the third column indicates the type of the field, among "s32"
  135. (signed 32-bit integer), "s64" (signed 64-bit integer), "u32" (unsigned 32-bit
  136. integer), "u64" (unsigned 64-bit integer), "str" (string). It is important to
  137. know the type before parsing the value in order to properly read it. For example
  138. a string containing only digits is still a string an not an integer (eg: an
  139. error code extracted by a check).
  140.  
  141. Then the fourth column is the value itself, encoded according to its type.
  142. Strings are dumped as-is immediately after the colon without any leading space.
  143. If a string contains a colon, it will appear normally. This means that the
  144. output should not be exclusively split around colons or some check outputs
  145. or server addresses might be truncated.