sentry-cli 2.31.2__tar.gz → 2.32.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/Cargo.lock +97 -27
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/Cargo.toml +4 -2
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/PKG-INFO +1 -1
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/sentry_cli.egg-info/PKG-INFO +1 -1
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/sentry_cli.egg-info/SOURCES.txt +10 -0
- sentry_cli-2.32.1/src/api/envelopes_api.rs +39 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/api/errors/api_error.rs +6 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/api/mod.rs +7 -0
- sentry_cli-2.32.1/src/commands/derive_parser.rs +36 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/mod.rs +3 -0
- sentry_cli-2.32.1/src/commands/send_metric/common_args.rs +67 -0
- sentry_cli-2.32.1/src/commands/send_metric/distribution.rs +15 -0
- sentry_cli-2.32.1/src/commands/send_metric/gauge.rs +15 -0
- sentry_cli-2.32.1/src/commands/send_metric/increment.rs +26 -0
- sentry_cli-2.32.1/src/commands/send_metric/mod.rs +57 -0
- sentry_cli-2.32.1/src/commands/send_metric/set.rs +29 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/config.rs +8 -5
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/constants.rs +3 -0
- sentry_cli-2.32.1/src/utils/metrics.rs +29 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/mod.rs +2 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/releases.rs +15 -1
- sentry_cli-2.32.1/src/utils/value_parsers.rs +8 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/LICENSE +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/MANIFEST.in +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/README.md +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/build.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/pyproject.toml +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/sentry_cli.egg-info/dependency_links.txt +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/sentry_cli.egg-info/top_level.txt +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/setup.cfg +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/setup.py +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/api/connection_manager.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/api/encoding.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/api/errors/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/api/errors/sentry_error.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/api/pagination.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/bashsupport.sh +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/bash_hook.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/debug_files/bundle_jvm.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/debug_files/bundle_sources.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/debug_files/check.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/debug_files/find.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/debug_files/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/debug_files/print_sources.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/debug_files/upload.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/deploys/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/deploys/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/deploys/new.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/events/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/events/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/files/delete.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/files/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/files/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/files/upload.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/info.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/issues/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/issues/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/issues/mute.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/issues/resolve.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/issues/unresolve.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/login.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/monitors/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/monitors/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/monitors/run.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/organizations/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/organizations/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/projects/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/projects/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/react_native/appcenter.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/react_native/gradle.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/react_native/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/react_native/xcode.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/archive.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/delete.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/finalize.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/info.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/new.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/propose_version.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/restore.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/releases/set_commits.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/repos/list.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/repos/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/send_envelope.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/send_event.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/sourcemaps/explain.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/sourcemaps/inject.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/sourcemaps/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/sourcemaps/resolve.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/sourcemaps/upload.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/uninstall.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/update.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/upload_dif.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/upload_dsym.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/commands/upload_proguard.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/main.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/android.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/appcenter.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/args.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/auth_token/auth_token_impl.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/auth_token/error.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/auth_token/mod.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/auth_token/org_auth_token.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/auth_token/test.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/auth_token/user_auth_token.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/chunks.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/cordova.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/dif.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/dif_upload.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/event.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/file_search.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/file_upload.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/formatting.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/fs.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/http.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/logging.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/progress.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/retry.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_default_twenty.snap +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_ignore_missing.snap +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_base.snap +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/snapshots/sentry_cli__utils__vcs__generate_patch_set_previous_commit.snap +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/snapshots/sentry_cli__utils__vcs__get_commits_from_git.snap +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/sourcemaps/inject.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/sourcemaps.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/system.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/ui.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/update.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/vcs.rs +0 -0
- {sentry_cli-2.31.2 → sentry_cli-2.32.1}/src/utils/xcode.rs +0 -0
|
@@ -356,7 +356,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
356
356
|
checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3"
|
|
357
357
|
dependencies = [
|
|
358
358
|
"bitflags 1.3.2",
|
|
359
|
+
"clap_derive",
|
|
359
360
|
"clap_lex",
|
|
361
|
+
"once_cell",
|
|
360
362
|
"strsim",
|
|
361
363
|
"terminal_size",
|
|
362
364
|
]
|
|
@@ -370,6 +372,19 @@ dependencies = [
|
|
|
370
372
|
"clap",
|
|
371
373
|
]
|
|
372
374
|
|
|
375
|
+
[[package]]
|
|
376
|
+
name = "clap_derive"
|
|
377
|
+
version = "4.1.0"
|
|
378
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
379
|
+
checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8"
|
|
380
|
+
dependencies = [
|
|
381
|
+
"heck",
|
|
382
|
+
"proc-macro-error",
|
|
383
|
+
"proc-macro2",
|
|
384
|
+
"quote",
|
|
385
|
+
"syn 1.0.107",
|
|
386
|
+
]
|
|
387
|
+
|
|
373
388
|
[[package]]
|
|
374
389
|
name = "clap_lex"
|
|
375
390
|
version = "0.3.1"
|
|
@@ -462,9 +477,9 @@ dependencies = [
|
|
|
462
477
|
|
|
463
478
|
[[package]]
|
|
464
479
|
name = "crc32fast"
|
|
465
|
-
version = "1.
|
|
480
|
+
version = "1.4.0"
|
|
466
481
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
467
|
-
checksum = "
|
|
482
|
+
checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa"
|
|
468
483
|
dependencies = [
|
|
469
484
|
"cfg-if",
|
|
470
485
|
]
|
|
@@ -1086,6 +1101,12 @@ version = "0.14.0"
|
|
|
1086
1101
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1087
1102
|
checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
|
|
1088
1103
|
|
|
1104
|
+
[[package]]
|
|
1105
|
+
name = "heck"
|
|
1106
|
+
version = "0.4.1"
|
|
1107
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1108
|
+
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
|
1109
|
+
|
|
1089
1110
|
[[package]]
|
|
1090
1111
|
name = "hermit-abi"
|
|
1091
1112
|
version = "0.1.19"
|
|
@@ -1121,13 +1142,13 @@ dependencies = [
|
|
|
1121
1142
|
|
|
1122
1143
|
[[package]]
|
|
1123
1144
|
name = "hostname"
|
|
1124
|
-
version = "0.
|
|
1145
|
+
version = "0.4.0"
|
|
1125
1146
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1126
|
-
checksum = "
|
|
1147
|
+
checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba"
|
|
1127
1148
|
dependencies = [
|
|
1149
|
+
"cfg-if",
|
|
1128
1150
|
"libc",
|
|
1129
|
-
"
|
|
1130
|
-
"winapi 0.3.9",
|
|
1151
|
+
"windows",
|
|
1131
1152
|
]
|
|
1132
1153
|
|
|
1133
1154
|
[[package]]
|
|
@@ -1318,6 +1339,15 @@ dependencies = [
|
|
|
1318
1339
|
"either",
|
|
1319
1340
|
]
|
|
1320
1341
|
|
|
1342
|
+
[[package]]
|
|
1343
|
+
name = "itertools"
|
|
1344
|
+
version = "0.13.0"
|
|
1345
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1346
|
+
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
|
|
1347
|
+
dependencies = [
|
|
1348
|
+
"either",
|
|
1349
|
+
]
|
|
1350
|
+
|
|
1321
1351
|
[[package]]
|
|
1322
1352
|
name = "itoa"
|
|
1323
1353
|
version = "0.4.8"
|
|
@@ -1484,12 +1514,6 @@ dependencies = [
|
|
|
1484
1514
|
"vlq",
|
|
1485
1515
|
]
|
|
1486
1516
|
|
|
1487
|
-
[[package]]
|
|
1488
|
-
name = "match_cfg"
|
|
1489
|
-
version = "0.1.0"
|
|
1490
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1491
|
-
checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
|
|
1492
|
-
|
|
1493
1517
|
[[package]]
|
|
1494
1518
|
name = "maybe-owned"
|
|
1495
1519
|
version = "0.3.4"
|
|
@@ -1981,7 +2005,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd"
|
|
|
1981
2005
|
dependencies = [
|
|
1982
2006
|
"difflib",
|
|
1983
2007
|
"float-cmp",
|
|
1984
|
-
"itertools",
|
|
2008
|
+
"itertools 0.10.5",
|
|
1985
2009
|
"normalize-line-endings",
|
|
1986
2010
|
"predicates-core",
|
|
1987
2011
|
"regex",
|
|
@@ -2007,6 +2031,30 @@ dependencies = [
|
|
|
2007
2031
|
"unicode-width",
|
|
2008
2032
|
]
|
|
2009
2033
|
|
|
2034
|
+
[[package]]
|
|
2035
|
+
name = "proc-macro-error"
|
|
2036
|
+
version = "1.0.4"
|
|
2037
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2038
|
+
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
|
2039
|
+
dependencies = [
|
|
2040
|
+
"proc-macro-error-attr",
|
|
2041
|
+
"proc-macro2",
|
|
2042
|
+
"quote",
|
|
2043
|
+
"syn 1.0.107",
|
|
2044
|
+
"version_check",
|
|
2045
|
+
]
|
|
2046
|
+
|
|
2047
|
+
[[package]]
|
|
2048
|
+
name = "proc-macro-error-attr"
|
|
2049
|
+
version = "1.0.4"
|
|
2050
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2051
|
+
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
|
2052
|
+
dependencies = [
|
|
2053
|
+
"proc-macro2",
|
|
2054
|
+
"quote",
|
|
2055
|
+
"version_check",
|
|
2056
|
+
]
|
|
2057
|
+
|
|
2010
2058
|
[[package]]
|
|
2011
2059
|
name = "proc-macro2"
|
|
2012
2060
|
version = "1.0.66"
|
|
@@ -2396,9 +2444,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
|
|
2396
2444
|
|
|
2397
2445
|
[[package]]
|
|
2398
2446
|
name = "sentry"
|
|
2399
|
-
version = "0.
|
|
2447
|
+
version = "0.33.0"
|
|
2400
2448
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2401
|
-
checksum = "
|
|
2449
|
+
checksum = "3b73ab9d5b35ed718611e89db8c886647821cfce79723b9e2e4e7cb3fd9cdd49"
|
|
2402
2450
|
dependencies = [
|
|
2403
2451
|
"curl",
|
|
2404
2452
|
"httpdate",
|
|
@@ -2409,9 +2457,9 @@ dependencies = [
|
|
|
2409
2457
|
|
|
2410
2458
|
[[package]]
|
|
2411
2459
|
name = "sentry-anyhow"
|
|
2412
|
-
version = "0.
|
|
2460
|
+
version = "0.33.0"
|
|
2413
2461
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2414
|
-
checksum = "
|
|
2462
|
+
checksum = "3c7825549eb646ef0224b0b7fc6d38faa459d7e5e1f902a4c12bbd8de4ad060f"
|
|
2415
2463
|
dependencies = [
|
|
2416
2464
|
"anyhow",
|
|
2417
2465
|
"sentry-backtrace",
|
|
@@ -2420,9 +2468,9 @@ dependencies = [
|
|
|
2420
2468
|
|
|
2421
2469
|
[[package]]
|
|
2422
2470
|
name = "sentry-backtrace"
|
|
2423
|
-
version = "0.
|
|
2471
|
+
version = "0.33.0"
|
|
2424
2472
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2425
|
-
checksum = "
|
|
2473
|
+
checksum = "8ce52a2633e0332821389f865762b94852e71b359cd8e95cbf91f38c154302cb"
|
|
2426
2474
|
dependencies = [
|
|
2427
2475
|
"backtrace",
|
|
2428
2476
|
"once_cell",
|
|
@@ -2432,7 +2480,7 @@ dependencies = [
|
|
|
2432
2480
|
|
|
2433
2481
|
[[package]]
|
|
2434
2482
|
name = "sentry-cli"
|
|
2435
|
-
version = "2.
|
|
2483
|
+
version = "2.32.1"
|
|
2436
2484
|
dependencies = [
|
|
2437
2485
|
"anyhow",
|
|
2438
2486
|
"anylog",
|
|
@@ -2460,7 +2508,7 @@ dependencies = [
|
|
|
2460
2508
|
"ignore",
|
|
2461
2509
|
"indicatif",
|
|
2462
2510
|
"insta",
|
|
2463
|
-
"itertools",
|
|
2511
|
+
"itertools 0.10.5",
|
|
2464
2512
|
"java-properties",
|
|
2465
2513
|
"lazy_static",
|
|
2466
2514
|
"libc",
|
|
@@ -2508,9 +2556,9 @@ dependencies = [
|
|
|
2508
2556
|
|
|
2509
2557
|
[[package]]
|
|
2510
2558
|
name = "sentry-contexts"
|
|
2511
|
-
version = "0.
|
|
2559
|
+
version = "0.33.0"
|
|
2512
2560
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2513
|
-
checksum = "
|
|
2561
|
+
checksum = "10565e6eb013737bf7555250f8b4b8248a571e1de4de7230037f5dd5ea51bc63"
|
|
2514
2562
|
dependencies = [
|
|
2515
2563
|
"hostname",
|
|
2516
2564
|
"libc",
|
|
@@ -2522,12 +2570,15 @@ dependencies = [
|
|
|
2522
2570
|
|
|
2523
2571
|
[[package]]
|
|
2524
2572
|
name = "sentry-core"
|
|
2525
|
-
version = "0.
|
|
2573
|
+
version = "0.33.0"
|
|
2526
2574
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2527
|
-
checksum = "
|
|
2575
|
+
checksum = "a2c5e7a0430cfa86b7cb6e7bc01a56331937b2ba08ab703c2e7331139a99f121"
|
|
2528
2576
|
dependencies = [
|
|
2577
|
+
"crc32fast",
|
|
2578
|
+
"itertools 0.13.0",
|
|
2529
2579
|
"once_cell",
|
|
2530
2580
|
"rand",
|
|
2581
|
+
"regex",
|
|
2531
2582
|
"sentry-types",
|
|
2532
2583
|
"serde",
|
|
2533
2584
|
"serde_json",
|
|
@@ -2535,9 +2586,9 @@ dependencies = [
|
|
|
2535
2586
|
|
|
2536
2587
|
[[package]]
|
|
2537
2588
|
name = "sentry-types"
|
|
2538
|
-
version = "0.
|
|
2589
|
+
version = "0.33.0"
|
|
2539
2590
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2540
|
-
checksum = "
|
|
2591
|
+
checksum = "10d5ad9e33b9f6f598387a6a23aa23c7f13e4e7740a34cd4d9c8db851bfdae05"
|
|
2541
2592
|
dependencies = [
|
|
2542
2593
|
"debugid",
|
|
2543
2594
|
"hex",
|
|
@@ -3355,6 +3406,25 @@ version = "0.4.0"
|
|
|
3355
3406
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3356
3407
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
3357
3408
|
|
|
3409
|
+
[[package]]
|
|
3410
|
+
name = "windows"
|
|
3411
|
+
version = "0.52.0"
|
|
3412
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3413
|
+
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
|
|
3414
|
+
dependencies = [
|
|
3415
|
+
"windows-core",
|
|
3416
|
+
"windows-targets 0.52.0",
|
|
3417
|
+
]
|
|
3418
|
+
|
|
3419
|
+
[[package]]
|
|
3420
|
+
name = "windows-core"
|
|
3421
|
+
version = "0.52.0"
|
|
3422
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3423
|
+
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
|
|
3424
|
+
dependencies = [
|
|
3425
|
+
"windows-targets 0.52.0",
|
|
3426
|
+
]
|
|
3427
|
+
|
|
3358
3428
|
[[package]]
|
|
3359
3429
|
name = "windows-sys"
|
|
3360
3430
|
version = "0.42.0"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
authors = ["Armin Ronacher <armin.ronacher@active-4.com>"]
|
|
3
3
|
build = "build.rs"
|
|
4
4
|
name = "sentry-cli"
|
|
5
|
-
version = "2.
|
|
5
|
+
version = "2.32.1"
|
|
6
6
|
edition = "2021"
|
|
7
7
|
rust-version = "1.65"
|
|
8
8
|
|
|
@@ -16,6 +16,7 @@ bytecount = "0.6.3"
|
|
|
16
16
|
chardet = "0.2.4"
|
|
17
17
|
chrono = { version = "0.4.31", features = ["serde"] }
|
|
18
18
|
clap = { version = "4.1.6", default-features = false, features = [
|
|
19
|
+
"derive",
|
|
19
20
|
"std",
|
|
20
21
|
"suggestions",
|
|
21
22
|
"wrap_help",
|
|
@@ -58,10 +59,11 @@ regex = "1.7.3"
|
|
|
58
59
|
runas = "1.0.0"
|
|
59
60
|
rust-ini = "0.18.0"
|
|
60
61
|
semver = "1.0.16"
|
|
61
|
-
sentry = { version = "0.
|
|
62
|
+
sentry = { version = "0.33.0", default-features = false, features = [
|
|
62
63
|
"anyhow",
|
|
63
64
|
"curl",
|
|
64
65
|
"contexts",
|
|
66
|
+
"UNSTABLE_metrics",
|
|
65
67
|
] }
|
|
66
68
|
serde = { version = "1.0.152", features = ["derive"] }
|
|
67
69
|
serde_json = "1.0.93"
|
|
@@ -17,12 +17,14 @@ src/constants.rs
|
|
|
17
17
|
src/main.rs
|
|
18
18
|
src/api/connection_manager.rs
|
|
19
19
|
src/api/encoding.rs
|
|
20
|
+
src/api/envelopes_api.rs
|
|
20
21
|
src/api/mod.rs
|
|
21
22
|
src/api/pagination.rs
|
|
22
23
|
src/api/errors/api_error.rs
|
|
23
24
|
src/api/errors/mod.rs
|
|
24
25
|
src/api/errors/sentry_error.rs
|
|
25
26
|
src/commands/bash_hook.rs
|
|
27
|
+
src/commands/derive_parser.rs
|
|
26
28
|
src/commands/info.rs
|
|
27
29
|
src/commands/login.rs
|
|
28
30
|
src/commands/mod.rs
|
|
@@ -77,6 +79,12 @@ src/commands/releases/restore.rs
|
|
|
77
79
|
src/commands/releases/set_commits.rs
|
|
78
80
|
src/commands/repos/list.rs
|
|
79
81
|
src/commands/repos/mod.rs
|
|
82
|
+
src/commands/send_metric/common_args.rs
|
|
83
|
+
src/commands/send_metric/distribution.rs
|
|
84
|
+
src/commands/send_metric/gauge.rs
|
|
85
|
+
src/commands/send_metric/increment.rs
|
|
86
|
+
src/commands/send_metric/mod.rs
|
|
87
|
+
src/commands/send_metric/set.rs
|
|
80
88
|
src/commands/sourcemaps/explain.rs
|
|
81
89
|
src/commands/sourcemaps/inject.rs
|
|
82
90
|
src/commands/sourcemaps/mod.rs
|
|
@@ -96,6 +104,7 @@ src/utils/formatting.rs
|
|
|
96
104
|
src/utils/fs.rs
|
|
97
105
|
src/utils/http.rs
|
|
98
106
|
src/utils/logging.rs
|
|
107
|
+
src/utils/metrics.rs
|
|
99
108
|
src/utils/mod.rs
|
|
100
109
|
src/utils/progress.rs
|
|
101
110
|
src/utils/releases.rs
|
|
@@ -104,6 +113,7 @@ src/utils/sourcemaps.rs
|
|
|
104
113
|
src/utils/system.rs
|
|
105
114
|
src/utils/ui.rs
|
|
106
115
|
src/utils/update.rs
|
|
116
|
+
src/utils/value_parsers.rs
|
|
107
117
|
src/utils/vcs.rs
|
|
108
118
|
src/utils/xcode.rs
|
|
109
119
|
src/utils/auth_token/auth_token_impl.rs
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
use super::{
|
|
2
|
+
errors::{ApiErrorKind, ApiResult},
|
|
3
|
+
Api, ApiResponse, Method,
|
|
4
|
+
};
|
|
5
|
+
use crate::{api::errors::ApiError, constants::USER_AGENT};
|
|
6
|
+
use log::debug;
|
|
7
|
+
use sentry::{types::Dsn, Envelope};
|
|
8
|
+
use std::sync::Arc;
|
|
9
|
+
|
|
10
|
+
pub struct EnvelopesApi {
|
|
11
|
+
api: Arc<Api>,
|
|
12
|
+
dsn: Dsn,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
impl EnvelopesApi {
|
|
16
|
+
pub fn try_new() -> ApiResult<EnvelopesApi> {
|
|
17
|
+
let api = Api::current();
|
|
18
|
+
api.config
|
|
19
|
+
.get_dsn()
|
|
20
|
+
.map(|dsn| EnvelopesApi { api, dsn })
|
|
21
|
+
.map_err(|_| ApiErrorKind::DsnMissing.into())
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
pub fn send_envelope(&self, envelope: Envelope) -> ApiResult<ApiResponse> {
|
|
25
|
+
let mut body = vec![];
|
|
26
|
+
envelope
|
|
27
|
+
.to_writer(&mut body)
|
|
28
|
+
.map_err(|e| ApiError::with_source(ApiErrorKind::CannotSerializeEnvelope, e))?;
|
|
29
|
+
let url = self.dsn.envelope_api_url();
|
|
30
|
+
let auth = self.dsn.to_auth(Some(USER_AGENT));
|
|
31
|
+
debug!("Sending envelope:\n{}", String::from_utf8_lossy(&body));
|
|
32
|
+
self.api
|
|
33
|
+
.request(Method::Post, url.as_str(), None)?
|
|
34
|
+
.with_header("X-Sentry-Auth", &auth.to_string())?
|
|
35
|
+
.with_body(body)?
|
|
36
|
+
.send()?
|
|
37
|
+
.into_result()
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -12,6 +12,8 @@ pub struct ApiError {
|
|
|
12
12
|
pub(in crate::api) enum ApiErrorKind {
|
|
13
13
|
#[error("could not serialize value as JSON")]
|
|
14
14
|
CannotSerializeAsJson,
|
|
15
|
+
#[error("could not serialize envelope")]
|
|
16
|
+
CannotSerializeEnvelope,
|
|
15
17
|
#[error("could not parse JSON response")]
|
|
16
18
|
BadJson,
|
|
17
19
|
#[error("not a JSON response")]
|
|
@@ -38,6 +40,10 @@ pub(in crate::api) enum ApiErrorKind {
|
|
|
38
40
|
"Auth token is required for this request. Please run `sentry-cli login` and try again!"
|
|
39
41
|
)]
|
|
40
42
|
AuthMissing,
|
|
43
|
+
#[error(
|
|
44
|
+
"DSN missing. Please set the `SENTRY_DSN` environment variable to your project's DSN."
|
|
45
|
+
)]
|
|
46
|
+
DsnMissing,
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
impl fmt::Display for ApiError {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
//! to the GitHub API to figure out if there are new releases of the
|
|
4
4
|
//! sentry-cli tool.
|
|
5
5
|
|
|
6
|
+
pub mod envelopes_api;
|
|
7
|
+
|
|
6
8
|
mod connection_manager;
|
|
7
9
|
mod encoding;
|
|
8
10
|
mod errors;
|
|
@@ -1746,6 +1748,11 @@ impl ApiRequest {
|
|
|
1746
1748
|
Ok(self)
|
|
1747
1749
|
}
|
|
1748
1750
|
|
|
1751
|
+
pub fn with_body(mut self, body: Vec<u8>) -> ApiResult<Self> {
|
|
1752
|
+
self.body = Some(body);
|
|
1753
|
+
Ok(self)
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1749
1756
|
/// attaches some form data to the request.
|
|
1750
1757
|
pub fn with_form_data(mut self, form: curl::easy::Form) -> ApiResult<Self> {
|
|
1751
1758
|
debug!("sending form data");
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
use crate::utils::auth_token::AuthToken;
|
|
2
|
+
use crate::utils::value_parsers::kv_parser;
|
|
3
|
+
use clap::{command, value_parser, ArgAction::SetTrue, Parser, Subcommand};
|
|
4
|
+
|
|
5
|
+
use super::send_metric::SendMetricArgs;
|
|
6
|
+
|
|
7
|
+
#[derive(Parser)]
|
|
8
|
+
pub(super) struct SentryCLI {
|
|
9
|
+
#[command(subcommand)]
|
|
10
|
+
pub(super) command: SentryCLICommand,
|
|
11
|
+
|
|
12
|
+
#[arg(global=true, long="header", value_name="KEY:VALUE", value_parser=kv_parser)]
|
|
13
|
+
#[arg(help = "Custom headers that should be attached to all requests{n}in key:value format")]
|
|
14
|
+
pub(super) headers: Vec<(String, String)>,
|
|
15
|
+
|
|
16
|
+
#[arg(global=true, long, value_parser=value_parser!(AuthToken))]
|
|
17
|
+
#[arg(help = "Use the given Sentry auth token")]
|
|
18
|
+
pub(super) auth_token: Option<AuthToken>,
|
|
19
|
+
|
|
20
|
+
#[arg(global=true, ignore_case=true, value_parser=["trace", "debug", "info", "warn", "error"])]
|
|
21
|
+
#[arg(long, help = "Set the log output verbosity")]
|
|
22
|
+
pub(super) log_level: Option<String>,
|
|
23
|
+
|
|
24
|
+
#[arg(global=true, action=SetTrue, visible_alias="silent", long)]
|
|
25
|
+
#[arg(help = "Do not print any output while preserving correct exit code. \
|
|
26
|
+
This flag is currently implemented only for selected subcommands")]
|
|
27
|
+
pub(super) quiet: bool,
|
|
28
|
+
|
|
29
|
+
#[arg(global=true, action=SetTrue, long, hide=true, help="Always return 0 exit code")]
|
|
30
|
+
pub(super) allow_failure: bool,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#[derive(Subcommand)]
|
|
34
|
+
pub(super) enum SentryCLICommand {
|
|
35
|
+
SendMetric(SendMetricArgs),
|
|
36
|
+
}
|
|
@@ -18,6 +18,8 @@ use crate::utils::logging::Logger;
|
|
|
18
18
|
use crate::utils::system::{init_backtrace, load_dotenv, print_error, QuietExit};
|
|
19
19
|
use crate::utils::update::run_sentrycli_update_nagger;
|
|
20
20
|
|
|
21
|
+
mod derive_parser;
|
|
22
|
+
|
|
21
23
|
macro_rules! each_subcommand {
|
|
22
24
|
($mac:ident) => {
|
|
23
25
|
$mac!(bash_hook);
|
|
@@ -36,6 +38,7 @@ macro_rules! each_subcommand {
|
|
|
36
38
|
$mac!(repos);
|
|
37
39
|
$mac!(send_event);
|
|
38
40
|
$mac!(send_envelope);
|
|
41
|
+
$mac!(send_metric);
|
|
39
42
|
$mac!(sourcemaps);
|
|
40
43
|
#[cfg(not(feature = "managed"))]
|
|
41
44
|
$mac!(uninstall);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
use crate::utils::value_parsers;
|
|
2
|
+
use anyhow::{anyhow, Result};
|
|
3
|
+
use clap::command;
|
|
4
|
+
use clap::Args;
|
|
5
|
+
use sentry::metrics::MetricStr;
|
|
6
|
+
use std::str::FromStr;
|
|
7
|
+
|
|
8
|
+
/// Arguments for send-metric subcommands using float as value type and no default value.
|
|
9
|
+
#[derive(Args)]
|
|
10
|
+
pub(super) struct FloatValueMetricArgs {
|
|
11
|
+
#[command(flatten)]
|
|
12
|
+
pub(super) common: CommonMetricArgs,
|
|
13
|
+
|
|
14
|
+
#[arg(short, long, help = "Metric value, any finite 64 bit float.")]
|
|
15
|
+
pub(super) value: f64,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/// Common arguments for all send-metric subcommands.
|
|
19
|
+
#[derive(Args)]
|
|
20
|
+
pub(super) struct CommonMetricArgs {
|
|
21
|
+
#[arg(short, long)]
|
|
22
|
+
#[arg(help = "The name of the metric, identifying it in Sentry.")]
|
|
23
|
+
pub(super) name: MetricName,
|
|
24
|
+
|
|
25
|
+
#[arg(short, long)]
|
|
26
|
+
#[arg(
|
|
27
|
+
help = "Any custom unit. You can have multiple metrics with the same name but different \
|
|
28
|
+
units."
|
|
29
|
+
)]
|
|
30
|
+
pub(super) unit: Option<String>,
|
|
31
|
+
|
|
32
|
+
#[arg(short, long, value_delimiter=',', value_name = "KEY:VALUE", num_args = 1..)]
|
|
33
|
+
#[arg(value_parser=value_parsers::kv_parser)]
|
|
34
|
+
#[arg(
|
|
35
|
+
help = "Metric tags as key:value pairs. Tags allow you to add dimensions to your metrics \
|
|
36
|
+
and can be filtered or grouped by in Sentry."
|
|
37
|
+
)]
|
|
38
|
+
pub(super) tags: Vec<(String, String)>,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#[derive(Clone)]
|
|
42
|
+
pub(super) struct MetricName(String);
|
|
43
|
+
|
|
44
|
+
impl FromStr for MetricName {
|
|
45
|
+
type Err = anyhow::Error;
|
|
46
|
+
|
|
47
|
+
/// Metric name must start with an alphabetic character.
|
|
48
|
+
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
49
|
+
if s.chars()
|
|
50
|
+
.next()
|
|
51
|
+
.ok_or_else(|| anyhow!("metric name cannot be empty"))?
|
|
52
|
+
.is_ascii_alphabetic()
|
|
53
|
+
{
|
|
54
|
+
Ok(MetricName(s.to_string()))
|
|
55
|
+
} else {
|
|
56
|
+
Err(anyhow!(
|
|
57
|
+
"metric name must start with an alphabetic character"
|
|
58
|
+
))
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
impl From<MetricName> for MetricStr {
|
|
64
|
+
fn from(name: MetricName) -> MetricStr {
|
|
65
|
+
MetricStr::from(name.0)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
use super::common_args::FloatValueMetricArgs;
|
|
2
|
+
use crate::{api::envelopes_api::EnvelopesApi, utils::metrics::DefaultTags};
|
|
3
|
+
use anyhow::Result;
|
|
4
|
+
use sentry::metrics::Metric;
|
|
5
|
+
|
|
6
|
+
pub(super) fn execute(args: FloatValueMetricArgs) -> Result<()> {
|
|
7
|
+
EnvelopesApi::try_new()?.send_envelope(
|
|
8
|
+
Metric::distribution(args.common.name, args.value)
|
|
9
|
+
.with_unit(args.common.unit)
|
|
10
|
+
.with_tags(args.common.tags.with_default_tags())
|
|
11
|
+
.finish()
|
|
12
|
+
.to_envelope(),
|
|
13
|
+
)?;
|
|
14
|
+
Ok(())
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
use super::common_args::FloatValueMetricArgs;
|
|
2
|
+
use crate::{api::envelopes_api::EnvelopesApi, utils::metrics::DefaultTags};
|
|
3
|
+
use anyhow::Result;
|
|
4
|
+
use sentry::metrics::Metric;
|
|
5
|
+
|
|
6
|
+
pub(super) fn execute(args: FloatValueMetricArgs) -> Result<()> {
|
|
7
|
+
EnvelopesApi::try_new()?.send_envelope(
|
|
8
|
+
Metric::gauge(args.common.name, args.value)
|
|
9
|
+
.with_unit(args.common.unit)
|
|
10
|
+
.with_tags(args.common.tags.with_default_tags())
|
|
11
|
+
.finish()
|
|
12
|
+
.to_envelope(),
|
|
13
|
+
)?;
|
|
14
|
+
Ok(())
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use super::common_args::CommonMetricArgs;
|
|
2
|
+
use crate::{api::envelopes_api::EnvelopesApi, utils::metrics::DefaultTags};
|
|
3
|
+
use anyhow::Result;
|
|
4
|
+
use clap::{command, Args};
|
|
5
|
+
use sentry::metrics::Metric;
|
|
6
|
+
|
|
7
|
+
#[derive(Args)]
|
|
8
|
+
pub(super) struct IncrementMetricArgs {
|
|
9
|
+
#[command(flatten)]
|
|
10
|
+
common: CommonMetricArgs,
|
|
11
|
+
|
|
12
|
+
#[arg(short, long, default_value = "1")]
|
|
13
|
+
#[arg(help = "Value to increment the metric by, any finite 64 bit float.")]
|
|
14
|
+
value: f64,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
pub(super) fn execute(args: IncrementMetricArgs) -> Result<()> {
|
|
18
|
+
EnvelopesApi::try_new()?.send_envelope(
|
|
19
|
+
Metric::incr(args.common.name, args.value)
|
|
20
|
+
.with_unit(args.common.unit)
|
|
21
|
+
.with_tags(args.common.tags.with_default_tags())
|
|
22
|
+
.finish()
|
|
23
|
+
.to_envelope(),
|
|
24
|
+
)?;
|
|
25
|
+
Ok(())
|
|
26
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
pub mod common_args;
|
|
2
|
+
|
|
3
|
+
mod distribution;
|
|
4
|
+
mod gauge;
|
|
5
|
+
mod increment;
|
|
6
|
+
mod set;
|
|
7
|
+
|
|
8
|
+
use self::common_args::FloatValueMetricArgs;
|
|
9
|
+
use self::increment::IncrementMetricArgs;
|
|
10
|
+
use self::set::SetMetricArgs;
|
|
11
|
+
use super::derive_parser::{SentryCLI, SentryCLICommand};
|
|
12
|
+
use anyhow::Result;
|
|
13
|
+
use clap::{command, Args, Subcommand};
|
|
14
|
+
use clap::{ArgMatches, Command, Parser};
|
|
15
|
+
|
|
16
|
+
#[derive(Args)]
|
|
17
|
+
pub(super) struct SendMetricArgs {
|
|
18
|
+
#[command(subcommand)]
|
|
19
|
+
subcommand: SendMetricSubcommand,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#[derive(Subcommand)]
|
|
23
|
+
#[command(about = "Send a metric to Sentry.")]
|
|
24
|
+
#[command(long_about = "Send a metric event to Sentry.{n}{n}\
|
|
25
|
+
This command will validate input parameters and attempt to send a metric to \
|
|
26
|
+
Sentry. Due to network errors and rate limits, the metric is not guaranteed to \
|
|
27
|
+
arrive. Check the debug output for transmission errors by passing --log-level=\
|
|
28
|
+
debug or setting `SENTRY_LOG_LEVEL=debug`.")]
|
|
29
|
+
enum SendMetricSubcommand {
|
|
30
|
+
#[command(about = "Increment a counter metric")]
|
|
31
|
+
Increment(IncrementMetricArgs),
|
|
32
|
+
#[command(about = "Update a distribution metric with the provided value")]
|
|
33
|
+
Distribution(FloatValueMetricArgs),
|
|
34
|
+
#[command(about = "Update a gauge metric with the provided value")]
|
|
35
|
+
Gauge(FloatValueMetricArgs),
|
|
36
|
+
#[command(about = "Update a set metric with the provided value")]
|
|
37
|
+
Set(SetMetricArgs),
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub(super) fn make_command(command: Command) -> Command {
|
|
41
|
+
SendMetricSubcommand::augment_subcommands(command)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
pub(super) fn execute(_: &ArgMatches) -> Result<()> {
|
|
45
|
+
// When adding a new subcommand to the derive_parser SentryCLI, replace the line below with the following:
|
|
46
|
+
// let subcommand = match SentryCLI::parse().command {
|
|
47
|
+
// SentryCLICommand::SendMetric(SendMetricArgs { subcommand }) => subcommand,
|
|
48
|
+
// _ => panic!("expected send-metric subcommand"),
|
|
49
|
+
// };
|
|
50
|
+
let SentryCLICommand::SendMetric(SendMetricArgs { subcommand }) = SentryCLI::parse().command;
|
|
51
|
+
match subcommand {
|
|
52
|
+
SendMetricSubcommand::Increment(args) => increment::execute(args),
|
|
53
|
+
SendMetricSubcommand::Distribution(args) => distribution::execute(args),
|
|
54
|
+
SendMetricSubcommand::Gauge(args) => gauge::execute(args),
|
|
55
|
+
SendMetricSubcommand::Set(args) => set::execute(args),
|
|
56
|
+
}
|
|
57
|
+
}
|