Skip to content

feat: include Python version in metrics uploads - #9973

Merged
Soulter merged 1 commit into
masterfrom
codex/python-version-metrics
Sep 7, 2026
Merged

feat: include Python version in metrics uploads#9973
Soulter merged 1 commit into
masterfrom
codex/python-version-metrics

Conversation

@Soulter

@Soulter Soulter commented Sep 7, 2026

Copy link
Copy Markdown
Member

Metrics uploads currently include the AstrBot version and operating system but omit the Python runtime version. Add python_version using platform.python_version() so runtime usage can be measured.

Closes #9960.

Modifications

  • Include the full Python version (for example, 3.12.12) in the shared metrics payload for both immediate and batched uploads.
  • This is not a breaking change.

Verification Steps and Test Results

  • uv run --no-sync ruff format .: 504 files unchanged.
  • uv run --no-sync ruff check .: all checks passed.
  • git diff --check: passed.
  • Local smoke check with mocked HTTP: immediate and batched uploads both include the runtime version, batched counters remain correct, and both the environment variable and configuration opt-outs prevent uploads.

Checklist

Summary by Sourcery

New Features:

  • Include the full Python runtime version in metrics upload payloads.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the version is collected or interpreted incorrectly, the metrics service will receive an inaccurate or unnecessarily disclosed Python version. Reverting stops future uploads, but values already sent remain in the metrics data and would need bounded cleanup or filtering if that mattered.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
astrbot-docs 22bbcac Commit Preview URL

Branch Preview URL
Sep 07 2026, 02:31 PM

@Soulter
Soulter merged commit 48d0da7 into master Sep 7, 2026
24 checks passed
@Soulter
Soulter deleted the codex/python-version-metrics branch September 7, 2026 15:41
BegoniaHe pushed a commit to Xero-Team/AstrBot that referenced this pull request Sep 7, 2026
Add python_version to the telemetry payload alongside os and VERSION.

Upstream-Commit: 48d0da7
Upstream-Author: Soulter <37870767+Soulter@users.noreply.github.com>
Upstream-PR: AstrBotDevs#9973
Sync-Disposition: adapt
Fork-Adaptation: Patch MetricsRuntime._post_metrics instead of the removed Metric class.
Tested: uv run pytest tests/unit/test_metrics.py -q
AI-Generated: true
Generated-At: 2026-09-07T17:03:57Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Supports Python version metrics upload

1 participant