Here is a detailed summary of the changes: ### 🚀 Frontend Telemetry Improvement (`src/lib/telemetry.ts` & `src/main.ts`) A dedicated module for robust, rate-limited error reporting has been added to the frontend application. * **Error Handling:** The new `installErrorReporting` function registers global listeners for `error` and `unhandledrejection` events on the window object. * **Stability Focus:** To prevent telemetry from interfering with the main user experience, the system implements a **rate limit** (`MAX_REPORTS_PER_SESSION = 25`) and checks to ensure duplicate messages are not sent repeatedly during a single session. * **Integration:** `src/main.ts` now calls `installErrorReporting()` upon application startup, ensuring that error monitoring is active from the moment the app loads. ### ⚙️ Backend Metrics & Logs Export Enhancement (Rust Code Block) The Rust code block significantly refactors and enhances the logic for exporting system metrics and application logs to an OpenTelemetry Collector endpoint. The structure now adheres much more closely to standard OTLP/JSON schemas, and unit tests are added for validation. #### 1. Metrics Export (`gauge` function & main loop) * **Comprehensive Data Collection:** The export loop is updated to refresh process information and calculate key metrics: * Process Memory Usage (`process.memory.usage`) * CPU Utilization (System-wide, normalized) (`process.cpu.utilization`) * System Memory Utilization (`system.memory.utilization`) * **Standardized Payload:** The `gauge` helper function correctly structures these metrics into the required OpenTelemetry JSON format, including resource attributes and time points. #### 2. Logs Export (`logs_payload`, `resource`, etc.) * **Structured Logging:** The `logs_payload` function provides a robust way to serialize application logs (`LogEvent`). It accurately maps log severity, body content, and custom attributes into the OTLP/JSON format. * **Resource Attributes:** Helper functions like `resource()` ensure that all telemetry payloads are correctly tagged with essential metadata (service name, version, OS type, architecture). #### 3. Testing * **Validation Added:** Comprehensive unit tests (`#[cfg(test)] mod tests`) have been added to validate the complex serialization logic for both metrics and logs, ensuring they match the expected OpenTelemetry schema structure. *** ### Summary of Impact These changes result in a much more observable and stable application: 1. **Improved Observability:** The system can now reliably capture detailed performance data (CPU/Memory) and structured event logs from the backend, while simultaneously capturing critical runtime errors from the frontend. 2. **Increased Stability:** Rate limiting on error reporting prevents telemetry failures from cascading into user-facing bugs. 3. **Code Quality:** The addition of unit tests for the complex serialization logic significantly increases confidence in the reliability of the data export pipeline.
129 lines
7.4 KiB
JSON
129 lines
7.4 KiB
JSON
{
|
|
"permissions": {
|
|
"allow": [
|
|
"Bash(cargo build *)",
|
|
"Bash(npm run *)",
|
|
"Bash(kill %1)",
|
|
"Bash(perl -0pi -e 's/\\\\{line \\\\|\\\\| \" \"\\\\}/{displayLine\\(line\\) || \" \"}/g' src/App.svelte)",
|
|
"Bash(kill 26306)",
|
|
"Bash(convert --version)",
|
|
"Bash(magick /mnt/data/Development/GitLite/src-tauri/icons/icon.ico /mnt/data/Development/GitLite/src-tauri/icons/icon.png)",
|
|
"Bash(magick /mnt/data/Development/GitLite/src-tauri/icons/icon.ico -type TrueColorAlpha -alpha on PNG32:/mnt/data/Development/GitLite/src-tauri/icons/icon.png)",
|
|
"Bash(magick identify *)",
|
|
"Bash(magick -size 512x512 xc:\"rgba\\(70,130,180,255\\)\" PNG32:/mnt/data/Development/GitLite/src-tauri/icons/icon.png)",
|
|
"Bash(pkill -f \"vite --host\")",
|
|
"Bash(pkill -f \"tauri dev\")",
|
|
"Bash(pkill -f \"tauri_git_lite\")",
|
|
"Bash(xargs kill -9)",
|
|
"Bash(grep -qE \"\\(Running \\\\`target|error\\\\[|panicked|terminated\\)\" /tmp/claude-1000/-mnt-data-Development-GitLite/71a8b49f-ac61-4ad9-aaba-dc0219044038/tasks/b4ujhgmdk.output)",
|
|
"Bash(grep -qE \"\\(Running \\\\`target|error\\\\[|panicked|terminated\\)\" /tmp/claude-1000/-mnt-data-Development-GitLite/71a8b49f-ac61-4ad9-aaba-dc0219044038/tasks/bt54rikhh.output)",
|
|
"Bash(grep -qE \"\\(Running \\\\`target|error\\\\[|panicked|terminated\\)\" /tmp/claude-1000/-mnt-data-Development-GitLite/71a8b49f-ac61-4ad9-aaba-dc0219044038/tasks/b7nyub68s.output)",
|
|
"Bash(npm install *)",
|
|
"Bash(cargo check *)",
|
|
"Bash(npx vite *)",
|
|
"Bash(cargo tree *)",
|
|
"Bash(jobs)",
|
|
"Bash(npx svelte-check *)",
|
|
"Bash(git log *)",
|
|
"Bash(xxd)",
|
|
"Bash(python3 -)",
|
|
"Bash(echo \"exit: $?\")",
|
|
"Bash(grep -n \"input,\\\\|select,\\\\|input {\\\\|select {\\\\|.repo-form input\\\\|input:focus\\\\|::placeholder\" src/app.css)",
|
|
"Bash(sudo -n true)",
|
|
"Bash(rustc --version)",
|
|
"Read(//mnt/c/Users/cbr/Desktop/src-tauri/src/**)",
|
|
"Bash(sudo apt install -y libdbus-1-dev pkg-config)",
|
|
"Bash(dpkg -l)",
|
|
"Bash(apt list *)",
|
|
"Bash(cargo search *)",
|
|
"Bash(curl -s \"https://crates.io/api/v1/crates/mistralrs\")",
|
|
"Bash(cargo info *)",
|
|
"WebFetch(domain:raw.githubusercontent.com)",
|
|
"Bash(gh api *)",
|
|
"WebFetch(domain:github.com)",
|
|
"WebFetch(domain:ericlbuehler.github.io)",
|
|
"WebFetch(domain:docs.rs)",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/Qwen/Qwen2.5-1.5B-Instruct-GGUF\")",
|
|
"Bash(python3 -c ' *)",
|
|
"Bash(curl -sI \"https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct-GGUF/resolve/main/qwen2.5-1.5b-instruct-q4_k_m.gguf\")",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/Qwen/Qwen2.5-1.5B-Instruct-GGUF?blobs=true\")",
|
|
"Bash(grep -n 'from \"\\\\./lib/git\"\\\\|from \"\\\\./lib/types\"\\\\|^ commit,$' src/App.svelte)",
|
|
"Bash(kill 24343 24363 24375 24376)",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/Qwen/Qwen2.5-0.5B-Instruct-GGUF?blobs=true\")",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/bartowski/Llama-3.2-3B-Instruct-GGUF?blobs=true\")",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/bartowski/Llama-3.2-3B-Instruct-GGUF\")",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/Qwen/Qwen2.5-3B-Instruct-GGUF\")",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/Qwen/Qwen2.5-3B-Instruct-GGUF?blobs=true\")",
|
|
"Bash(curl -s \"https://huggingface.co/api/models/Qwen/Qwen2.5-3B-Instruct\")",
|
|
"Bash(: *)",
|
|
"Bash(exit 0 *)",
|
|
"Bash(rustc -O sanitize_test.rs -o sanitize_test)",
|
|
"Bash(./sanitize_test)",
|
|
"Bash(echo \"exit:$?\")",
|
|
"Bash(grep -rlP \"[äöüßÄÖÜ]\" src src-tauri/src src-tauri/crates --include=\"*.rs\" --include=\"*.svelte\" --include=\"*.ts\")",
|
|
"Bash(echo \"---exit $?---\")",
|
|
"Bash(apt-cache policy *)",
|
|
"Bash(timeout 5 curl -sI http://archive.ubuntu.com)",
|
|
"Bash(sudo -n apt-get install -y libdbus-1-dev pkg-config)",
|
|
"Bash(grep -n '\"Unerwarteter Git-Log-Eintrag: {}\",' src-tauri/src/git.rs)",
|
|
"Bash(grep -E \"git_lite$|tauri_git_lite$\")",
|
|
"Bash(rustfmt --edition 2024 --check src-tauri/src/git.rs)",
|
|
"Bash(echo \"EXIT:$?\")",
|
|
"Bash(ls target/)",
|
|
"Bash(rustup target *)",
|
|
"Bash(echo \"exit code: $?\")",
|
|
"Read(//home/cbr/.cargo/registry/src/**)",
|
|
"Bash(find / -maxdepth 6 -iname \"mistralrs-*\" -type d)",
|
|
"Bash(grep -A2 '^name = \"tauri\"$' \"/mnt/c/Users/cbr/Desktop/Neuer Ordner \\(6\\)/src-tauri/Cargo.lock\")",
|
|
"Bash(rustfmt --edition 2024 --check src/badge.rs src/main.rs)",
|
|
"Bash(rustfmt --edition 2024 --check src/git.rs)",
|
|
"Bash(rustfmt --edition 2024 --check src/badge.rs)",
|
|
"Bash(rustfmt --edition 2024 --check src/git.rs src/main.rs)",
|
|
"Bash(pkg-config --list-all)",
|
|
"Bash(rustc --edition 2021 --crate-type lib -o /dev/null --emit=metadata src/git.rs)",
|
|
"Bash(rustc --edition 2021 --crate-type lib -o /dev/null --emit=metadata /mnt/d/Development/GitLite/src-tauri/src/git.rs)",
|
|
"Bash(rustc --edition 2021 --crate-type bin -o /dev/null --emit=metadata src/main.rs)",
|
|
"Bash(grep -B1 \"^error\\\\[E0432\\\\]\\\\|^error$\")",
|
|
"Bash(grep -v \"^--$\")",
|
|
"Bash(grep \"^error$\" -A2)",
|
|
"Bash(cargo run *)",
|
|
"Bash(node_modules/.bin/svelte-check --version)",
|
|
"Bash(rustfmt --check --edition 2021 src/git.rs src/main.rs)",
|
|
"Bash(rustfmt --check --edition 2021 src/git.rs)",
|
|
"Bash(awk *)",
|
|
"Bash(rustfmt --edition 2021 /tmp/blame_chunk.rs)",
|
|
"Read(//tmp/**)",
|
|
"Bash(identify src-tauri/icons/GitCat.ico)",
|
|
"Bash(python3 -c \"import PIL; print\\(PIL.__version__\\)\")",
|
|
"Bash(python3 *)",
|
|
"Bash(xxd -l 16 src-tauri/icons/GitCat.ico)",
|
|
"Bash(pkg-config --exists openssl)",
|
|
"Bash(sudo apt-get install -y libssl-dev pkg-config)",
|
|
"Bash(dpkg -L libssl3t64)",
|
|
"Bash(grep *)",
|
|
"Read(//home/christoph/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-2.11.5/src/**)",
|
|
"Read(//home/christoph/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-runtime-wry-2.11.4/src/**)",
|
|
"Read(//home/christoph/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tauri-2.11.5/src/window/**)",
|
|
"WebSearch",
|
|
"Bash(node -p \"require\\('./package.json'\\).version\")",
|
|
"Bash(bash -n PKGBUILD)",
|
|
"Bash(makepkg --printsrcinfo)",
|
|
"Bash(npx tauri *)",
|
|
"Bash(echo \"---exit code:$?---\")",
|
|
"Bash(git -C /mnt/data/Development/GitLite status --short)",
|
|
"Bash(makepkg -f --noconfirm)",
|
|
"Bash(tar -tf gitty-2026.7.19-1-x86_64.pkg.tar.zst)",
|
|
"Bash(cp /mnt/data/Development/GitLite/PKGBUILD .)",
|
|
"Bash(sed -i 's/^pkgrel=1/pkgrel=3/' PKGBUILD)",
|
|
"Bash(node -e \"const fs=require\\('fs'\\); const version='2026.8.1'; const pkgbuild=fs.readFileSync\\('PKGBUILD','utf8'\\).replace\\(/^pkgver=.*\\\\$/m, 'pkgver='+version\\).replace\\(/^pkgrel=.*\\\\$/m, 'pkgrel=1'\\); fs.writeFileSync\\('PKGBUILD', pkgbuild\\);\")",
|
|
"Bash(rm PKGBUILD)",
|
|
"Bash(git -C /mnt/data/Development/GitLite stash)",
|
|
"Bash(git -C /mnt/data/Development/GitLite stash pop)",
|
|
"Bash(cargo clean *)",
|
|
"Bash(cargo test *)",
|
|
"Bash(sed -i \"s/TIMESTAMP/$\\(date +%s%N\\)/\" otlp-test.json)",
|
|
"Bash(curl -sS -w '\\\\nHTTP %{http_code}\\\\n' -X POST https://telemetry.cbsk-tech.de/v1/logs -H 'Content-Type: application/json' --data @otlp-test.json --max-time 15)"
|
|
]
|
|
}
|
|
}
|