|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -# pylint: disable=too-many-lines |
16 |
| - |
17 | 15 |
|
18 | 16 | class MetricInstruments:
|
| 17 | + SCHEMA_URL = "https://opentelemetry.io/schemas/v1.21.0" |
| 18 | + """ |
| 19 | + The URL of the OpenTelemetry schema for these keys and values. |
| 20 | + """ |
19 | 21 |
|
20 | 22 | HTTP_SERVER_DURATION = "http.server.duration"
|
| 23 | + """ |
| 24 | + Measures the duration of inbound HTTP requests |
| 25 | + Instrument: histogram |
| 26 | + Unit: s |
| 27 | + """ |
| 28 | + |
| 29 | + HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" |
| 30 | + """ |
| 31 | + Measures the number of concurrent HTTP requests that are currently in-flight |
| 32 | + Instrument: updowncounter |
| 33 | + Unit: {request} |
| 34 | + """ |
21 | 35 |
|
22 | 36 | HTTP_SERVER_REQUEST_SIZE = "http.server.request.size"
|
| 37 | + """ |
| 38 | + Measures the size of HTTP request messages (compressed) |
| 39 | + Instrument: histogram |
| 40 | + Unit: By |
| 41 | + """ |
23 | 42 |
|
24 | 43 | HTTP_SERVER_RESPONSE_SIZE = "http.server.response.size"
|
25 |
| - |
26 |
| - HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" |
| 44 | + """ |
| 45 | + Measures the size of HTTP response messages (compressed) |
| 46 | + Instrument: histogram |
| 47 | + Unit: By |
| 48 | + """ |
27 | 49 |
|
28 | 50 | HTTP_CLIENT_DURATION = "http.client.duration"
|
| 51 | + """ |
| 52 | + Measures the duration of outbound HTTP requests |
| 53 | + Instrument: histogram |
| 54 | + Unit: s |
| 55 | + """ |
29 | 56 |
|
30 | 57 | HTTP_CLIENT_REQUEST_SIZE = "http.client.request.size"
|
| 58 | + """ |
| 59 | + Measures the size of HTTP request messages (compressed) |
| 60 | + Instrument: histogram |
| 61 | + Unit: By |
| 62 | + """ |
31 | 63 |
|
32 | 64 | HTTP_CLIENT_RESPONSE_SIZE = "http.client.response.size"
|
| 65 | + """ |
| 66 | + Measures the size of HTTP response messages (compressed) |
| 67 | + Instrument: histogram |
| 68 | + Unit: By |
| 69 | + """ |
| 70 | + |
| 71 | + PROCESS_RUNTIME_JVM_MEMORY_INIT = "process.runtime.jvm.memory.init" |
| 72 | + """ |
| 73 | + Measure of initial memory requested |
| 74 | + Instrument: updowncounter |
| 75 | + Unit: By |
| 76 | + """ |
| 77 | + |
| 78 | + PROCESS_RUNTIME_JVM_SYSTEM_CPU_UTILIZATION = ( |
| 79 | + "process.runtime.jvm.system.cpu.utilization" |
| 80 | + ) |
| 81 | + """ |
| 82 | + Recent CPU utilization for the whole system as reported by the JVM |
| 83 | + Instrument: gauge |
| 84 | + Unit: 1 |
| 85 | + """ |
| 86 | + |
| 87 | + PROCESS_RUNTIME_JVM_SYSTEM_CPU_LOAD_1M = ( |
| 88 | + "process.runtime.jvm.system.cpu.load_1m" |
| 89 | + ) |
| 90 | + """ |
| 91 | + Average CPU load of the whole system for the last minute as reported by the JVM |
| 92 | + Instrument: gauge |
| 93 | + Unit: 1 |
| 94 | + """ |
| 95 | + |
| 96 | + PROCESS_RUNTIME_JVM_BUFFER_USAGE = "process.runtime.jvm.buffer.usage" |
| 97 | + """ |
| 98 | + Measure of memory used by buffers |
| 99 | + Instrument: updowncounter |
| 100 | + Unit: By |
| 101 | + """ |
| 102 | + |
| 103 | + PROCESS_RUNTIME_JVM_BUFFER_LIMIT = "process.runtime.jvm.buffer.limit" |
| 104 | + """ |
| 105 | + Measure of total memory capacity of buffers |
| 106 | + Instrument: updowncounter |
| 107 | + Unit: By |
| 108 | + """ |
| 109 | + |
| 110 | + PROCESS_RUNTIME_JVM_BUFFER_COUNT = "process.runtime.jvm.buffer.count" |
| 111 | + """ |
| 112 | + Number of buffers in the pool |
| 113 | + Instrument: updowncounter |
| 114 | + Unit: {buffer} |
| 115 | + """ |
| 116 | + |
| 117 | + PROCESS_RUNTIME_JVM_MEMORY_USAGE = "process.runtime.jvm.memory.usage" |
| 118 | + """ |
| 119 | + Measure of memory used |
| 120 | + Instrument: updowncounter |
| 121 | + Unit: By |
| 122 | + """ |
| 123 | + |
| 124 | + PROCESS_RUNTIME_JVM_MEMORY_COMMITTED = ( |
| 125 | + "process.runtime.jvm.memory.committed" |
| 126 | + ) |
| 127 | + """ |
| 128 | + Measure of memory committed |
| 129 | + Instrument: updowncounter |
| 130 | + Unit: By |
| 131 | + """ |
| 132 | + |
| 133 | + PROCESS_RUNTIME_JVM_MEMORY_LIMIT = "process.runtime.jvm.memory.limit" |
| 134 | + """ |
| 135 | + Measure of max obtainable memory |
| 136 | + Instrument: updowncounter |
| 137 | + Unit: By |
| 138 | + """ |
| 139 | + |
| 140 | + PROCESS_RUNTIME_JVM_MEMORY_USAGE_AFTER_LAST_GC = ( |
| 141 | + "process.runtime.jvm.memory.usage_after_last_gc" |
| 142 | + ) |
| 143 | + """ |
| 144 | + Measure of memory used, as measured after the most recent garbage collection event on this pool |
| 145 | + Instrument: updowncounter |
| 146 | + Unit: By |
| 147 | + """ |
| 148 | + |
| 149 | + PROCESS_RUNTIME_JVM_GC_DURATION = "process.runtime.jvm.gc.duration" |
| 150 | + """ |
| 151 | + Duration of JVM garbage collection actions |
| 152 | + Instrument: histogram |
| 153 | + Unit: s |
| 154 | + """ |
| 155 | + |
| 156 | + PROCESS_RUNTIME_JVM_THREADS_COUNT = "process.runtime.jvm.threads.count" |
| 157 | + """ |
| 158 | + Number of executing platform threads |
| 159 | + Instrument: updowncounter |
| 160 | + Unit: {thread} |
| 161 | + """ |
| 162 | + |
| 163 | + PROCESS_RUNTIME_JVM_CLASSES_LOADED = "process.runtime.jvm.classes.loaded" |
| 164 | + """ |
| 165 | + Number of classes loaded since JVM start |
| 166 | + Instrument: counter |
| 167 | + Unit: {class} |
| 168 | + """ |
| 169 | + |
| 170 | + PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = ( |
| 171 | + "process.runtime.jvm.classes.unloaded" |
| 172 | + ) |
| 173 | + """ |
| 174 | + Number of classes unloaded since JVM start |
| 175 | + Instrument: counter |
| 176 | + Unit: {class} |
| 177 | + """ |
| 178 | + |
| 179 | + PROCESS_RUNTIME_JVM_CLASSES_CURRENT_LOADED = ( |
| 180 | + "process.runtime.jvm.classes.current_loaded" |
| 181 | + ) |
| 182 | + """ |
| 183 | + Number of classes currently loaded |
| 184 | + Instrument: updowncounter |
| 185 | + Unit: {class} |
| 186 | + """ |
| 187 | + |
| 188 | + PROCESS_RUNTIME_JVM_CPU_TIME = "process.runtime.jvm.cpu.time" |
| 189 | + """ |
| 190 | + CPU time used by the process as reported by the JVM |
| 191 | + Instrument: counter |
| 192 | + Unit: s |
| 193 | + """ |
| 194 | + |
| 195 | + PROCESS_RUNTIME_JVM_CPU_RECENT_UTILIZATION = ( |
| 196 | + "process.runtime.jvm.cpu.recent_utilization" |
| 197 | + ) |
| 198 | + """ |
| 199 | + Recent CPU utilization for the process as reported by the JVM |
| 200 | + Instrument: gauge |
| 201 | + Unit: 1 |
| 202 | + """ |
| 203 | + |
| 204 | + # Manually defined metrics |
33 | 205 |
|
34 | 206 | DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage"
|
| 207 | + """ |
| 208 | + The number of connections that are currently in state described by the `state` attribute |
| 209 | + Instrument: UpDownCounter |
| 210 | + Unit: {connection} |
| 211 | + """ |
0 commit comments