Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry integration and logging improvements #38

Merged
merged 3 commits into from
Nov 25, 2022
Merged

Sentry integration and logging improvements #38

merged 3 commits into from
Nov 25, 2022

Conversation

abulte
Copy link
Contributor

@abulte abulte commented Nov 24, 2022

  • All modules (cli, crawler, app) now use the same logging system
  • Colored logs!
  • Sentry integration, with a bit of rationalisation of error logging not to clutter the issues stream too much
  • A small CLI command to check an URL, because obviously I've found and fixed a crawler crash while testing Sentry

Capture d’écran 2022-11-24 à 15 51 15

Capture d’écran 2022-11-24 à 16 19 24

Fix #28

Copy link
Contributor

@maudetes maudetes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👌

Seeing your issues on Sentry, you should run poetry run udata-hydra init-db --drop if you haven't already.
Tables have been modified since #32

@@ -21,6 +21,9 @@ python-dotenv = "^0.19.2"
python-magic = "^0.4.25 "
redis = "^4.1.4"
requests = "^2.27.1"
sentry-sdk = "^1.11.1"
aiocontextvars = "^0.2.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this for Sentry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

async def check_url(url, method="get"):
"""Quickly check an URL"""
log.info(f"Checking url {url}")
async with aiohttp.ClientSession(timeout=None) as session:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't we want to use the check_url core function? (We would need to factorize it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry, I've another helper coming for that ;-)

@abulte abulte merged commit 9f19435 into main Nov 25, 2022
@abulte abulte deleted the sentry branch November 25, 2022 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ajouter l'intégration Sentry
2 participants