glean-parser.rst (1191B)
1 Glean Parser 2 ============= 3 4 This linter verifies that Glean telemetry definitions files (metrics.yaml 5 and pings.yaml) are following the Glean schema and best practices 6 by using the built-in linting functionality from ``glean_parser``. 7 8 Common Issues 9 ------------- 10 11 Empty Data Review 12 ~~~~~~~~~~~~~~~~~ 13 14 The most common error is having empty or placeholder values in the ``data_reviews`` field: 15 16 .. code-block:: yaml 17 18 metrics: 19 example: 20 counter_metric: 21 data_reviews: 22 - "" # This will cause an error 23 - "TODO" # This will also cause an error 24 25 The ``data_reviews`` field must contain a valid URL to a data review. 26 27 Run Locally 28 ----------- 29 30 This mozlint linter can be run using mach: 31 32 .. parsed-literal:: 33 34 $ mach lint --linter glean-parser <file paths> 35 36 To run on all Glean configuration files: 37 38 .. parsed-literal:: 39 40 $ mach lint --linter glean-parser . 41 42 Configuration 43 ------------- 44 45 This linter is enabled by default and will run automatically when you make changes to Glean definitions files. 46 47 Sources 48 ------- 49 50 * :searchfox:`Configuration (YAML) <tools/lint/glean-parser.yml>` 51 * :searchfox:`Source <tools/lint/glean-parser/__init__.py>`