github.com/lulzWill/go-agent@v2.1.2+incompatible/internal/crossagent/cross_agent_tests/transaction_segment_terms.json (about) 1 [ 2 { 3 "testname": "basic", 4 "transaction_segment_terms": [ 5 { 6 "prefix": "WebTransaction/Custom", 7 "terms": ["one", "two", "three"] 8 }, 9 { 10 "prefix": "WebTransaction/Uri", 11 "terms": ["seven", "eight", "nine"] 12 } 13 ], 14 "tests": [ 15 { 16 "input": "WebTransaction/Uri/one/two/seven/user/nine/account", 17 "expected": "WebTransaction/Uri/*/seven/*/nine/*" 18 }, 19 { 20 "input": "WebTransaction/Custom/one/two/seven/user/nine/account", 21 "expected": "WebTransaction/Custom/one/two/*" 22 }, 23 { 24 "input": "WebTransaction/Other/one/two/foo/bar", 25 "expected": "WebTransaction/Other/one/two/foo/bar" 26 } 27 ] 28 }, 29 { 30 "testname": "prefix_with_trailing_slash", 31 "transaction_segment_terms": [ 32 { 33 "prefix": "WebTransaction/Custom/", 34 "terms": ["a", "b"] 35 } 36 ], 37 "tests": [ 38 { 39 "input": "WebTransaction/Custom/a/b/c", 40 "expected": "WebTransaction/Custom/a/b/*" 41 }, 42 { 43 "input": "WebTransaction/Other/a/b/c", 44 "expected": "WebTransaction/Other/a/b/c" 45 } 46 ] 47 }, 48 { 49 "testname": "prefix_with_trailing_spaces_and_then_slash", 50 "transaction_segment_terms": [ 51 { 52 "prefix": "WebTransaction/Custom /", 53 "terms": ["a", "b"] 54 } 55 ], 56 "tests": [ 57 { 58 "input": "WebTransaction/Custom /a/b/c", 59 "expected": "WebTransaction/Custom /a/b/*" 60 }, 61 { 62 "input": "WebTransaction/Custom /a/b/c", 63 "expected": "WebTransaction/Custom /a/b/c" 64 }, 65 { 66 "input": "WebTransaction/Custom/a/b/c", 67 "expected": "WebTransaction/Custom/a/b/c" 68 } 69 ] 70 }, 71 { 72 "testname": "prefix_with_trailing_spaces", 73 "transaction_segment_terms": [ 74 { 75 "prefix": "WebTransaction/Custom ", 76 "terms": ["a", "b"] 77 } 78 ], 79 "tests": [ 80 { 81 "input": "WebTransaction/Custom /a/b/c", 82 "expected": "WebTransaction/Custom /a/b/*" 83 }, 84 { 85 "input": "WebTransaction/Custom /a/b/c", 86 "expected": "WebTransaction/Custom /a/b/c" 87 }, 88 { 89 "input": "WebTransaction/Custom/a/b/c", 90 "expected": "WebTransaction/Custom/a/b/c" 91 } 92 ] 93 }, 94 { 95 "testname": "overlapping_prefix_last_one_only_applied", 96 "transaction_segment_terms": [ 97 { 98 "prefix": "WebTransaction/Foo", 99 "terms": ["one", "two", "three"] 100 }, 101 { 102 "prefix": "WebTransaction/Foo", 103 "terms": ["one", "two", "zero"] 104 } 105 ], 106 "tests": [ 107 { 108 "input": "WebTransaction/Foo/zero/one/two/three/four", 109 "expected": "WebTransaction/Foo/zero/one/two/*" 110 } 111 ] 112 }, 113 { 114 "testname": "terms_are_order_independent", 115 "transaction_segment_terms": [ 116 { 117 "prefix": "WebTransaction/Foo", 118 "terms": ["one", "two", "three"] 119 } 120 ], 121 "tests": [ 122 { 123 "input": "WebTransaction/Foo/bar/one/three/two", 124 "expected": "WebTransaction/Foo/*/one/three/two" 125 }, 126 { 127 "input": "WebTransaction/Foo/three/one/one/two/three", 128 "expected": "WebTransaction/Foo/three/one/one/two/three" 129 } 130 ] 131 }, 132 { 133 "testname": "invalid_rule_not_enough_prefix_segments", 134 "transaction_segment_terms": [ 135 { 136 "prefix": "WebTransaction", 137 "terms": ["one", "two"] 138 } 139 ], 140 "tests": [ 141 { 142 "input": "WebTransaction/Foo/bar/one/three/two", 143 "expected": "WebTransaction/Foo/bar/one/three/two" 144 }, 145 { 146 "input": "WebTransaction/Foo/three/one/one/two/three", 147 "expected": "WebTransaction/Foo/three/one/one/two/three" 148 } 149 ] 150 }, 151 { 152 "testname": "invalid_rule_not_enough_prefix_segments_ending_in_slash", 153 "transaction_segment_terms": [ 154 { 155 "prefix": "WebTransaction/", 156 "terms": ["one", "two"] 157 } 158 ], 159 "tests": [ 160 { 161 "input": "WebTransaction/Foo/bar/one/three/two", 162 "expected": "WebTransaction/Foo/bar/one/three/two" 163 }, 164 { 165 "input": "WebTransaction/Foo/three/one/one/two/three", 166 "expected": "WebTransaction/Foo/three/one/one/two/three" 167 } 168 ] 169 }, 170 { 171 "testname": "invalid_rule_too_many_prefix_segments", 172 "transaction_segment_terms": [ 173 { 174 "prefix": "WebTransaction/Foo/bar", 175 "terms": ["one", "two"] 176 } 177 ], 178 "tests": [ 179 { 180 "input": "WebTransaction/Foo/bar/one/three/two", 181 "expected": "WebTransaction/Foo/bar/one/three/two" 182 }, 183 { 184 "input": "WebTransaction/Foo/three/one/one/two/three", 185 "expected": "WebTransaction/Foo/three/one/one/two/three" 186 } 187 ] 188 }, 189 { 190 "testname": "invalid_rule_prefix_with_trailing_slash_and_then_space", 191 "transaction_segment_terms": [ 192 { 193 "prefix": "WebTransaction/Custom/ ", 194 "terms": ["a", "b"] 195 } 196 ], 197 "tests": [ 198 { 199 "input": "WebTransaction/Custom/a/b/c", 200 "expected": "WebTransaction/Custom/a/b/c" 201 } 202 ] 203 }, 204 { 205 "testname": "invalid_rule_prefix_with_multiple_trailing_slashes", 206 "transaction_segment_terms": [ 207 { 208 "prefix": "WebTransaction/Custom////", 209 "terms": ["a", "b"] 210 } 211 ], 212 "tests": [ 213 { 214 "input": "WebTransaction/Custom/a/b/c", 215 "expected": "WebTransaction/Custom/a/b/c" 216 } 217 ] 218 }, 219 { 220 "testname": "invalid_rule_null_prefix", 221 "transaction_segment_terms": [ 222 { 223 "terms": ["one", "two", "three"] 224 } 225 ], 226 "tests": [ 227 { 228 "input": "WebTransaction/Custom/one/two/seven/user/nine/account", 229 "expected": "WebTransaction/Custom/one/two/seven/user/nine/account" 230 } 231 ] 232 }, 233 { 234 "testname": "invalid_rule_null_terms", 235 "transaction_segment_terms": [ 236 { 237 "prefix": "WebTransaction/Custom" 238 } 239 ], 240 "tests": [ 241 { 242 "input": "WebTransaction/Custom/one/two/seven/user/nine/account", 243 "expected": "WebTransaction/Custom/one/two/seven/user/nine/account" 244 } 245 ] 246 }, 247 { 248 "testname": "empty_terms", 249 "transaction_segment_terms": [ 250 { 251 "prefix": "WebTransaction/Custom", 252 "terms": [] 253 } 254 ], 255 "tests": [ 256 { 257 "input": "WebTransaction/Custom/one/two/seven/user/nine/account", 258 "expected": "WebTransaction/Custom/*" 259 }, 260 { 261 "input": "WebTransaction/Custom/", 262 "expected": "WebTransaction/Custom/" 263 }, 264 { 265 "input": "WebTransaction/Custom", 266 "expected": "WebTransaction/Custom" 267 } 268 ] 269 }, 270 { 271 "testname": "two_segment_transaction_name", 272 "transaction_segment_terms": [ 273 { 274 "prefix": "WebTransaction/Foo", 275 "terms": ["a", "b", "c"] 276 } 277 ], 278 "tests": [ 279 { 280 "input": "WebTransaction/Foo", 281 "expected": "WebTransaction/Foo" 282 } 283 ] 284 }, 285 { 286 "testname": "two_segment_transaction_name_with_trailing_slash", 287 "transaction_segment_terms": [ 288 { 289 "prefix": "WebTransaction/Foo", 290 "terms": ["a", "b", "c"] 291 } 292 ], 293 "tests": [ 294 { 295 "input": "WebTransaction/Foo/", 296 "expected": "WebTransaction/Foo/" 297 } 298 ] 299 }, 300 { 301 "testname": "transaction_segment_with_adjacent_slashes", 302 "transaction_segment_terms": [ 303 { 304 "prefix": "WebTransaction/Foo", 305 "terms": ["a", "b", "c"] 306 } 307 ], 308 "tests": [ 309 { 310 "input": "WebTransaction/Foo///a/b///c/d/", 311 "expected": "WebTransaction/Foo/*/a/b/*/c/*" 312 }, 313 { 314 "input": "WebTransaction/Foo///a/b///c///", 315 "expected": "WebTransaction/Foo/*/a/b/*/c/*" 316 } 317 ] 318 }, 319 { 320 "testname": "transaction_name_with_single_segment", 321 "transaction_segment_terms": [ 322 { 323 "prefix": "WebTransaction/Foo", 324 "terms": ["a", "b", "c"] 325 } 326 ], 327 "tests": [ 328 { 329 "input": "WebTransaction", 330 "expected": "WebTransaction" 331 } 332 ] 333 }, 334 { 335 "testname": "prefix_must_match_first_two_segments", 336 "transaction_segment_terms": [ 337 { 338 "prefix": "WebTransaction/Zip", 339 "terms": ["a", "b"] 340 } 341 ], 342 "tests": [ 343 { 344 "input": "WebTransaction/Zip/a/b/c", 345 "expected": "WebTransaction/Zip/a/b/*" 346 }, 347 { 348 "input": "WebTransaction/ZipZap/a/b/c", 349 "expected": "WebTransaction/ZipZap/a/b/c" 350 } 351 ] 352 }, 353 { 354 "testname": "one_bad_rule_does_not_scrap_all_rules", 355 "transaction_segment_terms": [ 356 { 357 "prefix": "WebTransaction/MissingTerms" 358 }, 359 { 360 "prefix": "WebTransaction/Uri", 361 "terms": ["seven", "eight", "nine"] 362 } 363 ], 364 "tests": [ 365 { 366 "input": "WebTransaction/Uri/one/two/seven/user/nine/account", 367 "expected": "WebTransaction/Uri/*/seven/*/nine/*" 368 } 369 ] 370 }, 371 { 372 "testname": "one_bad_matching_rule_at_end_does_not_scrap_other_matching_rules", 373 "transaction_segment_terms": [ 374 { 375 "prefix": "WebTransaction/Uri", 376 "terms": ["seven", "eight", "nine"] 377 }, 378 { 379 "prefix": "WebTransaction/Uri" 380 } 381 ], 382 "tests": [ 383 { 384 "input": "WebTransaction/Uri/one/two/seven/user/nine/account", 385 "expected": "WebTransaction/Uri/*/seven/*/nine/*" 386 } 387 ] 388 } 389 ]