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

Metadata

Release files for mozilla-metric-config-parser 2026.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mozilla-metric-config-parser 2026.9.1
File Size Uploaded
mozilla_metric_config_parser-2026.9.1.tar.gz 64.1 kB Details

Release files / mozilla_metric_config_parser-2026.9.1.tar.gz

Download URL mozilla_metric_config_parser-2026.9.1.tar.gz
Size 64.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7c44fb18c3228280bd1251b03ddd89ed873f75a589b8bc772de3ed9fb27098fe
BLAKE2b-256 checksum
How to use checksums
60a3074fa922731c69620bf39145b2db8bbd339ac5c344ceb4f2f1cfb9f3290a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.9.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page