Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.3 KB
Raw Blame
"""Signal emitter for rollbar `items` (record kind: issue).

Rollbar timestamps are Unix epoch (seconds); `title` is the item's error title.
"""

from products.signals.backend.emission._common import make_flat_emitter
from products.signals.backend.emission._prompts import ERROR_ACTIONABILITY_PROMPT, ERROR_SUMMARIZATION_PROMPT
from products.signals.backend.emission.fetchers.data_warehouse import data_warehouse_record_fetcher
from products.signals.backend.emission.registry import SignalSourceTableConfig

ROLLBAR_FIELDS = ("id", "title", "level", "status", "environment", "framework", "last_occurrence_timestamp")

ROLLBAR_CONFIG = SignalSourceTableConfig(
    source_product="rollbar",
    source_type="issue",
    emitter=make_flat_emitter(
        source_product="rollbar",
        source_type="issue",
        id_field="id",
        title_field="title",
        extra_fields=("level", "status", "environment", "framework", "last_occurrence_timestamp"),
    ),
    record_fetcher=data_warehouse_record_fetcher,
    partition_field="fromUnixTimestamp(toInt(first_occurrence_timestamp))",
    fields=ROLLBAR_FIELDS,
    where_clause="status != 'resolved'",
    max_records=500,
    first_sync_lookback_days=1,
    actionability_prompt=ERROR_ACTIONABILITY_PROMPT,
    summarization_prompt=ERROR_SUMMARIZATION_PROMPT,
    description_summarization_threshold_chars=2000,
)