|
| 1 | +[ |
| 2 | + {"type":"CommentSingle","value":"# A metric with label filtering"}, |
| 3 | + {"type":"TextWhitespace","value":"\n"}, |
| 4 | + {"type":"NameVariable","value":"go_gc_duration_seconds"}, |
| 5 | + {"type":"Punctuation","value":"{"}, |
| 6 | + {"type":"NameLabel","value":"instance"}, |
| 7 | + {"type":"Operator","value":"="}, |
| 8 | + {"type":"Punctuation","value":"\""}, |
| 9 | + {"type":"LiteralString","value":"localhost:9090"}, |
| 10 | + {"type":"Punctuation","value":"\","}, |
| 11 | + {"type":"TextWhitespace","value":" "}, |
| 12 | + {"type":"NameLabel","value":"job"}, |
| 13 | + {"type":"Operator","value":"="}, |
| 14 | + {"type":"Punctuation","value":"\""}, |
| 15 | + {"type":"LiteralString","value":"alertmanager"}, |
| 16 | + {"type":"Punctuation","value":"\"}"}, |
| 17 | + {"type":"TextWhitespace","value":"\n\n"}, |
| 18 | + |
| 19 | + {"type":"CommentSingle","value":"# Aggregation operators"}, |
| 20 | + {"type":"TextWhitespace","value":"\n"}, |
| 21 | + {"type":"Keyword","value":"sum"}, |
| 22 | + {"type":"TextWhitespace","value":" "}, |
| 23 | + {"type":"Keyword","value":"by"}, |
| 24 | + {"type":"TextWhitespace","value":" "}, |
| 25 | + {"type":"Operator","value":"("}, |
| 26 | + {"type":"NameVariable","value":"app"}, |
| 27 | + {"type":"Punctuation","value":","}, |
| 28 | + {"type":"TextWhitespace","value":" "}, |
| 29 | + {"type":"NameVariable","value":"proc"}, |
| 30 | + {"type":"Operator","value":")"}, |
| 31 | + {"type":"TextWhitespace","value":" "}, |
| 32 | + {"type":"Operator","value":"("}, |
| 33 | + {"type":"TextWhitespace","value":"\n "}, |
| 34 | + {"type":"NameVariable","value":"instance_memory_limit_bytes"}, |
| 35 | + {"type":"TextWhitespace","value":" "}, |
| 36 | + {"type":"Operator","value":"-"}, |
| 37 | + {"type":"TextWhitespace","value":" "}, |
| 38 | + {"type":"NameVariable","value":"instance_memory_usage_bytes"}, |
| 39 | + {"type":"TextWhitespace","value":"\n"}, |
| 40 | + {"type":"Operator","value":")"}, |
| 41 | + {"type":"TextWhitespace","value":" "}, |
| 42 | + {"type":"Operator","value":"/"}, |
| 43 | + {"type":"TextWhitespace","value":" "}, |
| 44 | + {"type":"LiteralNumberInteger","value":"1024"}, |
| 45 | + {"type":"TextWhitespace","value":" "}, |
| 46 | + {"type":"Operator","value":"/"}, |
| 47 | + {"type":"TextWhitespace","value":" "}, |
| 48 | + {"type":"LiteralNumberInteger","value":"1024"}, |
| 49 | + {"type":"TextWhitespace","value":"\n\n"}, |
| 50 | + |
| 51 | + {"type":"CommentSingle","value":"# Metric with multiple lables and whitespaces"}, |
| 52 | + {"type":"TextWhitespace","value":"\n"}, |
| 53 | + {"type":"NameVariable","value":"go_gc_duration_seconds"}, |
| 54 | + {"type":"Punctuation","value":"{"}, |
| 55 | + {"type":"TextWhitespace","value":" "}, |
| 56 | + {"type":"NameLabel","value":"instance"}, |
| 57 | + {"type":"Operator","value":"="}, |
| 58 | + {"type":"Punctuation","value":"\""}, |
| 59 | + {"type":"LiteralString","value":"localhost:9090"}, |
| 60 | + {"type":"Punctuation","value":"\","}, |
| 61 | + {"type":"TextWhitespace","value":" "}, |
| 62 | + {"type":"NameLabel","value":"job"}, |
| 63 | + {"type":"Operator","value":"="}, |
| 64 | + {"type":"Punctuation","value":"\""}, |
| 65 | + {"type":"LiteralString","value":"alertmanager"}, |
| 66 | + {"type":"Punctuation","value":"\""}, |
| 67 | + {"type":"TextWhitespace","value":" "}, |
| 68 | + {"type":"Punctuation","value":"}"}, |
| 69 | + {"type":"TextWhitespace","value":"\n\n"}, |
| 70 | + |
| 71 | + {"type":"CommentSingle","value":"# Expression and comment"}, |
| 72 | + {"type":"TextWhitespace","value":"\n"}, |
| 73 | + {"type":"NameVariable","value":"go_gc_duration_seconds"}, |
| 74 | + {"type":"Punctuation","value":"{"}, |
| 75 | + {"type":"NameLabel","value":"instance"}, |
| 76 | + {"type":"Operator","value":"="}, |
| 77 | + {"type":"Punctuation","value":"\""}, |
| 78 | + {"type":"LiteralString","value":"localhost:9090"}, |
| 79 | + {"type":"Punctuation","value":"\"}"}, |
| 80 | + {"type":"TextWhitespace","value":" "}, |
| 81 | + {"type":"CommentSingle","value":"# single comment"}, |
| 82 | + {"type":"TextWhitespace","value":"\n\n"}, |
| 83 | + |
| 84 | + {"type":"CommentSingle","value":"# Delta function"}, |
| 85 | + {"type":"TextWhitespace","value":"\n"}, |
| 86 | + {"type":"KeywordReserved","value":"delta"}, |
| 87 | + {"type":"Operator","value":"("}, |
| 88 | + {"type":"NameVariable","value":"cpu_temp_celsius"}, |
| 89 | + {"type":"Punctuation","value":"{"}, |
| 90 | + {"type":"NameLabel","value":"host"}, |
| 91 | + {"type":"Operator","value":"="}, |
| 92 | + {"type":"Punctuation","value":"\""}, |
| 93 | + {"type":"LiteralString","value":"zeus"}, |
| 94 | + {"type":"Punctuation","value":"\"}["}, |
| 95 | + {"type":"LiteralString","value":"2h"}, |
| 96 | + {"type":"Punctuation","value":"]"}, |
| 97 | + {"type":"Operator","value":")"}, |
| 98 | + {"type":"TextWhitespace","value":"\n\n"}, |
| 99 | + |
| 100 | + {"type":"CommentSingle","value":"# Sum with arguments"}, |
| 101 | + {"type":"TextWhitespace","value":"\n"}, |
| 102 | + {"type":"Keyword","value":"sum"}, |
| 103 | + {"type":"TextWhitespace","value":" "}, |
| 104 | + {"type":"Keyword","value":"by"}, |
| 105 | + {"type":"TextWhitespace","value":" "}, |
| 106 | + {"type":"Operator","value":"("}, |
| 107 | + {"type":"NameVariable","value":"app"}, |
| 108 | + {"type":"Punctuation","value":","}, |
| 109 | + {"type":"TextWhitespace","value":" "}, |
| 110 | + {"type":"NameVariable","value":"proc"}, |
| 111 | + {"type":"Operator","value":")"}, |
| 112 | + {"type":"TextWhitespace","value":" "}, |
| 113 | + {"type":"Operator","value":"("}, |
| 114 | + {"type":"NameVariable","value":"instance_memory_usage_bytes"}, |
| 115 | + {"type":"Operator","value":")"}, |
| 116 | + {"type":"TextWhitespace","value":"\n\n"}, |
| 117 | + |
| 118 | + {"type":"CommentSingle","value":"# Multi-line with offset"}, |
| 119 | + {"type":"TextWhitespace","value":"\n"}, |
| 120 | + {"type":"KeywordReserved","value":"label_replace"}, |
| 121 | + {"type":"Operator","value":"("}, |
| 122 | + {"type":"TextWhitespace","value":"\n "}, |
| 123 | + {"type":"Keyword","value":"avg"}, |
| 124 | + {"type":"TextWhitespace","value":" "}, |
| 125 | + {"type":"Keyword","value":"by"}, |
| 126 | + {"type":"Operator","value":"("}, |
| 127 | + {"type":"NameVariable","value":"instance"}, |
| 128 | + {"type":"Operator","value":")"}, |
| 129 | + {"type":"TextWhitespace","value":"\n "}, |
| 130 | + {"type":"Operator","value":"("}, |
| 131 | + {"type":"KeywordReserved","value":"irate"}, |
| 132 | + {"type":"Operator","value":"("}, |
| 133 | + {"type":"NameVariable","value":"node_cpu_seconds_total"}, |
| 134 | + {"type":"Punctuation","value":"{"}, |
| 135 | + {"type":"NameLabel","value":"mode"}, |
| 136 | + {"type":"TextWhitespace","value":" "}, |
| 137 | + {"type":"Operator","value":"="}, |
| 138 | + {"type":"TextWhitespace","value":" "}, |
| 139 | + {"type":"Punctuation","value":"\""}, |
| 140 | + {"type":"LiteralString","value":"idle"}, |
| 141 | + {"type":"Punctuation","value":"\"}["}, |
| 142 | + {"type":"LiteralString","value":"5m"}, |
| 143 | + {"type":"Punctuation","value":"]"}, |
| 144 | + {"type":"TextWhitespace","value":" "}, |
| 145 | + {"type":"Keyword","value":"offset"}, |
| 146 | + {"type":"TextWhitespace","value":" "}, |
| 147 | + {"type":"LiteralString","value":"3s"}, |
| 148 | + {"type":"Operator","value":")"}, |
| 149 | + {"type":"TextWhitespace","value":"\n "}, |
| 150 | + {"type":"Operator","value":")"}, |
| 151 | + {"type":"TextWhitespace","value":" "}, |
| 152 | + {"type":"Operator","value":"*"}, |
| 153 | + {"type":"TextWhitespace","value":" "}, |
| 154 | + {"type":"LiteralNumberInteger","value":"100"}, |
| 155 | + {"type":"Punctuation","value":","}, |
| 156 | + {"type":"TextWhitespace","value":"\n "}, |
| 157 | + {"type":"Punctuation","value":"\""}, |
| 158 | + {"type":"LiteralString","value":"device"}, |
| 159 | + {"type":"Punctuation","value":"\","}, |
| 160 | + {"type":"TextWhitespace","value":"\n "}, |
| 161 | + {"type":"Punctuation","value":"\""}, |
| 162 | + {"type":"LiteralString","value":"cpu"}, |
| 163 | + {"type":"Punctuation","value":"\","}, |
| 164 | + {"type":"TextWhitespace","value":"\n "}, |
| 165 | + {"type":"Punctuation","value":"\""}, |
| 166 | + {"type":"LiteralString","value":"instance"}, |
| 167 | + {"type":"Punctuation","value":"\","}, |
| 168 | + {"type":"TextWhitespace","value":"\n "}, |
| 169 | + {"type":"Punctuation","value":"\""}, |
| 170 | + {"type":"LiteralString","value":".*"}, |
| 171 | + {"type":"Punctuation","value":"\""}, |
| 172 | + {"type":"TextWhitespace","value":"\n"}, |
| 173 | + {"type":"Operator","value":")"}, |
| 174 | + {"type":"TextWhitespace","value":"\n"} |
| 175 | +] |
0 commit comments