@cryptotaxi247 / netdata-1 / commits / ffcec41d4

Add sentry error reporting (#21558)

* Add sentry error reporting * Do not report filter expression to sentry

vkalintiris committed Jan 14, 2026 at 22:14 UTC ffcec41d4e844d0ca5fcb08e286356857e38b1b5
5 files changed +633 -25
src/crates/Cargo.lock
+529 -16
@@ -334,6 +334,15 @@ version = "2.10.0"
334 source = "registry+https://github.com/rust-lang/crates.io-index"
335 checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
336
337 +[[package]]
338 +name = "block2"
339 +version = "0.6.2"
340 +source = "registry+https://github.com/rust-lang/crates.io-index"
341 +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
342 +dependencies = [
343 + "objc2",
344 +]
345 +
346 [[package]]
347 name = "bridge"
348 version = "0.1.0"
@@ -657,6 +666,35 @@ dependencies = [
666 "syn 1.0.109",
667 ]
668
669 +[[package]]
670 +name = "debugid"
671 +version = "0.8.0"
672 +source = "registry+https://github.com/rust-lang/crates.io-index"
673 +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
674 +dependencies = [
675 + "serde",
676 + "uuid",
677 +]
678 +
679 +[[package]]
680 +name = "deranged"
681 +version = "0.5.5"
682 +source = "registry+https://github.com/rust-lang/crates.io-index"
683 +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587"
684 +dependencies = [
685 + "powerfmt",
686 +]
687 +
688 +[[package]]
689 +name = "dispatch2"
690 +version = "0.3.0"
691 +source = "registry+https://github.com/rust-lang/crates.io-index"
692 +checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
693 +dependencies = [
694 + "bitflags 2.10.0",
695 + "objc2",
696 +]
697 +
698 [[package]]
699 name = "displaydoc"
700 version = "0.2.5"
@@ -833,7 +871,7 @@ dependencies = [
871 "mixtrics",
872 "pin-project",
873 "serde",
836 - "thiserror",
874 + "thiserror 2.0.17",
875 "tokio",
876 "tracing",
877 ]
@@ -853,7 +891,7 @@ dependencies = [
891 "parking_lot",
892 "pin-project",
893 "serde",
856 - "thiserror",
894 + "thiserror 2.0.17",
895 "tokio",
896 "twox-hash",
897 ]
@@ -886,7 +924,7 @@ dependencies = [
924 "parking_lot",
925 "pin-project",
926 "serde",
889 - "thiserror",
927 + "thiserror 2.0.17",
928 "tokio",
929 "tracing",
930 ]
@@ -919,7 +957,7 @@ dependencies = [
957 "pin-project",
958 "rand 0.9.2",
959 "serde",
922 - "thiserror",
960 + "thiserror 2.0.17",
961 "tokio",
962 "tracing",
963 "twox-hash",
@@ -1063,9 +1101,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1101 checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
1102 dependencies = [
1103 "cfg-if",
1104 + "js-sys",
1105 "libc",
1106 "r-efi",
1107 "wasip2",
1108 + "wasm-bindgen",
1109 ]
1110
1111 [[package]]
@@ -1158,6 +1198,23 @@ version = "0.5.2"
1198 source = "registry+https://github.com/rust-lang/crates.io-index"
1199 checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
1200
1201 +[[package]]
1202 +name = "hex"
1203 +version = "0.4.3"
1204 +source = "registry+https://github.com/rust-lang/crates.io-index"
1205 +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
1206 +
1207 +[[package]]
1208 +name = "hostname"
1209 +version = "0.4.2"
1210 +source = "registry+https://github.com/rust-lang/crates.io-index"
1211 +checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd"
1212 +dependencies = [
1213 + "cfg-if",
1214 + "libc",
1215 + "windows-link",
1216 +]
1217 +
1218 [[package]]
1219 name = "http"
1220 version = "1.3.1"
@@ -1243,6 +1300,23 @@ dependencies = [
1300 "want",
1301 ]
1302
1303 +[[package]]
1304 +name = "hyper-rustls"
1305 +version = "0.27.7"
1306 +source = "registry+https://github.com/rust-lang/crates.io-index"
1307 +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
1308 +dependencies = [
1309 + "http",
1310 + "hyper",
1311 + "hyper-util",
1312 + "rustls",
1313 + "rustls-pki-types",
1314 + "tokio",
1315 + "tokio-rustls",
1316 + "tower-service",
1317 + "webpki-roots 1.0.5",
1318 +]
1319 +
1320 [[package]]
1321 name = "hyper-timeout"
1322 version = "0.5.2"
@@ -1551,7 +1625,7 @@ dependencies = [
1625 "siphasher",
1626 "static_assertions",
1627 "tempfile",
1554 - "thiserror",
1628 + "thiserror 2.0.17",
1629 "tokio",
1630 "tracing",
1631 "tracing-subscriber",
@@ -1584,7 +1658,7 @@ dependencies = [
1658 "serde_json",
1659 "static_assertions",
1660 "tempfile",
1587 - "thiserror",
1661 + "thiserror 2.0.17",
1662 "tokio",
1663 "tracing",
1664 "tracing-subscriber",
@@ -1613,7 +1687,7 @@ dependencies = [
1687 "schemars",
1688 "serde",
1689 "serde_json",
1616 - "thiserror",
1690 + "thiserror 2.0.17",
1691 "tokio",
1692 "tracing",
1693 "tracing-subscriber",
@@ -1632,7 +1706,7 @@ dependencies = [
1706 "serde",
1707 "static_assertions",
1708 "tempfile",
1635 - "thiserror",
1709 + "thiserror 2.0.17",
1710 "tracing",
1711 "uuid",
1712 ]
@@ -1650,7 +1724,7 @@ dependencies = [
1724 "serde",
1725 "serde_json",
1726 "tempfile",
1653 - "thiserror",
1727 + "thiserror 2.0.17",
1728 "tracing",
1729 "uuid",
1730 ]
@@ -1664,7 +1738,7 @@ dependencies = [
1738 "notify",
1739 "parking_lot",
1740 "serde",
1667 - "thiserror",
1741 + "thiserror 2.0.17",
1742 "tokio",
1743 "tracing",
1744 "uuid",
@@ -1692,10 +1766,11 @@ dependencies = [
1766 "parking_lot",
1767 "rt",
1768 "schemars",
1769 + "sentry",
1770 "serde",
1771 "serde_json",
1772 "serde_yaml",
1698 - "thiserror",
1773 + "thiserror 2.0.17",
1774 "tokio",
1775 "tracing",
1776 ]
@@ -1778,6 +1853,12 @@ dependencies = [
1853 "hashbrown 0.16.0",
1854 ]
1855
1856 +[[package]]
1857 +name = "lru-slab"
1858 +version = "0.1.2"
1859 +source = "registry+https://github.com/rust-lang/crates.io-index"
1860 +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154"
1861 +
1862 [[package]]
1863 name = "lz4"
1864 version = "1.28.1"
@@ -1975,7 +2056,7 @@ dependencies = [
2056 name = "netdata-plugin-error"
2057 version = "0.1.0"
2058 dependencies = [
1978 - "thiserror",
2059 + "thiserror 2.0.17",
2060 ]
2061
2062 [[package]]
@@ -2072,6 +2153,12 @@ dependencies = [
2153 "windows-sys 0.61.2",
2154 ]
2155
2156 +[[package]]
2157 +name = "num-conv"
2158 +version = "0.1.0"
2159 +source = "registry+https://github.com/rust-lang/crates.io-index"
2160 +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
2161 +
2162 [[package]]
2163 name = "num-traits"
2164 version = "0.2.19"
@@ -2091,6 +2178,165 @@ dependencies = [
2178 "libc",
2179 ]
2180
2181 +[[package]]
2182 +name = "objc2"
2183 +version = "0.6.3"
2184 +source = "registry+https://github.com/rust-lang/crates.io-index"
2185 +checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05"
2186 +dependencies = [
2187 + "objc2-encode",
2188 +]
2189 +
2190 +[[package]]
2191 +name = "objc2-cloud-kit"
2192 +version = "0.3.2"
2193 +source = "registry+https://github.com/rust-lang/crates.io-index"
2194 +checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c"
2195 +dependencies = [
2196 + "bitflags 2.10.0",
2197 + "objc2",
2198 + "objc2-foundation",
2199 +]
2200 +
2201 +[[package]]
2202 +name = "objc2-core-data"
2203 +version = "0.3.2"
2204 +source = "registry+https://github.com/rust-lang/crates.io-index"
2205 +checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa"
2206 +dependencies = [
2207 + "objc2",
2208 + "objc2-foundation",
2209 +]
2210 +
2211 +[[package]]
2212 +name = "objc2-core-foundation"
2213 +version = "0.3.2"
2214 +source = "registry+https://github.com/rust-lang/crates.io-index"
2215 +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
2216 +dependencies = [
2217 + "bitflags 2.10.0",
2218 + "dispatch2",
2219 + "objc2",
2220 +]
2221 +
2222 +[[package]]
2223 +name = "objc2-core-graphics"
2224 +version = "0.3.2"
2225 +source = "registry+https://github.com/rust-lang/crates.io-index"
2226 +checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
2227 +dependencies = [
2228 + "bitflags 2.10.0",
2229 + "dispatch2",
2230 + "objc2",
2231 + "objc2-core-foundation",
2232 + "objc2-io-surface",
2233 +]
2234 +
2235 +[[package]]
2236 +name = "objc2-core-image"
2237 +version = "0.3.2"
2238 +source = "registry+https://github.com/rust-lang/crates.io-index"
2239 +checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006"
2240 +dependencies = [
2241 + "objc2",
2242 + "objc2-foundation",
2243 +]
2244 +
2245 +[[package]]
2246 +name = "objc2-core-location"
2247 +version = "0.3.2"
2248 +source = "registry+https://github.com/rust-lang/crates.io-index"
2249 +checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009"
2250 +dependencies = [
2251 + "objc2",
2252 + "objc2-foundation",
2253 +]
2254 +
2255 +[[package]]
2256 +name = "objc2-core-text"
2257 +version = "0.3.2"
2258 +source = "registry+https://github.com/rust-lang/crates.io-index"
2259 +checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d"
2260 +dependencies = [
2261 + "bitflags 2.10.0",
2262 + "objc2",
2263 + "objc2-core-foundation",
2264 + "objc2-core-graphics",
2265 +]
2266 +
2267 +[[package]]
2268 +name = "objc2-encode"
2269 +version = "4.1.0"
2270 +source = "registry+https://github.com/rust-lang/crates.io-index"
2271 +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
2272 +
2273 +[[package]]
2274 +name = "objc2-foundation"
2275 +version = "0.3.2"
2276 +source = "registry+https://github.com/rust-lang/crates.io-index"
2277 +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
2278 +dependencies = [
2279 + "bitflags 2.10.0",
2280 + "block2",
2281 + "libc",
2282 + "objc2",
2283 + "objc2-core-foundation",
2284 +]
2285 +
2286 +[[package]]
2287 +name = "objc2-io-surface"
2288 +version = "0.3.2"
2289 +source = "registry+https://github.com/rust-lang/crates.io-index"
2290 +checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
2291 +dependencies = [
2292 + "bitflags 2.10.0",
2293 + "objc2",
2294 + "objc2-core-foundation",
2295 +]
2296 +
2297 +[[package]]
2298 +name = "objc2-quartz-core"
2299 +version = "0.3.2"
2300 +source = "registry+https://github.com/rust-lang/crates.io-index"
2301 +checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"
2302 +dependencies = [
2303 + "bitflags 2.10.0",
2304 + "objc2",
2305 + "objc2-core-foundation",
2306 + "objc2-foundation",
2307 +]
2308 +
2309 +[[package]]
2310 +name = "objc2-ui-kit"
2311 +version = "0.3.2"
2312 +source = "registry+https://github.com/rust-lang/crates.io-index"
2313 +checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22"
2314 +dependencies = [
2315 + "bitflags 2.10.0",
2316 + "block2",
2317 + "objc2",
2318 + "objc2-cloud-kit",
2319 + "objc2-core-data",
2320 + "objc2-core-foundation",
2321 + "objc2-core-graphics",
2322 + "objc2-core-image",
2323 + "objc2-core-location",
2324 + "objc2-core-text",
2325 + "objc2-foundation",
2326 + "objc2-quartz-core",
2327 + "objc2-user-notifications",
2328 +]
2329 +
2330 +[[package]]
2331 +name = "objc2-user-notifications"
2332 +version = "0.3.2"
2333 +source = "registry+https://github.com/rust-lang/crates.io-index"
2334 +checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e"
2335 +dependencies = [
2336 + "objc2",
2337 + "objc2-foundation",
2338 +]
2339 +
2340 [[package]]
2341 name = "once_cell"
2342 version = "1.21.3"
@@ -2113,7 +2359,7 @@ dependencies = [
2359 "futures-sink",
2360 "js-sys",
2361 "pin-project-lite",
2116 - "thiserror",
2362 + "thiserror 2.0.17",
2363 "tracing",
2364 ]
2365
@@ -2143,7 +2389,7 @@ dependencies = [
2389 "opentelemetry_sdk",
2390 "prost 0.14.1",
2391 "reqwest",
2146 - "thiserror",
2392 + "thiserror 2.0.17",
2393 "tokio",
2394 "tonic 0.14.2",
2395 "tracing",
@@ -2178,11 +2424,27 @@ dependencies = [
2424 "opentelemetry",
2425 "percent-encoding",
2426 "rand 0.9.2",
2181 - "thiserror",
2427 + "thiserror 2.0.17",
2428 "tokio",
2429 "tokio-stream",
2430 ]
2431
2432 +[[package]]
2433 +name = "os_info"
2434 +version = "3.14.0"
2435 +source = "registry+https://github.com/rust-lang/crates.io-index"
2436 +checksum = "e4022a17595a00d6a369236fdae483f0de7f0a339960a53118b818238e132224"
2437 +dependencies = [
2438 + "android_system_properties",
2439 + "log",
2440 + "nix",
2441 + "objc2",
2442 + "objc2-foundation",
2443 + "objc2-ui-kit",
2444 + "serde",
2445 + "windows-sys 0.61.2",
2446 +]
2447 +
2448 [[package]]
2449 name = "otel-plugin"
2450 version = "0.1.0"
@@ -2340,6 +2602,12 @@ dependencies = [
2602 "zerovec",
2603 ]
2604
2605 +[[package]]
2606 +name = "powerfmt"
2607 +version = "0.2.0"
2608 +source = "registry+https://github.com/rust-lang/crates.io-index"
2609 +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
2610 +
2611 [[package]]
2612 name = "ppv-lite86"
2613 version = "0.2.21"
@@ -2428,6 +2696,61 @@ dependencies = [
2696 "prost 0.13.5",
2697 ]
2698
2699 +[[package]]
2700 +name = "quinn"
2701 +version = "0.11.9"
2702 +source = "registry+https://github.com/rust-lang/crates.io-index"
2703 +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20"
2704 +dependencies = [
2705 + "bytes",
2706 + "cfg_aliases",
2707 + "pin-project-lite",
2708 + "quinn-proto",
2709 + "quinn-udp",
2710 + "rustc-hash",
2711 + "rustls",
2712 + "socket2 0.6.1",
2713 + "thiserror 2.0.17",
2714 + "tokio",
2715 + "tracing",
2716 + "web-time",
2717 +]
2718 +
2719 +[[package]]
2720 +name = "quinn-proto"
2721 +version = "0.11.13"
2722 +source = "registry+https://github.com/rust-lang/crates.io-index"
2723 +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31"
2724 +dependencies = [
2725 + "bytes",
2726 + "getrandom 0.3.4",
2727 + "lru-slab",
2728 + "rand 0.9.2",
2729 + "ring",
2730 + "rustc-hash",
2731 + "rustls",
2732 + "rustls-pki-types",
2733 + "slab",
2734 + "thiserror 2.0.17",
2735 + "tinyvec",
2736 + "tracing",
2737 + "web-time",
2738 +]
2739 +
2740 +[[package]]
2741 +name = "quinn-udp"
2742 +version = "0.5.14"
2743 +source = "registry+https://github.com/rust-lang/crates.io-index"
2744 +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd"
2745 +dependencies = [
2746 + "cfg_aliases",
2747 + "libc",
2748 + "once_cell",
2749 + "socket2 0.6.1",
2750 + "tracing",
2751 + "windows-sys 0.60.2",
2752 +]
2753 +
2754 [[package]]
2755 name = "quote"
2756 version = "1.0.42"
@@ -2620,16 +2943,21 @@ dependencies = [
2943 "http-body",
2944 "http-body-util",
2945 "hyper",
2946 + "hyper-rustls",
2947 "hyper-util",
2948 "js-sys",
2949 "log",
2950 "percent-encoding",
2951 "pin-project-lite",
2952 + "quinn",
2953 + "rustls",
2954 + "rustls-pki-types",
2955 "serde",
2956 "serde_json",
2957 "serde_urlencoded",
2958 "sync_wrapper",
2959 "tokio",
2960 + "tokio-rustls",
2961 "tower 0.5.2",
2962 "tower-http",
2963 "tower-service",
@@ -2637,6 +2965,7 @@ dependencies = [
2965 "wasm-bindgen",
2966 "wasm-bindgen-futures",
2967 "web-sys",
2968 + "webpki-roots 1.0.5",
2969 ]
2970
2971 [[package]]
@@ -2696,6 +3025,15 @@ version = "2.1.1"
3025 source = "registry+https://github.com/rust-lang/crates.io-index"
3026 checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
3027
3028 +[[package]]
3029 +name = "rustc_version"
3030 +version = "0.4.1"
3031 +source = "registry+https://github.com/rust-lang/crates.io-index"
3032 +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
3033 +dependencies = [
3034 + "semver",
3035 +]
3036 +
3037 [[package]]
3038 name = "rustix"
3039 version = "1.1.2"
@@ -2730,6 +3068,7 @@ version = "1.13.0"
3068 source = "registry+https://github.com/rust-lang/crates.io-index"
3069 checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a"
3070 dependencies = [
3071 + "web-time",
3072 "zeroize",
3073 ]
3074
@@ -2805,6 +3144,72 @@ version = "1.2.0"
3144 source = "registry+https://github.com/rust-lang/crates.io-index"
3145 checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
3146
3147 +[[package]]
3148 +name = "semver"
3149 +version = "1.0.27"
3150 +source = "registry+https://github.com/rust-lang/crates.io-index"
3151 +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2"
3152 +
3153 +[[package]]
3154 +name = "sentry"
3155 +version = "0.35.0"
3156 +source = "registry+https://github.com/rust-lang/crates.io-index"
3157 +checksum = "016958f51b96861dead7c1e02290f138411d05e94fad175c8636a835dee6e51e"
3158 +dependencies = [
3159 + "httpdate",
3160 + "reqwest",
3161 + "rustls",
3162 + "sentry-contexts",
3163 + "sentry-core",
3164 + "tokio",
3165 + "ureq",
3166 + "webpki-roots 0.26.11",
3167 +]
3168 +
3169 +[[package]]
3170 +name = "sentry-contexts"
3171 +version = "0.35.0"
3172 +source = "registry+https://github.com/rust-lang/crates.io-index"
3173 +checksum = "eba8754ec3b9279e00aa6d64916f211d44202370a1699afde1db2c16cbada089"
3174 +dependencies = [
3175 + "hostname",
3176 + "libc",
3177 + "os_info",
3178 + "rustc_version",
3179 + "sentry-core",
3180 + "uname",
3181 +]
3182 +
3183 +[[package]]
3184 +name = "sentry-core"
3185 +version = "0.35.0"
3186 +source = "registry+https://github.com/rust-lang/crates.io-index"
3187 +checksum = "f9f8b6dcd4fbae1e3e22b447f32670360b27e31b62ab040f7fb04e0f80c04d92"
3188 +dependencies = [
3189 + "once_cell",
3190 + "rand 0.8.5",
3191 + "sentry-types",
3192 + "serde",
3193 + "serde_json",
3194 +]
3195 +
3196 +[[package]]
3197 +name = "sentry-types"
3198 +version = "0.35.0"
3199 +source = "registry+https://github.com/rust-lang/crates.io-index"
3200 +checksum = "a71ed3a389948a6a6d92b98e997a2723ca22f09660c5a7b7388ecd509a70a527"
3201 +dependencies = [
3202 + "debugid",
3203 + "hex",
3204 + "rand 0.8.5",
3205 + "serde",
3206 + "serde_json",
3207 + "thiserror 1.0.69",
3208 + "time",
3209 + "url",
3210 + "uuid",
3211 +]
3212 +
3213 [[package]]
3214 name = "serde"
3215 version = "1.0.228"
@@ -3072,13 +3477,33 @@ dependencies = [
3477 "windows-sys 0.61.2",
3478 ]
3479
3480 +[[package]]
3481 +name = "thiserror"
3482 +version = "1.0.69"
3483 +source = "registry+https://github.com/rust-lang/crates.io-index"
3484 +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
3485 +dependencies = [
3486 + "thiserror-impl 1.0.69",
3487 +]
3488 +
3489 [[package]]
3490 name = "thiserror"
3491 version = "2.0.17"
3492 source = "registry+https://github.com/rust-lang/crates.io-index"
3493 checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
3494 dependencies = [
3081 - "thiserror-impl",
3495 + "thiserror-impl 2.0.17",
3496 +]
3497 +
3498 +[[package]]
3499 +name = "thiserror-impl"
3500 +version = "1.0.69"
3501 +source = "registry+https://github.com/rust-lang/crates.io-index"
3502 +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
3503 +dependencies = [
3504 + "proc-macro2",
3505 + "quote",
3506 + "syn 2.0.110",
3507 ]
3508
3509 [[package]]
@@ -3101,6 +3526,37 @@ dependencies = [
3526 "cfg-if",
3527 ]
3528
3529 +[[package]]
3530 +name = "time"
3531 +version = "0.3.45"
3532 +source = "registry+https://github.com/rust-lang/crates.io-index"
3533 +checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd"
3534 +dependencies = [
3535 + "deranged",
3536 + "itoa",
3537 + "num-conv",
3538 + "powerfmt",
3539 + "serde_core",
3540 + "time-core",
3541 + "time-macros",
3542 +]
3543 +
3544 +[[package]]
3545 +name = "time-core"
3546 +version = "0.1.7"
3547 +source = "registry+https://github.com/rust-lang/crates.io-index"
3548 +checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca"
3549 +
3550 +[[package]]
3551 +name = "time-macros"
3552 +version = "0.2.25"
3553 +source = "registry+https://github.com/rust-lang/crates.io-index"
3554 +checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd"
3555 +dependencies = [
3556 + "num-conv",
3557 + "time-core",
3558 +]
3559 +
3560 [[package]]
3561 name = "tinystr"
3562 version = "0.8.2"
@@ -3111,6 +3567,21 @@ dependencies = [
3567 "zerovec",
3568 ]
3569
3570 +[[package]]
3571 +name = "tinyvec"
3572 +version = "1.10.0"
3573 +source = "registry+https://github.com/rust-lang/crates.io-index"
3574 +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa"
3575 +dependencies = [
3576 + "tinyvec_macros",
3577 +]
3578 +
3579 +[[package]]
3580 +name = "tinyvec_macros"
3581 +version = "0.1.1"
3582 +source = "registry+https://github.com/rust-lang/crates.io-index"
3583 +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
3584 +
3585 [[package]]
3586 name = "tokio"
3587 version = "1.48.0"
@@ -3464,6 +3935,15 @@ dependencies = [
3935 "rand 0.9.2",
3936 ]
3937
3938 +[[package]]
3939 +name = "uname"
3940 +version = "0.1.1"
3941 +source = "registry+https://github.com/rust-lang/crates.io-index"
3942 +checksum = "b72f89f0ca32e4db1c04e2a72f5345d59796d4866a1ee0609084569f73683dc8"
3943 +dependencies = [
3944 + "libc",
3945 +]
3946 +
3947 [[package]]
3948 name = "unarray"
3949 version = "0.1.4"
@@ -3488,6 +3968,21 @@ version = "0.9.0"
3968 source = "registry+https://github.com/rust-lang/crates.io-index"
3969 checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
3970
3971 +[[package]]
3972 +name = "ureq"
3973 +version = "2.12.1"
3974 +source = "registry+https://github.com/rust-lang/crates.io-index"
3975 +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d"
3976 +dependencies = [
3977 + "base64 0.22.1",
3978 + "log",
3979 + "once_cell",
3980 + "rustls",
3981 + "rustls-pki-types",
3982 + "url",
3983 + "webpki-roots 0.26.11",
3984 +]
3985 +
3986 [[package]]
3987 name = "url"
3988 version = "2.5.7"
@@ -3648,6 +4143,24 @@ dependencies = [
4143 "wasm-bindgen",
4144 ]
4145
4146 +[[package]]
4147 +name = "webpki-roots"
4148 +version = "0.26.11"
4149 +source = "registry+https://github.com/rust-lang/crates.io-index"
4150 +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9"
4151 +dependencies = [
4152 + "webpki-roots 1.0.5",
4153 +]
4154 +
4155 +[[package]]
4156 +name = "webpki-roots"
4157 +version = "1.0.5"
4158 +source = "registry+https://github.com/rust-lang/crates.io-index"
4159 +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c"
4160 +dependencies = [
4161 + "rustls-pki-types",
4162 +]
4163 +
4164 [[package]]
4165 name = "winapi"
4166 version = "0.3.9"
src/crates/Cargo.toml
+3
@@ -125,6 +125,9 @@ tower = "0.5"
125
126 flatten-serde-json = { git = "https://github.com/meilisearch/meilisearch", tag = "v1.22.1" }
127
128 +# Error tracking
129 +sentry = { version = "0.35", default-features = false }
130 +
131 # Internal workspace crates
132 journal-common = { path = "journal-common" }
133 journal-core = { path = "journal-core" }
src/crates/netdata-log-viewer/journal-viewer-plugin/Cargo.toml
+3
@@ -43,3 +43,6 @@ journal-core = { workspace = true }
43 journal-index = { workspace = true }
44 journal-function = { workspace = true }
45 journal-registry = { workspace = true }
46 +
47 +# Error tracking
48 +sentry = { workspace = true, features = ["reqwest", "rustls", "contexts"] }
src/crates/netdata-log-viewer/journal-viewer-plugin/src/catalog.rs
+66 -9
@@ -6,6 +6,7 @@ use netdata_plugin_protocol::FunctionDeclaration;
6 use netdata_plugin_schema::HttpAccess;
7 use parking_lot::RwLock;
8 use rt::FunctionHandler;
9 +use sentry::protocol::Value;
10 use std::sync::Arc;
11 use tracing::{debug, error, info, instrument, warn};
12
@@ -68,6 +69,44 @@ fn build_filter_from_selections(selections: &HashMap<String, Vec<String>>) -> Fi
69 }
70 }
71
72 +/// Captures an error to Sentry with request context.
73 +fn capture_request_error(
74 + transaction_id: &str,
75 + operation: &str,
76 + error_message: &str,
77 + context: &RequestContext,
78 +) {
79 + // Capture the error event with context
80 + sentry::with_scope(
81 + |scope| {
82 + scope.set_tag("transaction_id", transaction_id);
83 + scope.set_tag("operation", operation);
84 + scope.set_extra("time_range_start", Value::from(context.time_range_start));
85 + scope.set_extra("time_range_end", Value::from(context.time_range_end));
86 + scope.set_extra("file_count", Value::from(context.file_count));
87 + if let Some(duration) = context.find_files_duration_ms {
88 + scope.set_extra("find_files_duration_ms", Value::from(duration));
89 + }
90 + if let Some(duration) = context.indexing_duration_ms {
91 + scope.set_extra("indexing_duration_ms", Value::from(duration));
92 + }
93 + },
94 + || {
95 + sentry::capture_message(error_message, sentry::Level::Error);
96 + },
97 + );
98 +}
99 +
100 +/// Context for a request, used for error reporting.
101 +#[derive(Default)]
102 +struct RequestContext {
103 + time_range_start: i64,
104 + time_range_end: i64,
105 + file_count: usize,
106 + find_files_duration_ms: Option<u64>,
107 + indexing_duration_ms: Option<u64>,
108 +}
109 +
110 fn accepted_params() -> Vec<netdata::RequestParam> {
111 use netdata::RequestParam;
112
@@ -503,10 +542,19 @@ impl FunctionHandler for CatalogFunction {
542 };
543 info!("[{}] started transaction", txn.id());
544
545 + // Initialize request context for error reporting
546 + let mut ctx = RequestContext {
547 + time_range_start: request.after as i64,
548 + time_range_end: request.before as i64,
549 + ..Default::default()
550 + };
551 +
552 // Create query time range with automatic alignment
553 let time_range = journal_function::QueryTimeRange::new(request.after, request.before)
508 - .map_err(|e| netdata_plugin_error::NetdataPluginError::Other {
509 - message: format!("[{}] {}", txn.id(), e),
554 + .map_err(|e| {
555 + let msg = format!("[{}] {}", txn.id(), e);
556 + capture_request_error(&txn.id(), "time_range_creation", &msg, &ctx);
557 + netdata_plugin_error::NetdataPluginError::Other { message: msg }
558 })?;
559
560 info!(
@@ -525,10 +573,14 @@ impl FunctionHandler for CatalogFunction {
573 .inner
574 .registry
575 .find_files_in_range(Seconds(request.after), Seconds(request.before))
528 - .map_err(|e| netdata_plugin_error::NetdataPluginError::Other {
529 - message: format!("[{}] failed to find files in range: {}", txn.id(), e),
576 + .map_err(|e| {
577 + let msg = format!("[{}] failed to find files in range: {}", txn.id(), e);
578 + capture_request_error(&txn.id(), "find_files", &msg, &ctx);
579 + netdata_plugin_error::NetdataPluginError::Other { message: msg }
580 })?;
581 let find_files_duration = op_start.elapsed();
582 + ctx.find_files_duration_ms = Some(find_files_duration.as_millis() as u64);
583 + ctx.file_count = files.len();
584 info!("[{}] found {} files in time range", txn.id(), files.len(),);
585 if tracing::enabled!(tracing::Level::DEBUG) {
586 for (idx, file_info) in files.iter().enumerate() {
@@ -542,7 +594,7 @@ impl FunctionHandler for CatalogFunction {
594 }
595 }
596
545 - // Build fiter expression
597 + // Build filter expression
598 let filter_expr = build_filter_from_selections(&request.selections);
599 info!("[{}] filter expression: {}", txn.id(), filter_expr);
600
@@ -583,10 +635,13 @@ impl FunctionHandler for CatalogFunction {
635 timeout,
636 )
637 .await
586 - .map_err(|e| netdata_plugin_error::NetdataPluginError::Other {
587 - message: format!("[{}] failed to index files: {}", txn.id(), e),
638 + .map_err(|e| {
639 + let msg = format!("[{}] failed to index files: {}", txn.id(), e);
640 + capture_request_error(&txn.id(), "file_indexing", &msg, &ctx);
641 + netdata_plugin_error::NetdataPluginError::Other { message: msg }
642 })?;
643 let indexing_duration = op_start.elapsed();
644 + ctx.indexing_duration_ms = Some(indexing_duration.as_millis() as u64);
645
646 info!(
647 "[{}] retrieved {}/{} file indexes for histogram buckets and log entries",
@@ -615,8 +670,10 @@ impl FunctionHandler for CatalogFunction {
670 .inner
671 .histogram_engine
672 .compute_from_indexes(&indexed_files, &time_range, &request.facets, &filter_expr)
618 - .map_err(|e| netdata_plugin_error::NetdataPluginError::Other {
619 - message: format!("failed to compute histogram: {}", e),
673 + .map_err(|e| {
674 + let msg = format!("[{}] failed to compute histogram: {}", txn.id(), e);
675 + capture_request_error(&txn.id(), "histogram_computation", &msg, &ctx);
676 + netdata_plugin_error::NetdataPluginError::Other { message: msg }
677 })?;
678 let histogram_duration = op_start.elapsed();
679
src/crates/netdata-log-viewer/journal-viewer-plugin/src/main.rs
+32
@@ -11,10 +11,42 @@ use plugin_config::PluginConfig;
11 use rt::PluginRuntime;
12 use tracing::{error, info};
13
14 +/// Initialize Sentry error tracking.
15 +///
16 +/// Returns a guard that must be kept alive for the duration of the program.
17 +fn init_sentry() -> Option<sentry::ClientInitGuard> {
18 + if std::env::var("DISABLE_TELEMETRY").is_ok() {
19 + return None;
20 + }
21 +
22 + let dsn =
23 + "https://e6e6b1488ab279fc702439e15d6112cc@o382276.ingest.us.sentry.io/4510709226143744";
24 +
25 + let guard = sentry::init((
26 + dsn,
27 + sentry::ClientOptions {
28 + release: sentry::release_name!(),
29 + // Enable session tracking for counting plugin starts
30 + auto_session_tracking: true,
31 + // Set sample rate for transactions (0.0 = no transactions, saves quota)
32 + traces_sample_rate: 0.0,
33 + ..Default::default()
34 + },
35 + ));
36 +
37 + // Start a session to track this plugin run
38 + sentry::start_session();
39 +
40 + Some(guard)
41 +}
42 +
43 #[tokio::main]
44 async fn main() {
45 println!("TRUST_DURATIONS 1");
46
47 + // Initialize Sentry before tracing so panics are captured
48 + let _sentry_guard = init_sentry();
49 +
50 rt::init_tracing();
51
52 let result = run_plugin().await;