Skip to content

[1748] Add dummy EventBrokerProcessor to event processing pipeline#18318

Closed
jvcalderon wants to merge 4 commits intomasterfrom
feature/1748-event-broker-processor
Closed

[1748] Add dummy EventBrokerProcessor to event processing pipeline#18318
jvcalderon wants to merge 4 commits intomasterfrom
feature/1748-event-broker-processor

Conversation

@jvcalderon
Copy link
Copy Markdown
Contributor

@jvcalderon jvcalderon commented Mar 17, 2026

Description

Introduces EventBrokerProcessor, a new implementation of the EventProcessor interface, as the first step of the migration away from PostHog.

The processor is registered in Processors and runs in parallel with the existing analytics pipeline. For now it only emits a console.log() when triggered; no external side effects are introduced. The real HTTP request to the Event Broker will be implemented in a follow-up PR once the broker is available.

Addresses

Screenshots

N/A — no UI changes.

Launchcontrol

Adds a new internal event processor (EventBrokerProcessor) that runs alongside the existing PostHog pipeline and logs received events. This is a non-functional placeholder to validate the integration point before the real Event Broker delivery is wired in.


Summary by cubic

Adds a new EventBrokerProcessor to the backend event pipeline as the first step toward migrating off PostHog (Linear 1748). It runs alongside existing processors and only logs events; no external side effects.

  • New Features
    • Registered EventBrokerProcessor with AnalyticsProcessor, LoggingProcessor, and AuditLogsProcessor.
    • Current behavior: console.log of event, identity.type, and properties; HTTP delivery to the Event Broker will follow later.

Written for commit c0a08af. Summary will update on new commits.

Introduces EventBrokerProcessor, a new implementation of the EventProcessor
interface that runs in parallel with the existing PostHog/analytics pipeline.
For now it only emits a console.log when triggered; the real HTTP request to
the Event Broker will be wired in a follow-up PR.
@jvcalderon jvcalderon self-assigned this Mar 17, 2026
@jvcalderon jvcalderon marked this pull request as ready for review March 17, 2026 10:02
@jvcalderon jvcalderon requested a review from a team as a code owner March 17, 2026 10:02
@jvcalderon jvcalderon requested review from adrinr and removed request for a team March 17, 2026 10:02
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 35a4a5dfca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +13 to +15
console.log(`[EventBrokerProcessor] event received: ${event}`, {
identityType: identity.type,
properties,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid unconditional event logging in broker placeholder

This processor logs every event payload unconditionally, which reintroduces event logging in self-hosted non-dev environments where LoggingProcessor explicitly suppresses logs (skipLogging = env.SELF_HOSTED && !env.isDev() in packages/backend-core/src/events/processors/LoggingProcessor.ts). In those deployments, adding this processor causes all tracked events (including full properties) to be emitted to logs again, creating noisy output and potential exposure of sensitive metadata until the real broker integration is implemented.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Confidence score: 3/5

  • There is a concrete medium-risk issue in packages/backend-core/src/events/processors/EventBrokerProcessor.ts: a placeholder log currently emits each event’s full properties payload to stdout in production.
  • Given the 6/10 severity with high confidence (9/10), this creates real user-impact risk (sensitive data exposure/noisy production logging) unless the log is guarded before live pipeline registration.
  • Pay close attention to packages/backend-core/src/events/processors/EventBrokerProcessor.ts - ensure payload logging is disabled or properly gated in production event flow.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/backend-core/src/events/processors/EventBrokerProcessor.ts">

<violation number="1" location="packages/backend-core/src/events/processors/EventBrokerProcessor.ts:13">
P2: Guard this placeholder log before registering it in the live event pipeline; as written it emits every event's full properties payload to stdout in production.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

// TODO: Replace this log with a real HTTP request to the Event Broker once it is available.
// The Event Broker endpoint will receive the event payload and forward it to the internal
// ingestion pipeline (e.g. SQS → Logstash → S3 → Snowpipe).
console.log(`[EventBrokerProcessor] event received: ${event}`, {
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Mar 17, 2026

Choose a reason for hiding this comment

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

P2: Guard this placeholder log before registering it in the live event pipeline; as written it emits every event's full properties payload to stdout in production.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/backend-core/src/events/processors/EventBrokerProcessor.ts, line 13:

<comment>Guard this placeholder log before registering it in the live event pipeline; as written it emits every event's full properties payload to stdout in production.</comment>

<file context>
@@ -0,0 +1,18 @@
+    // TODO: Replace this log with a real HTTP request to the Event Broker once it is available.
+    // The Event Broker endpoint will receive the event payload and forward it to the internal
+    // ingestion pipeline (e.g. SQS → Logstash → S3 → Snowpipe).
+    console.log(`[EventBrokerProcessor] event received: ${event}`, {
+      identityType: identity.type,
+      properties,
</file context>
Fix with Cubic

Copy link
Copy Markdown
Member

@adrinr adrinr left a comment

Choose a reason for hiding this comment

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

Until this is implemented, we will be logging [EventBrokerProcessor] event received to datadog. Are we happy with it?

@jvcalderon jvcalderon added the do not merge PR is not ready to be merged - generally the PR description should say why label Mar 25, 2026
@jvcalderon
Copy link
Copy Markdown
Contributor Author

Until this is implemented, we will be logging [EventBrokerProcessor] event received to datadog. Are we happy with it?

Well, I probably won’t merge this as-is. I’ve marked it with the do not merge tag. This was created to split the work into smaller PRs, but there’s no point in adding this noise to the logs. I’ll merge it once a follow-up PR with the Event Broker implementation is merged.

@jvcalderon
Copy link
Copy Markdown
Contributor Author

Addressed in #18408

@jvcalderon jvcalderon closed this Mar 26, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

do not merge PR is not ready to be merged - generally the PR description should say why size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants