From ba19433edb79f603284f0d4f12b4c7d6e8746435 Mon Sep 17 00:00:00 2001 From: Erik Oosterop Date: Sun, 3 Mar 2024 03:28:03 +0000 Subject: [PATCH 1/4] Initial version logic for sentry. --- CHANGELOG.md | 3 +++ src/mimosa/pipelines.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4f8a34..f2af813 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added +- Release version for sentry.io + ## [0.4.5] 2024-03-02 ### Changed - Improve query parameters to identify dates for which data exists diff --git a/src/mimosa/pipelines.py b/src/mimosa/pipelines.py index 4993fb2..bc71363 100755 --- a/src/mimosa/pipelines.py +++ b/src/mimosa/pipelines.py @@ -3,9 +3,11 @@ For example a class that loads data from European Gas data REST API. """ +import importlib.metadata import os import dlt +import sentry_sdk from dlt.sources.helpers import requests from dotenv import find_dotenv, load_dotenv from loguru import logger @@ -14,6 +16,17 @@ _ = load_dotenv(find_dotenv()) +version = importlib.metadata.version("ternyxmimosa") +sentry_sdk.init( + # ... + # By default the SDK will try to use the SENTRY_RELEASE + # environment variable, or infer a git commit + # SHA as release, however you may want to set + # something more human-readable. + release="ternyxmimosa@v" + + version, +) + class GEI: """Defines data loading pipeline for GEI gas storage data. From 8bbaecfde456bb80736c0b9b7ff00729c722f761 Mon Sep 17 00:00:00 2001 From: Erik Oosterop Date: Sun, 3 Mar 2024 03:35:06 +0000 Subject: [PATCH 2/4] sentry env variable --- .env.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 98849fa..108b508 100755 --- a/.env.example +++ b/.env.example @@ -8,4 +8,6 @@ DESTINATION__FILESYSTEM__BUCKET_URL = 's3://ternyx-test/gas_storage' DESTINATION__FILESYSTEM__CREDENTIALS__AWS_ACCESS_KEY_ID = 'XXX' DESTINATION__FILESYSTEM__CREDENTIALS__AWS_SECRET_ACCESS_KEY = 'XXX' DESTINATION__FILESYSTEM__CREDENTIALS__REGION_NAME = 'auto' -DESTINATION__FILESYSTEM__CREDENTIALS__ENDPOINT_URL = 'https://XXXXXX.r2.cloudflarestorage.com' \ No newline at end of file +DESTINATION__FILESYSTEM__CREDENTIALS__ENDPOINT_URL = 'https://XXXXXX.r2.cloudflarestorage.com' + +RUNTIME__SENTRY_DSN="https://@sentry.io/" \ No newline at end of file From 934a30d04a949c1010d947181f65cf65e5914b2f Mon Sep 17 00:00:00 2001 From: Erik Oosterop Date: Sun, 3 Mar 2024 04:40:37 +0000 Subject: [PATCH 3/4] date range --- src/mimosa/wip_missing_dates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mimosa/wip_missing_dates.py b/src/mimosa/wip_missing_dates.py index 1103b64..6f7128b 100644 --- a/src/mimosa/wip_missing_dates.py +++ b/src/mimosa/wip_missing_dates.py @@ -15,7 +15,7 @@ reporting_update = False for seq in dwd.tuples_of_missing_dates( - start_dt=date(2018, 1, 1), end_dt=date(2019, 1, 2) + start_dt=date(2018, 1, 1), end_dt=date(2024, 3, 2) ): pipeline.run_landing_pipeline( gas_date=seq[0], From 9bf4f4af5eed4a52172aa3c6300c9c5cb6bb979e Mon Sep 17 00:00:00 2001 From: Erik Oosterop Date: Tue, 5 Mar 2024 02:41:52 +0000 Subject: [PATCH 4/4] Sentry add release/version. --- CHANGELOG.md | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2af813..327ff98 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.4.6] 2024-03-03 ### Added - Release version for sentry.io diff --git a/pyproject.toml b/pyproject.toml index 1c41cc0..89a120d 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ disallow_incomplete_defs = true [tool.poetry] name = "ternyxmimosa" -version = "0.4.5" +version = "0.4.6" description = "A minimal modern data stack with working data pipelines in a single Docker container." authors = ["Erik Oosterop "] license = "MIT"