Name Description Size
__init__.py Top-level package for Glean parser. 533
__main__.py Console script for glean_parser. 8633
coverage.py Produce coverage reports from the raw information produced by the `GLEAN_TEST_COVERAGE` feature. 4405
data_review.py Produce skeleton Data Review Requests. 2152
go_server.py Outputter to generate server Go code for collecting events. This outputter is different from the rest of the outputters in that the code it generates does not use the Glean SDK. It is meant to be used to collect events in server-side environments. In these environments SDK assumptions to measurement window and connectivity don't hold. Generated code takes care of assembling pings with metrics, and serializing to messages conforming to Glean schema. Warning: this outputter supports limited set of metrics, see `SUPPORTED_METRIC_TYPES` below. The generated code creates the following: * Two methods for logging an Event metric one with and one without user request info specified 5346
javascript.py Outputter to generate Javascript code for metrics. 11230
javascript_server.py Outputter to generate server Javascript code for collecting events. This outputter is different from the rest of the outputters in that the code it generates does not use the Glean SDK. It is meant to be used to collect events in server-side environments. In these environments SDK assumptions to measurement window and connectivity don't hold. Generated code takes care of assembling pings with metrics, serializing to messages conforming to Glean schema, and logging with mozlog. Then it's the role of the ingestion pipeline to pick the messages up and process. Warning: this outputter supports limited set of metrics, see `SUPPORTED_METRIC_TYPES` below. There are two patterns for event structure supported in this environment: * Events as `Event` metric type, where we generate a single class per ping with `record{event_name}` method for each event metric. This is recommended to use for new applications as it allows to fully leverage standard Data Platform tools post-ingestion. * Custom pings-as-events, where for each ping we generate a class with a single `record` method, usually with an `event_name` string metric. Therefore, unlike in other outputters, here we don't generate classes for each metric. 8389
kotlin.py Outputter to generate Kotlin code for metrics. 13365
lint.py Helper function to split words on either `.` or `_`. 19948
markdown.py Outputter to generate Markdown documentation for metrics. 9066
metrics.py Classes for each of the high-level metric types. 14612
parser.py Code for parsing metrics.yaml files. 16361
pings.py Classes for managing the description of pings. 3435
python_server.py Outputter to generate server Python code for collecting events. This outputter is different from the rest of the outputters in that the code it generates does not use the Glean SDK. It is meant to be used to collect events in server-side environments. In these environments SDK assumptions to measurement window and connectivity don't hold. Generated code takes care of assembling pings with metrics, and serializing to messages conforming to Glean schema. Warning: this outputter supports limited set of metrics, see `SUPPORTED_METRIC_TYPES` below. The generated code creates a `ServerEventLogger` class for each ping that has at least one event metric. The class has a `record` method for each event metric. 4791
ruby_server.py Outputter to generate server ruby code for collecting events. This outputter is different from the rest of the outputters in that the code it generates does not use the Glean SDK. It is meant to be used to collect events using "events as pings" pattern in server-side environments. In these environments SDK assumptions to measurement window and connectivity don't hold. Generated code takes care of assembling pings with metrics, serializing to messages conforming to Glean schema, and logging using a standard Ruby logger. Then it's the role of the ingestion pipeline to pick the messages up and process. Warning: this outputter supports a limited set of metrics, see `SUPPORTED_METRIC_TYPES` below. 5190
rust.py Outputter to generate Rust code for metrics. 7330
schemas
swift.py Outputter to generate Swift code for metrics. 8957
tags.py Serialize the tag back to JSON object model. 1391
templates
translate.py High-level interface for translating `metrics.yaml` into other formats. 8403
translation_options.py Target language options for Translate function These are backend specific and optional, provide as key:value Rust: no options. Swift: - `namespace`: The namespace to generate metrics in - `glean_namespace`: The namespace to import Glean from - `allow_reserved`: When True, this is a Glean-internal build - `with_buildinfo`: If "true" the `GleanBuildInfo` is generated. Otherwise generation of that file is skipped. Defaults to "true". - `build_date`: If set to `0` a static unix epoch time will be used. If set to a ISO8601 datetime string (e.g. `2022-01-03T17:30:00`) it will use that date. Other values will throw an error. If not set it will use the current date & time. Kotlin: - `namespace`: The package namespace to declare at the top of the generated files. Defaults to `GleanMetrics`. - `glean_namespace`: The package namespace of the glean library itself. This is where glean objects will be imported from in the generated code. JavaScript: - `platform`: Which platform are we building for. Options are `webext` and `qt`. Default is `webext`. - `version`: The version of the Glean.js Qt library being used. This option is mandatory when targeting Qt. Note that the version string must only contain the major and minor version i.e. 0.14. - `with_buildinfo`: If "true" a `gleanBuildInfo.(js|ts)` file is generated. Otherwise generation of that file is skipped. Defaults to "false". - `build_date`: If set to `0` a static unix epoch time will be used. If set to a ISO8601 datetime string (e.g. `2022-01-03T17:30:00`) it will use that date. Other values will throw an error. If not set it will use the current date & time. Markdown: - `project_title`: The project's title. (press q to exit) 2037
util.py The types supported by JSON. This is only an approximation -- this should really be a recursive type. 16187
validate_ping.py Validates the contents of a Glean ping against the schema. 2118