Skip to content

Conversation

@victoria-yining-huang
Copy link
Contributor

@victoria-yining-huang victoria-yining-huang commented Dec 9, 2025

The goal of this ticket is to report streams specific errors to our own sentry project, while a customer application that imports sentry_streams should still receive their application specific errors in their separate sentry project.

Intended behaviour:

image image

client app code i tested with:


import uuid
from datetime import date
from functools import partial
from typing import Sequence

from sentry_kafka_schemas.schema_types.events_v1 import EventStreamMessage
from sentry_streams.pipeline import Batch, Map, ParquetSerializer, streaming_source
from sentry_streams.pipeline.message import Message as StreamsMessage
from sentry_streams.pipeline.pipeline import GCSSink

from consumer.streaming_platform.processing_strategies.errors import ErrorsProcessorGCS
import sentry_sdk

sentry_sdk.init(
    dsn="https://20699d75a9ff7c55b2e6a8c5abc55066@o1.ingest.us.sentry.io/4510506713284608",
    # Add data like request headers and IP for users,
    # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
    send_default_pii=True,
)

my_processor = ErrorsProcessorGCS()


def processing_func(
    processor: ErrorsProcessorGCS, msg: StreamsMessage[Sequence[EventStreamMessage]]
):
    return processor.process_streaming_batch(msg)


def generate_files() -> str:
    file_name = (
        "errors-gcs"
        + "/dt="
        + str(date.today())
        + "/data-"
        + str(uuid.uuid4())
        + ".parquet"
    )
    return file_name


pipeline = streaming_source(name="myinput", stream_name="events")

parsed_batches = pipeline.apply(Batch(name="mybatch", batch_size=2))

transformed_batches = parsed_batches.apply(
    Map(name="process", function=partial(processing_func, my_processor))
)
transformed_batches.apply(
    ParquetSerializer(
        name="serializer", schema_fields=my_processor.schema_fields_sentrystreams
    )
).sink(
    GCSSink(name="mysink", bucket="arroyo-artifacts", object_generator=generate_files)
)

@victoria-yining-huang victoria-yining-huang changed the title feat(sentry_integration): discovered load_runtime exec's the client app feat(sentry_integration): discovered load_runtime exec's the customer's app Dec 9, 2025
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