Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for span creating mode in metrics.timing API #3248

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

markushi
Copy link
Member

@markushi markushi commented Mar 7, 2024

📜 Description

As described in the RFC: https://github.com/getsentry/rfcs/edit/main/text/0123-metrics-correlation.md
We want .timing() to be in span-creating mode, meaning a span is automatically created.

💚 How did you test it?

Added unit tests

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Mar 7, 2024

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

Generated by 🚫 dangerJS against ddc0915

Copy link
Contributor

github-actions bot commented Mar 7, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 428.81 ms 521.57 ms 92.76 ms
Size 1.70 MiB 2.28 MiB 592.02 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0404ea3 332.47 ms 401.12 ms 68.66 ms
86f0096 381.33 ms 476.58 ms 95.25 ms
0bd723b 375.20 ms 452.41 ms 77.20 ms
b172d4e 352.92 ms 446.50 ms 93.58 ms
d007225 365.63 ms 438.24 ms 72.62 ms
93a76ca 381.08 ms 459.22 ms 78.14 ms
7ab32b6 373.62 ms 480.61 ms 106.99 ms
d6d2b2e 392.55 ms 467.50 ms 74.95 ms
baaf637 418.39 ms 496.86 ms 78.47 ms
8ff8fd0 432.77 ms 495.18 ms 62.41 ms

App size

Revision Plain With Sentry Diff
0404ea3 1.72 MiB 2.29 MiB 577.52 KiB
86f0096 1.72 MiB 2.29 MiB 576.50 KiB
0bd723b 1.72 MiB 2.29 MiB 578.09 KiB
b172d4e 1.72 MiB 2.29 MiB 578.09 KiB
d007225 1.70 MiB 2.27 MiB 586.31 KiB
93a76ca 1.72 MiB 2.29 MiB 576.75 KiB
7ab32b6 1.70 MiB 2.27 MiB 584.63 KiB
d6d2b2e 1.72 MiB 2.27 MiB 555.05 KiB
baaf637 1.72 MiB 2.27 MiB 558.42 KiB
8ff8fd0 1.72 MiB 2.27 MiB 558.15 KiB

Previous results on branch: feat/metrics-timing-span-creating-mode

Startup times

Revision Plain With Sentry Diff
7434738 402.62 ms 480.98 ms 78.36 ms

App size

Revision Plain With Sentry Diff
7434738 1.70 MiB 2.28 MiB 592.02 KiB

aggregator
.getMetricsAggregator()
.timing(key, callback, durationUnit, enrichedTags, stackLevel, localMetricsAggregator);
final @Nullable ISpan span = aggregator.startSpanForMetric("metric.timing", key);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
final @Nullable ISpan span = aggregator.startSpanForMetric("metric.timing", key);
final @Nullable ISpan span = aggregator.startSpanForMetric("metrics.timing", key);

should it be metric or metrics?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fine this way, as it matches python / ruby

Copy link
Member

@stefanosiano stefanosiano left a comment

Choose a reason for hiding this comment

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

nice!

@markushi markushi merged commit f4f39c7 into main Mar 7, 2024
24 checks passed
@markushi markushi deleted the feat/metrics-timing-span-creating-mode branch March 7, 2024 15:22
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.

2 participants