pyronear / pyro-api

Alert Management API for wildfire prevention, detection & monitoring. Built with FastAPI & PostgreSQL
Apache License 2.0
21 stars 9 forks source link

feat: Adds product analytics on most of the routes #307

Closed frgfm closed 9 months ago

frgfm commented 1 year ago

This PR introduces the following modifications:

Any feedback is welcome!

cf. #304

blenzi commented 1 year ago

Thanks for this nice addition @frgfm ! I believe the errors in the CI come from from app.services import telemetry_client (not defined) vs from app.services.telemetry import telemetry_client.

I would suggest monitoring also the alert notifications, in order to remove that from the db, as you suggested in #304.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (cf11dc7) 94.95% compared to head (1759f71) 94.59%.

Files Patch % Lines
src/app/api/endpoints/media.py 72.22% 5 Missing :warning:
src/app/services/telemetry.py 73.68% 5 Missing :warning:
src/app/services/services.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #307 +/- ## ========================================== - Coverage 94.95% 94.59% -0.36% ========================================== Files 63 63 Lines 1505 1592 +87 ========================================== + Hits 1429 1506 +77 - Misses 76 86 +10 ``` | [Flag](https://app.codecov.io/gh/pyronear/pyro-api/pull/307/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyronear) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/pyronear/pyro-api/pull/307/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyronear) | `94.59% <91.91%> (-0.36%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pyronear#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

frgfm commented 9 months ago

So apart from "updated info" (feels like dumping the payload otherwise), I added everything that was immediately available (not requiring another DB operations)