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.8.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.8.1
File Size Uploaded
mozilla_metric_config_parser-2026.8.1.tar.gz 62.9 kB Details

Release files / mozilla_metric_config_parser-2026.8.1.tar.gz

Download URL mozilla_metric_config_parser-2026.8.1.tar.gz
Size 62.9 kB
Tags Source
SHA-256 checksum
How to use checksums
656ad80016110610c0a4d3fb7cb60985296bc08c812a1b87dec28f52cf12c7be
BLAKE2b-256 checksum
How to use checksums
991a94cf9902e903b4553a480d62366bf880e48168fbbbd18b1ae440828fd2cc
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 Aug 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.8.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