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, Pythonstr.format) is replaced with an app-specific dataset for Glean apps. If used,default_datasetis 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 referencesexperiment, 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
File details
Details for the file mozilla_metric_config_parser-2026.7.1.tar.gz.
File metadata
- Download URL: mozilla_metric_config_parser-2026.7.1.tar.gz
- Upload date:
- Size: 62.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d8ca39c5d462137659600a5a45db79d9a3f03ba0577151941644471db3a5612
|
|
| MD5 |
bf2a403657b8039899888f31bfa0d10b
|
|
| BLAKE2b-256 |
8b323906306d0dba594ca8e7d95a32cc8d2d6d311dca8e15e36b3c40d9d4acba
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mozilla_metric_config_parser-2026.7.1.tar.gz -
Subject digest:
7d8ca39c5d462137659600a5a45db79d9a3f03ba0577151941644471db3a5612 - Sigstore transparency entry: 2306610934
- Sigstore integration time:
-
Permalink:
mozilla/metric-hub@5d78d612d751911041d444e81f1e7a88396e7668 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mozilla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy-metric-config-parser.yml@5d78d612d751911041d444e81f1e7a88396e7668 -
Trigger Event:
push
-
Statement type: