Skip to content

Conversation

@Litarnus
Copy link
Contributor

@Litarnus Litarnus commented Jan 12, 2026

DESCRIBE YOUR PR

Merge this once getsentry/sentry-php#1995 was merged and released

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

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.

EXTRA RESOURCES

@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jan 12, 2026 6:04pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
develop-docs Ignored Ignored Jan 12, 2026 6:04pm

@Litarnus Litarnus self-assigned this Jan 12, 2026
```php
// Record five total button clicks
\Sentry\trace_metrics()->count('button-click', 5, ['browser' => 'Firefox', 'app_version' => '1.0.0']);
\Sentry\traceMetrics()->count('button-click', 5, ['browser' => 'Firefox', 'app_version' => '1.0.0']);
Copy link

Choose a reason for hiding this comment

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

Bug: The documentation incorrectly uses \Sentry\traceMetrics() instead of the correct PHP SDK function \Sentry\trace_metrics(), which will cause a fatal error for users.
Severity: CRITICAL

🔍 Detailed Analysis

The documentation was updated to reference the function \Sentry\traceMetrics(). However, the correct function name in the Sentry PHP SDK is \Sentry\trace_metrics(). Users who copy the provided code examples will encounter a fatal "Call to undefined function \Sentry\traceMetrics()" error at runtime. This change affects all PHP documentation (vanilla, Laravel, and Symfony), effectively breaking the metrics feature for any developer following the official guides.

💡 Suggested Fix

Revert all instances of \Sentry\traceMetrics() back to the correct function name, \Sentry\trace_metrics(), across all updated PHP documentation files (php.mdx, php.laravel.mdx, php.symfony.mdx).

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: platform-includes/metrics/usage/php.laravel.mdx#L13

Potential issue: The documentation was updated to reference the function
`\Sentry\traceMetrics()`. However, the correct function name in the Sentry PHP SDK is
`\Sentry\trace_metrics()`. Users who copy the provided code examples will encounter a
fatal "Call to undefined function \Sentry\traceMetrics()" error at runtime. This change
affects all PHP documentation (vanilla, Laravel, and Symfony), effectively breaking the
metrics feature for any developer following the official guides.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8491052

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, but once we merged the referenced PR in the comment it will resolve just fine

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