-
Notifications
You must be signed in to change notification settings - Fork 1.6k
chore: replace error tracking in plugin server #31654
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR replaces Sentry error tracking with PostHog's own error tracking system throughout the plugin server codebase, removing all Sentry dependencies and configurations.
Key changes:
- Removed Sentry packages (@sentry/node, @sentry/profiling-node, etc.) and upgraded posthog-node from 4.5.2 to 4.14.0
- Replaced
initSentry()
withinitSuperProperties()
for error tracking initialization - Removed lingering
transaction.finish()
call ineach-batch-webhooks.ts
that could cause runtime errors - Renamed parameters like
sendTimeoutGuardToSentry
tosendException
across multiple files for consistency - Removed Sentry breadcrumb event listeners from Kafka consumers, potentially impacting debug visibility
The changes maintain core error tracking functionality while consolidating to PostHog's system, though some Sentry features like profiling integration will need alternative solutions.
22 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
if (error?.isRetriable === false) { | ||
const sentryEventId = captureException(error) | ||
captureException(error) | ||
const headers: MessageHeader[] = message.headers ?? [] | ||
headers.push({ ['sentry-event-id']: sentryEventId }) | ||
headers.push({ ['event-id']: event.uuid }) | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: consider adding error context (e.g. event UUID) to captureException for better debugging
import { PostHog } from 'posthog-node' | ||
import { SeverityLevel } from 'posthog-node/src/extensions/error-tracking/types' | ||
|
||
import { defaultConfig } from '../config/config' | ||
import { Team } from '../types' | ||
|
||
const fs = require('fs') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Use ES6 import syntax for consistency with other imports
// Docker containers should have a commit.txt file in the base directory with the git | ||
// commit hash used to generate them. `plugin-server` runs from a child directory, so we | ||
// need to look up one level. | ||
superProperties['release'] = fs.readFileSync('../commit.txt', 'utf8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider using path.join() to handle path separators correctly across platforms
superProperties['release'] = fs.readFileSync('../commit.txt', 'utf8') | |
superProperties['release'] = fs.readFileSync(path.join(__dirname, '..', 'commit.txt'), 'utf8') |
Size Change: -30 B (0%) Total Size: 13.6 MB ℹ️ View Unchanged
|
Important
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Problem
Replace Sentry with PostHog equivalents