From 7d93cd2827f3cd2562550d350161f909756c6392 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 25 Oct 2019 13:36:46 +0200 Subject: [PATCH] Use sentry releases --- royalnet/bots/generic.py | 11 +++++++++-- royalnet/version.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/royalnet/bots/generic.py b/royalnet/bots/generic.py index ca05a54f..d0b4473f 100644 --- a/royalnet/bots/generic.py +++ b/royalnet/bots/generic.py @@ -3,6 +3,7 @@ import asyncio import logging import sentry_sdk import keyring +import royalnet.version import royalherald as rh from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration from sentry_sdk.integrations.aiohttp import AioHttpIntegration @@ -151,11 +152,17 @@ class GenericBot: def _init_sentry(self): if self.uninitialized_sentry_dsn: - log.info("Sentry: enabled") + # noinspection PyUnreachableCode + if __debug__: + release = "DEV" + else: + release = royalnet.version.semantic + log.info(f"Sentry: enabled (Royalnet {release})") self.sentry = sentry_sdk.init(self.uninitialized_sentry_dsn, integrations=[AioHttpIntegration(), SqlalchemyIntegration(), - LoggingIntegration(event_level=None)]) + LoggingIntegration(event_level=None)], + release=release) else: log.info("Sentry: disabled") diff --git a/royalnet/version.py b/royalnet/version.py index a06e538b..a2da1d52 100644 --- a/royalnet/version.py +++ b/royalnet/version.py @@ -1,4 +1,4 @@ -semantic = "5.0a71" +semantic = "5.0a72" if __name__ == "__main__": print(semantic)