Skip to content

Conversation

@adinauer
Copy link
Member

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@adinauer adinauer requested a review from a team as a code owner January 19, 2026 09:43
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 19, 2026
],
});

export const metrics = <
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the java platforms (java, java-log4j, java-spring, etc) are missing in the withMetricsOnboarding Set in platformCategories.tsx.

Then it shows up in Explore > 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.

This is changed in #106513

Copy link
Contributor

@lbloder lbloder left a comment

Choose a reason for hiding this comment

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

LGTM 👍

)

<!-- Describe your PR here. -->

<!--

  Sentry employees and contractors can delete or ignore the following.

-->

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

---------

Co-authored-by: Lukas Bloder <lukas.bloder@gmail.com>
Copy link
Contributor

@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.

Copy link
Contributor

@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.


export const limitedMetricsSupportPrefixes: Set<string> = new Set([
'android',
'java',
Copy link
Member

Choose a reason for hiding this comment

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

Are we listing only java because it serves as a prefix for java-logback, java-log4j2, java-spring, and java-spring-boot?

Copy link
Member Author

Choose a reason for hiding this comment

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

There seems to only be prefixes here for other SDKs so I replicated this for Java too.

Comment on lines 38 to 68
export const metricsVerify = <
PlatformOptions extends BasePlatformOptions = BasePlatformOptions,
>(
params: DocsParams<PlatformOptions>
): ContentBlock => ({
type: 'conditional',
condition: params.isMetricsSelected,
content: [
{
type: 'text',
text: t(
'Send test metrics from your app to verify metrics are arriving in Sentry.'
),
},
{
type: 'code',
tabs: [
{
label: 'Java',
language: 'java',
code: getMetricsVerifyJavaSnippet(),
},
{
label: 'Kotlin',
language: 'kotlin',
code: getMetricsVerifyKotlinSnippet(),
},
],
},
],
});
Copy link
Member

Choose a reason for hiding this comment

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

It appears that this function is not used anywhere. Knip may be failing in this PR, though I haven’t confirmed yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

removed the function

${getMetricsCodeJava()}`;

export const getMetricsVerifyKotlinSnippet = () => `import io.sentry.Sentry
Copy link
Member

Choose a reason for hiding this comment

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

this is only being used in the metricsVerify which is not used anywhere. we should do a cleanup in this file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will clean the files up a bit.

{
type: 'text',
text: tct(
"To start using metrics, make sure your Sentry Java SDK version is [code:8.30.0] or higher. If you're on an older version of the SDK, follow our [link:migration guide] to upgrade.",
Copy link
Member

Choose a reason for hiding this comment

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

nit: should we say version here?

Comment on lines 72 to 74
docsPlatform,
}: {
docsPlatform: string;
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe java can be the default? or do we want to force developers to always inform the platform?

Copy link
Member Author

Choose a reason for hiding this comment

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

now inferring docsPlatform as you suggested

replayOnboardingJsLoader,
feedbackOnboardingJsLoader,
logsOnboarding: logs,
metricsOnboarding: metrics({docsPlatform: 'spring'}),
Copy link
Member

Choose a reason for hiding this comment

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

Based on what I observed, if we remove the java- prefix, the names are identical. I propose we avoid making the metrics a function and instead use something like params.platformKey.split('java-')[1] directly.

Co-authored-by: Priscila Oliveira <priscila.oliveira@sentry.io>
@priscilawebdev
Copy link
Member

@adinauer The issue is that the component renderWithOnboardingLayout
used in the javascript tests has the platformKey "java-spring-boot" set. Since you enabled Metrics for this platformKey, the checkbox is now displayed, causing the tests to fail.

I’ll update this test utility in a separate PR, so we don’t need to modify the JavaScript tests here in this PR. They shouldn’t fail when updating a Java platform.

priscilawebdev added a commit that referenced this pull request Jan 20, 2026
…latformKey (#106557)

Because the platformKey is static - java-spring-boot - enabling Metrics
for this platform is causing the JavaScript tests to fail, even though
they shouldn’t
([see](#106508 (comment))).
Copy link
Member

@priscilawebdev priscilawebdev left a comment

Choose a reason for hiding this comment

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

Nit: I’d update the sentence and combine the verify metrics code with the error so there’s one less code snippet ....just like we do for javascript-react:

Image

Other than that, it looks good to me! 🚀

@adinauer
Copy link
Member Author

Created getsentry/sentry-java#5043 to track the follow up for combining snippets so we can get this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants