Metric reference doesn't include metric filters
See original GitHub issueDescription
Example metrics:
metrics:
- name: metric1
type: count_distinct
filters:
- field: is_completed
operator: '='
value: 'true'`
- name: metric2
type: number
sql:${metric1}/100
The SQL generated for metric2 doesn’t include the filter from metric1.
App Version
0.284.2
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Filter and pattern syntax - Amazon CloudWatch Logs
Metric filters are configurations that include filter patterns. You can create metric filters to match terms in your log events and convert log...
Read more >AWS::Logs::MetricFilter does not accept dimensions · Issue #64
The following announcement makes dimensions available for metric filters. ... However, it appears to be missing when specifying the resource through ...
Read more >Create a metric filter for a log group - Amazon CloudWatch Logs
How to create a metric filter that publishes a metric to CloudWatch based on the contents of a log group.
Read more >put-metric-filter — AWS CLI 2.9.7 Command Reference
The fields to use as dimensions for the metric. One metric filter can include as many as three dimensions. Warning. Metrics extracted from...
Read more >Cloudwatch metric filter sees event, but alarm doesn't fire
You're setting the unit on the metric_alarm to be Count , but you're not setting a unit on the metric_filter 's metric_transformation ,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem should also be present with our metric definitions.
Me and @owlas had a private conversation about this and we concluded that, based on the example given:
metric2
generated SQL should contain the filter logic frommetric1
metric2
doesn’t inherit the filters configuration from metrics1. Meaning that when viewing the underlying data frommetric2
no filter will be applied. The user can define the same filters inmetric2
if needed.@owlas In this case, if I click to view the underlying data of metric2, should it apply the filters of metric 1?
If so, does dbt manifest provide what metrics it depends on ? or would we need to figure that out ourselves? We would have to do that for the Lightdash metrics in the translate() function. 🤔