Skip to main content

metric-config-parser

This package parses configuration files that are compatible with jetstream and opmon compatible configuration files.

Installation

pip install mozilla-metric-config-parser

Templating in from_expression

A data source's from_expression supports two independent templating layers:

  • {dataset} (single braces, Python str.format) is replaced with an app-specific dataset for Glean apps. If used, default_dataset is mandatory.
  • {{experiment.<attr>}} (double braces, Jinja) is replaced with an attribute of the experiment the data source is being resolved for, e.g. {{experiment.normandy_slug}}, {{experiment.start_date_str}}, {{experiment.end_date_str}}, {{experiment.last_enrollment_date_str}}. This is only rendered when the expression actually references experiment, and is only available when resolving a data source for an experiment.
[data_sources.messaging_events]
from_expression = """(
    SELECT *
    FROM `moz-fx-data-shared-prod.fenix.events_stream`
    WHERE STARTS_WITH(extras.string.message_key, '{{experiment.normandy_slug}}:')
)"""
experiments_column_type = "none"

A literal brace can still be written by doubling it, e.g. '{{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}}'.

Testing

Pytest

pytest --ruff --ignore=metric_config_parser/tests/integration/

Linting and formatting

ruff check metric_config_parser
ruff format --check metric_config_parser
mypy metric_config_parser

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mozilla_metric_config_parser-2026.7.1.tar.gz (62.4 kB view details)

Uploaded Source

File details

Details for the file mozilla_metric_config_parser-2026.7.1.tar.gz.

File metadata

File hashes

Hashes for mozilla_metric_config_parser-2026.7.1.tar.gz
Algorithm Hash digest
SHA256 7d8ca39c5d462137659600a5a45db79d9a3f03ba0577151941644471db3a5612
MD5 bf2a403657b8039899888f31bfa0d10b
BLAKE2b-256 8b323906306d0dba594ca8e7d95a32cc8d2d6d311dca8e15e36b3c40d9d4acba

See more details on using hashes here.

Provenance

The following attestation bundles were made for mozilla_metric_config_parser-2026.7.1.tar.gz:

Publisher: deploy-metric-config-parser.yml on mozilla/metric-hub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page