Skip to content

feat: Metrics support#553

Merged
limbonaut merged 55 commits intomainfrom
feat/metrics
Mar 5, 2026
Merged

feat: Metrics support#553
limbonaut merged 55 commits intomainfrom
feat/metrics

Conversation

@limbonaut
Copy link
Copy Markdown
Collaborator

@limbonaut limbonaut commented Mar 2, 2026

Adds support for emitting custom metrics to Sentry — track counters, gauges, and distributions directly from GDScript.

Metrics are enabled by default via options.experimental.enable_metrics and accessible through SentrySDK.metrics.

# Count occurrences
SentrySDK.metrics.count("match_started")
SentrySDK.metrics.count("enemies_spawned", wave_size, {"level": "castle"})

# Track point-in-time values
SentrySDK.metrics.gauge("players_online", lobby.get_player_count())
SentrySDK.metrics.gauge("memory_usage", OS.get_static_memory_usage(), "byte")

# Record value distributions
SentrySDK.metrics.distribution("level_load_time", load_time, "millisecond")

Metrics can be intercepted and modified via options.experimental.before_send_metric.

Supported on Windows, Linux, Android, and Web. Not yet supported on Apple platforms.

@limbonaut limbonaut added the Feature new feature label Mar 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 2, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (options) Support SENTRY_DSN, SENTRY_RELEASE, and SENTRY_ENVIRONMENT env vars by limbonaut in #548
  • Metrics support by limbonaut in #553
  • Add shutdown_timeout_ms option by limbonaut in #539

Bug Fixes 🐛

  • (export) Guard export plugins with platform feature checks by limbonaut in #557

Documentation 📚

  • Add README files for addon and demo project packages by limbonaut in #547
  • Update Web platform support information in README by limbonaut in #536

Internal Changes 🔧

Deps

  • Update Sentry Android to v8.34.0 by github-actions in #561
  • Update Sentry JavaScript to v10.42.0 by github-actions in #560
  • Bump serialize-javascript and terser-webpack-plugin in /src/sentry/javascript/bridge by dependabot in #559
  • Update Sentry JavaScript to v10.41.0 by github-actions in #555
  • Update Native SDK to v0.13.1 by github-actions in #544
  • Update Native SDK to v0.13.0 by github-actions in #533
  • Update Sentry Android to v8.33.0 by github-actions in #531
  • Update wasm-split to v26.2.1 by github-actions in #534
  • Update Sentry JavaScript to v10.40.0 by github-actions in #540

Other

  • (web) Optimize file attachment loading in WASM bridge by limbonaut in #538
  • Add .clangd to .gitignore by limbonaut in #552
  • Use better AssetLib icon by limbonaut in #549
  • Add GH_TOKEN and harden AssetLib workflow by limbonaut in #546
  • Automate AssetLib updates on release by limbonaut in #545
  • Generate a separate package with demo project by limbonaut in #542
  • Exclude MSVC linker byproducts from build artifact by limbonaut in #543
  • Run CI on all PRs regardless of changed paths by limbonaut in #541

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 2, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 7b6198c

@limbonaut limbonaut marked this pull request as ready for review March 3, 2026 22:17
Comment thread src/sentry/native/native_metric.cpp
Comment thread src/sentry/native/native_util.cpp
Comment thread src/sentry/internal_sdk.h Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/sentry/native/native_util.cpp
@limbonaut
Copy link
Copy Markdown
Collaborator Author

I'll extract 865b84c as separate PR, so we don't have to wait on native release.

@limbonaut limbonaut merged commit 9ba9dc8 into main Mar 5, 2026
61 checks passed
@limbonaut limbonaut deleted the feat/metrics branch March 5, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metrics Support

3 participants