Giter VIP home page Giter VIP logo

metric-config-parser's Issues

Parse some optional fields in metric-hub metrics

As part of the Metrics & Measurement Team's Metrics Taxonomy work, we'd like to request some parsing/checking of fields in metric-hub metrics, specifically:

  • the owner field appears to be a single string or a list of strings, I think either is fine, but we should check that via parsing; also, it would be nice to display the owner(s) in metric-hub's interface and datahub (where it already has a field for Owners in the right-hand toolbar, but doesn't seem to be connected to this field)
  • the deprecated field appears to be a boolean, but we should check that via parsing; again, it would be very useful to display that prominently in metric-hub's interface and datahub (and even perhaps change other visual aspects of metrics where the value is True to make it very obvious to users that the metric is deprecated and should not be used)
  • the category field appears to be a string, and even though it's not used currently (according to docs), it could be nice to display that in metric-hub's interface and datahub (and it would be very cool to be able to click on it to see everything in that category or search by category -- though that may be a more complex request)
  • a field that hasn't been used before but we'd like to start using is level, which is a string that can have 1 of 3 possible values ("gold", "silver", "bronze"); this would also be important to surface in metric-hub's interface and datahub
    Lastly, we'll note that all 4 of these fields should be optional.

Ability to suppress metric display in Experimenter

Some metrics may only be defined for a single branch. These can be confusing when displayed in Experimenter. It would be nice to have the ability to suppress metric display in Experimenter as configured through metric-hub. For example:

[metrics.my_metric]
suppress_experimenter_display = true

Support loading metric definitions from Jetstream Outcomes into Mozanalysis

I have a metric here defined in a Jetstream Outcome that is frequently used in experiments.

I use mozanalysis to size. I would like to be able to use the definition directly from the Outcome in my sizing scripts. Something like

from mozanalysis.config import ConfigLoader
metric = ConfigLoader.get_metric(metric_slug="urlbar_search_count", app_name="firefox_desktop", outcome="firefox_suggest")

TypeError when trying to use Metrics Hub with Mozanalysis

I follow the docs here to use a Segment Data Source from Metrics Hub with Mozanalysis, but got a TypeError. I'm not sure what the intended usage is.

Python:

from metric_config_parser.config import ConfigCollection
config_collection = ConfigCollection.from_github_repo("https://github.com/mozilla/metric-hub")
clients_daily = config_collection.get_segment_data_source_definition("clients_daily", app_name="firefox_desktop")

from mozanalysis.segments import Segment
us_clients = Segment(
    name="us_clients",
    data_source=clients_daily,
    select_expr="COALESCE(country = 'US', FALSE)",
)

Error:

TypeError: ("'data_source' must be <class 'mozanalysis.segments.SegmentDataSource'> (got SegmentDataSourceDefinition(name='clients_daily', from_expression='mozdata.telemetry.clients_daily', window_start=0, window_end=0, client_id_column='client_id', submission_date_column='submission_date', default_dataset=None) that is a <class 'metric_config_parser.segment.SegmentDataSourceDefinition'>).", Attribute(name='data_source', default=NOTHING, validator=<instance_of validator for type <class 'mozanalysis.segments.SegmentDataSource'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), <class 'mozanalysis.segments.SegmentDataSource'>, SegmentDataSourceDefinition(name='clients_daily', from_expression='mozdata.telemetry.clients_daily', window_start=0, window_end=0, client_id_column='client_id', submission_date_column='submission_date', default_dataset=None))

Require python 3.10

Our current config has python 3.6 as the minimum requirement, but let's bring that up to date with other parts of analysis (jetstream, mozanalysis) and require >=3.10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.