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.

Metric reference doesn't include metric filters

See original GitHub issue

Description

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:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ZeRegocommented, Oct 24, 2022

is this for dbt metrics specifically? Is this working for the new filters: syntax we added for meta metrics?

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 from metric1
  • metric2 doesn’t inherit the filters configuration from metrics1. Meaning that when viewing the underlying data from metric2 no filter will be applied. The user can define the same filters in metric2 if needed.
1reaction
ZeRegocommented, Oct 20, 2022

@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. 🤔

Read more comments on GitHub >

github_iconTop 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 >

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