Skip to content
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

chore: Track live batch exports #18815

Closed
wants to merge 2 commits into from

Conversation

tomasfarias
Copy link
Contributor

@tomasfarias tomasfarias commented Nov 22, 2023

Problem

We have a big advantage when it comes to auto-scaling: We can know how many batch exports will trigger at every hour, day, etc... This way, we can scale up capacity before we hit the next interval mark (i.e. the beginning of the next hour, day, etc...) as we see this number cross certain thresholds.

However, we are currently not tracking this metric.

Changes

  • Add a prom gauge that:
    • Is incremented when a batch export is created or unpaused.
    • Is decremented when a batch export is deleted or paused.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

How did you test this code?

@tomasfarias tomasfarias force-pushed the chore/track-live-batch-exports branch from 6eafac4 to 48df2b9 Compare November 22, 2023 12:03
@tomasfarias tomasfarias requested a review from a team November 22, 2023 12:03
Copy link
Contributor

@xvello xvello left a comment

Choose a reason for hiding this comment

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

I feel like this gauge will be non-trivial to use, as this timeseries will be tagged by pod, and values will fall out of scope as the web pods churn.

As we don't really need to react at the second precision, I recommend counting the relevant rows in PG and exporting that gauge from a Celery job, through the pushgateway. This way, you get a single timeseries per region, that won't suffer from aggregation artifacts.

You can clone the pg_row_count task and go from there.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Contributor

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants