question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature] Allow for custom-defined metrics types

See original GitHub issue

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

Note: I am creating this issue following a Slack thread during 2022-08-04 dbt Staging.

Currently there is a defined list of type values that may be used for metrics. I assume that over time more will be added, like median. I support adding various common, standard types.

BUT, it would be nice if users could define their own custom types. That would make it super extensible, and then dbt devs wouldn’t be on the hook to anticipate every scenario. A custom type would likely be very specific to an org’s business context, so it makes sense for development to be in the hands of the user rather than relying on a finite list.

I hypothesize that while any individual custom definition of a type could be considered fringe or rare, in aggregate, the various fringe types could constitute a significant proportion of metrics that users need to implement.

Describe alternatives you’ve considered

dbt devs greatly expand the type options, while still inevitably failing to anticipate all user needs.

Who will this benefit?

  • Users who want to develop a metric type that has not yet been conceived of and/or is not one that should be made available to the broader community, most likely because it is a fringe use case.
  • dbt devs who don’t have to do as much work building out type options.

Are you interested in contributing this feature?

Possibly! I don’t know enough about the mechanics of type or metrics overall to say if I’d be the best person to help with this, but it seems possible that I could be helpful.

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
callum-mcdatacommented, Aug 5, 2022

@leoebfolsom that first description is correct! Just like the overriding of other dbt macros for things like namespacing, the user would be responsible to keep it updated. But it gives you the flexibility to add any metric aggregation that you are interested in (within reasonable limits).

I mention the reasonable limits because more complicated aggregations like window functions would probably fail due to the way we construct the sql but I haven’t extensively tested this issue.

I’ll close out this issue because the functionality exists but if you have any questions feel free to ping me or we can open up another issue!

0reactions
leoebfolsomcommented, Aug 8, 2022

@joellabes thank you for going through this, it makes sense! I think if we added custom macros, we’d call them median_custom_companyname or something to avoid the exact issue you mentioned. A little hacky, but feels like a reasonable practice to avoid collisions while still always inheriting the latest and greatest from the main package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom metrics | Cloud Monitoring
Custom metrics, also known as application-specific metrics, let you define and collect information the built-in Cloud Monitoring metrics cannot.
Read more >
Custom dimensions & metrics - Analytics Help - Google Support
Custom dimensions and metrics allow you to combine Analytics data with non-Analytics data, e.g. CRM data. For example: If you store the gender...
Read more >
Publishing custom metrics - Amazon CloudWatch
You can publish your own metrics to CloudWatch using the AWS CLI or an API. You can view statistical graphs of your published...
Read more >
Custom metrics overview (preview) - Power Automate
The custom metrics (also known as calculated metrics) module allows you to use pre-defined metrics in the application, ...
Read more >
Custom Metric form - ServiceNow Docs
Icon, An icon for the custom metric type. The custom metric type appears as the selected icon in Survey Designer. ; Active, Option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found