Parser tools for Mozilla's Glean telemetry
Parser tools for Mozilla’s Glean telemetry.
Parses the metrics.yaml files for the Glean telemetry SDK and produces output for various integrations.
The full documentation is available here.
- Python 3.6 (or later)
The following library requirements are installed automatically when glean_parser is installed by pip.
Additionally on Python 3.6:
$ glean_parser --help
Read in metrics.yaml, translate to kotlin format, and output to output_dir:
$ glean_parser translate -o output_dir -f kotlin metrics.yaml
Check a Glean ping against the ping schema:
$ glean_parser check < ping.json
- BUGFIX: look for metrics in send_if_empty pings. Metrics for these kinds of pings were being ignored.
- Support for Python 3.5 has been dropped.
- BUGFIX: The ordering of event extra keys will now match with their enum, fixing a serious bug where keys of extras may not match the correct values in the data payload. See https://bugzilla.mozilla.org/show_bug.cgi?id=1648768.
- Breaking change: (Swift only) Combine all metrics and pings into a single generated file Metrics.swift.
- glinter messages have been improved with more details and to be more actionable.
- A maximum of 10 extra_keys is now enforced for event metric types.
- BUGFIX: the Lifetime enum values now match the values of the implementation in mozilla/glean.
- BUGFIX: yamllint errors are now reported using the correct file name.
- Support for using timing_distribution’s time_unit parameter to control the range of acceptable values is documented. The default unit for this use case is nanosecond to avoid creating a breaking change. See [bug 1630997](https://bugzilla.mozilla.org/show_bug.cgi?id=1630997) for more information.
- Dependencies that depend on the version of Python being used are now specified using the Declaring platform specific dependencies syntax in setuptools. This means that more recent versions of dependencies are likely to be installed on Python 3.6 and later, and unnecessary backport libraries won’t be installed on more recent Python versions.
- The minimum version of the runtime dependencies has been lowered to increase compatibility with other tools. These minimum versions are now tested in CI, in addition to testing the latest versions of the dependencies that was already happening in CI.
- Breaking change: glinter errors found during the translate command will now return an error code. glinter warnings will be displayed, but not return an error code.
- glean_parser now produces a linter warning when user lifetime metrics are set to expire. See [bug 1604854](https://bugzilla.mozilla.org/show_bug.cgi?id=1604854) for additional context.
- Breaking change: The regular expression used to validate labels is stricter and more correct.
- Add more information about pings to markdown documentation: * State whether the ping includes client id; * Add list of data review links; * Add list of related bugs links.
- glean_parser now makes it easier to write external translation functions for different language targets.
- BUGFIX: glean_parser now works on 32-bit Windows.
- Dropped the ‘inflection’ dependency.
- Constrained the ‘zipp’ and ‘MarkupSafe’ transitive dependencies to versions that support Python 3.5.
- BUGFIX: Fix rendering of first element of reason list.
- BUGFIX: Reason codes are displayed in markdown output for built-in pings as well.
- BUGFIX: Reason descriptions are indented correctly in markdown output.
- BUGFIX: To avoid a compiler error, the @JvmName annotation isn’t added to private members.
- Breaking Change (Java API) Have the metrics names in Java match the names in Kotlin. See [Bug 1588060](https://bugzilla.mozilla.org/show_bug.cgi?id=1588060).
- The reasons a ping are sent are now included in the generated markdown documentation.
- BUGFIX: The version of Jinja2 now specifies < 3.0, since that version no longer supports Python 3.5.
- BUGFIX: Fixes an import error in generated Kotlin code.
- BUGFIX: Generated Swift code now includes import Glean, unless generating for a Glean-internal build.
- Remove default schema URL from validate_ping
- Make schema argument required for CLI
- BUGFIX: Avoid default import in Swift code for Glean itself
- BUGFIX: Restore order of fields in generated Swift code
- Support for reason codes on pings was added.
- BUGFIX: The version of Jinja2 now specifies < 3.0, since that version no longer supports Python 3.5 (backported from 1.17.3).
- BUGFIX: Also allow the legacy name all_pings for send_in_pings parameter on metrics
- BUGFIX: Also allow the legacy name all_pings
- Add project title to markdown template.
- Remove “Sorry about that” from markdown template.
- BUGFIX: Replace dashes in variable names to force proper naming
- BUGFIX: Use a pure Python library for iso8601 so there is no compilation required.
- BUGFIX: Add some additional ping names to the non-kebab-case allow list.
- Restrict new pings names to be kebab-case and change all_pings to all-pings
- glean_parser now supports Python versions 3.5, 3.6, 3.7 and 3.8.
- The translate command will no longer clear extra files in the output directory.
- BUGFIX: Ensure all newlines in comments are prefixed with comment markers
- BUGFIX: Escape Swift keywords in variable names in generated code
- Generate documentation for pings that are sent if empty
- Reserve the deletion_request ping name
- Added a new flag send_if_empty for pings
- The glinter command now performs yamllint validation on registry files.
- The Kotlin linter detekt is now run during CI, and for local testing if installed.
- Python 3.8 is now tested in CI (in addition to Python 3.7). Using tox for this doesn’t work in modern versions of CircleCI, so the tox configuration has been removed.
- yamllint has been added to test the YAML files on CI.
- ⚠ Metric types that don’t yet have implementations in glean-core have been removed. This includes enumeration, rate, usage, and use_counter, as well as many labeled metrics that don’t exist.
- Allow a Swift lint for generated code
- New lint: Restrict what metric can go into the ‘baseline’ ping
- New lint: Warn for slight misspellings in ping names
- BUGFIX: change Labeled types labels from lists to sets.
- Use lists instead of sets in Labeled types labels to ensure that the order of the labels passed to the metrics.yaml is kept.
- glinter will now check for duplicate labels and error if there are any.
- Add labels from Labeled types to the Extra column in the Markdown template.
- BUGFIX: Don’t call is_internal_metric on Ping objects.
- Don’t include Glean internal metrics in the generated markdown.
- Glinter now warns when bug numbers (rather than URLs) are used.
- BUGFIX: add HistogramType and MemoryUnit imports in Kotlin generated code.
- Removed unsupported labeled metric types.
- Fix indentation for generated Swift code
- Created labeled metrics and events in Swift code and wrap it in a configured namespace
- BUGFIX: memory_unit is now passed to the Kotlin generator.
- A new parser config, do_not_disable_expired, was added to turn off the feature that expired metrics are automatically disabled. This is useful if you want to retain the disabled value that is explicitly in the metrics.yaml file.
- glinter will now report about superfluous no_lint entries.
- A “glinter” tool is now included to find common mistakes in metric naming and setup. This check is run during translate and warnings will be displayed. ⚠ These warnings will be treated as errors in a future revision.
- BUGFIX: GleanGeckoMetricsMapping must include LabeledMetricType and CounterMetricType.
- NEW: Support for outputting metrics in Swift.
- BUGFIX: Provides a helpful error message when geckoview_datapoint is used on an metric type that doesn’t support GeckoView exfiltration.
- Generate a lookup table for Gecko categorical histograms in GleanGeckoMetricsMapping.
- Introduce a ‘Swift’ output generator.
- Documentation only.
- Added support for generating markdown documentation from metrics.yaml files.
- quantity metric type has been added.
- BUGFIX: includeClientId was not being output for PingType.
- memory_distribution metric type has been added.
- custom_distribution metric type has been added.
- labeled_timespan is no longer an allowed metric type.
- Add a special all_pings value to send_in_pings.
- First release to start following strict semver.
- First release on PyPI.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size glean_parser-1.24.0-py3-none-any.whl (51.4 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size glean_parser-1.24.0.tar.gz (176.1 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for glean_parser-1.24.0-py3-none-any.whl