dbt-labs/dbt-core

[CT-1618] [Feature] Metric timestamp and time_grains should be optional

callum-mcdata opened this issue · 0 comments

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

In today's world, we state that dbt metrics are inherently time bound - they must be associated with a timestamp and any query of them is aggregated at the grain provided. This was initially bound with #6379 but this is actually something we can pursue before beginning that work - they're not bound to one another.

scratch oh wait that's not entirely true 😅

Based on feedback, we implemented a feature in the metrics package to support the 'all_time' grain where we aggregate to the base grain of the metric. So we already support a world where timestamp isn't really needed.

Additionally we have derived metrics which don't need timestamps because they combine the timestamps of other metrics.

So lets support this world we've created!

The Proposal

  • timestamp becomes an optional input
  • time_grains becomes an optional input
  • Rewrite dbt_metrics to make grain an optional input and the base behavior is all time. This will follow in another issue.

Describe alternatives you've considered

Not doing this but we already "support" it!

Who will this benefit?

Anyone who uses metrics but doesn't want to aggregate them by time!

Are you interested in contributing this feature?

You betcha!

Anything else?

No response