Skip to content

feat(profiling): Add task for taskbroker passthrough mode#115065

Draft
untitaker wants to merge 1 commit intomasterfrom
untitaker/stream-882-profiles-passthrough
Draft

feat(profiling): Add task for taskbroker passthrough mode#115065
untitaker wants to merge 1 commit intomasterfrom
untitaker/stream-882-profiles-passthrough

Conversation

@untitaker
Copy link
Copy Markdown
Member

Summary

Add process_profile_from_kafka task for taskbroker's passthrough mode (STREAM-882). This allows taskbroker to read directly from the ingest-profiles Kafka topic and dispatch tasks without a separate consumer.

  • New task process_profile_from_kafka in ingest.profiling.passthrough namespace
  • Refactored shared logic into _process_profile_message
  • Removed base64 encoding - tasks now accept bytes directly
  • Use Kafka headers for killswitch/sampled when available

Dependencies

Depends on getsentry/taskbroker#623 for exposing Kafka headers to tasks.

Test plan

  • Existing consumer tests pass
  • Integration test with taskbroker passthrough mode

Fixes STREAM-882

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 7, 2026

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 7, 2026
Comment thread src/sentry/profiles/consumers/process/factory.py Outdated
@untitaker untitaker force-pushed the untitaker/stream-882-profiles-passthrough branch from 19bdf6d to ea292c8 Compare May 7, 2026 14:00
Add `process_profile_from_kafka` task that accepts raw Kafka message bytes
for use with taskbroker's passthrough mode. This allows taskbroker to read
directly from the ingest-profiles Kafka topic.

Changes:
- New task `process_profile_from_kafka` in `ingest.profiling.passthrough` namespace
- Refactored `_process_profile_message` to share logic between consumer and task
- Removed base64 encoding - tasks now accept bytes directly
- Use Kafka headers for killswitch/sampled when available, fall back to message body

Depends on getsentry/taskbroker#623 for exposing Kafka headers to tasks.

STREAM-882
@untitaker untitaker force-pushed the untitaker/stream-882-profiles-passthrough branch from ea292c8 to 5e0fcac Compare May 7, 2026 14:02
@untitaker untitaker force-pushed the untitaker/stream-882-profiles-passthrough branch from 2f50369 to 5e0fcac Compare May 7, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant