Skip to content

Instantly share code, notes, and snippets.

@cnolanminich
Created May 14, 2025 16:35
Show Gist options
  • Select an option

  • Save cnolanminich/07b00b3402c7e22589ee03b39063d8a9 to your computer and use it in GitHub Desktop.

Select an option

Save cnolanminich/07b00b3402c7e22589ee03b39063d8a9 to your computer and use it in GitHub Desktop.
Dagster OSS Credit estimate
with events as (select distinct
DATE_FORMAT(timestamp, '%Y-%m') as event_month,
dagster_event_type,
coalesce(run_id, '||', step_key) as step_id,
count(1) as credits
from event_logs
where dagster_event_type = 'STEP_START'
or dagster_event_type = 'ASSET_MATERIALIZATION'
group by 1, 2, 3
)
select
event_month,
sum(credits) as sum_credits
from events
group by 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment