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

🔧(api) set request user in Sentry's context #323

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

jmaupetit
Copy link
Member

Purpose

We need to track how users are using the API and who's raising observed errors.

Proposal

  • add API request user's username to Sentry's context

@jmaupetit jmaupetit self-assigned this Jan 6, 2025
@jmaupetit jmaupetit added improvement needs review API Item related to the API service labels Jan 6, 2025
We need to track how users are using the API and who's raising observed
errors. Adding only the username to the context will help a lot.
@jmaupetit jmaupetit force-pushed the api-update-sentry-context branch from daeca4f to 04f9e66 Compare January 6, 2025 17:46
@MTES-MCT MTES-MCT deleted a comment from github-actions bot Jan 6, 2025
@jmaupetit jmaupetit requested a review from ssorin January 6, 2025 17:46
Copy link

github-actions bot commented Jan 6, 2025

Current benchmark

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s Failures/s 50% 66% 75% 80% 90% 95% 98% 99% 99.9% 99.99% 100% git timestamp version
GET /auth/whoami 20 0 480.0 780.9611611500031 3.2901079999874128 2511.2731279999707 160.0 0.6963427464030233 0.0 770 1100 1200 1400 2000 2500 2500 2500 2500 2500 2500 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
POST /dynamique/session/ 20 0 840.0 1002.1869105000007 30.95489899999393 2425.657836000028 45.0 0.6963427464030233 0.0 930 1200 1800 1800 2100 2400 2400 2400 2400 2400 2400 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
POST /dynamique/session/bulk 25 0 960.0 1037.9991865999996 22.849593999922035 2358.507824999947 411.0 0.870428433003779 0.0 960 1200 1800 2100 2200 2300 2400 2400 2400 2400 2400 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
GET /dynamique/status/ 21 0 920.0 1100.7406322857246 14.013502000011613 2736.6638999999395 285.0 0.7311598837231744 0.0 920 1200 1500 1800 2600 2600 2700 2700 2700 2700 2700 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
POST /dynamique/status/ 18 0 870.0 1024.634235833345 16.460666999932982 2307.078441000044 45.0 0.6267084717627209 0.0 920 1200 1800 1800 2100 2300 2300 2300 2300 2300 2300 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3 18 0 720.0 1003.1235761111044 18.60883599999852 3178.661355999907 283.0 0.6267084717627209 0.0 770 1100 1300 1500 2900 3200 3200 3200 3200 3200 3200 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
GET /dynamique/status/FRALLEGO002006P3/history 19 0 1100.0 1384.814327631566 134.5311599999377 3197.9346549999264 40840.78947368421 0.6615256090828721 0.0 1100 1700 2100 2300 3200 3200 3200 3200 3200 3200 3200 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
POST /dynamique/status/bulk 21 0 750.0 924.7232216190522 21.930631000032008 2895.942055999967 411.0 0.7311598837231744 0.0 750 820 1000 1200 2600 2600 2900 2900 2900 2900 2900 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
POST /statique/ 23 12 650.0 830.5841462173921 19.81415399995967 2560.632995999981 53.52173913043478 0.8007941583634768 0.4178056478418139 650 930 1100 1500 2100 2200 2600 2600 2600 2600 2600 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
GET /statique/?limit=10 21 0 1600.0 1332.7791660952275 33.478524999964066 3199.419233999947 13826.809523809525 0.7311598837231744 0.0 1600 1700 2000 2100 2300 2800 3200 3200 3200 3200 3200 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
GET /statique/?limit=100 22 0 1100.0 1392.0329610909182 135.90568400002212 3180.6384369999705 129006.68181818182 0.7659770210433255 0.0 1200 1500 1800 2300 2900 3000 3200 3200 3200 3200 3200 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
PUT /statique/FR073EP7QU5233 25 0 720.0 870.688463399997 37.4452350000638 2812.974509000014 1371.0 0.870428433003779 0.0 720 1100 1100 1500 2100 2100 2800 2800 2800 2800 2800 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
GET /statique/FRALLEGO002006P3 24 0 690.0 1213.9388897916726 15.203272000007928 3197.335659000032 1202.0 0.8356112956836279 0.0 1100 1800 2100 2300 2500 2900 3200 3200 3200 3200 3200 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
POST /statique/bulk 38 0 1400.0 1515.6266004999986 376.6443580000214 3197.07498199989 1125.2368421052631 1.323051218165744 0.0 1500 2100 2100 2400 2600 3200 3200 3200 3200 3200 3200 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0
Aggregated 315 12 930.0 1121.1773765841267 3.2901079999874128 3199.419233999947 12846.009523809524 10.967398255847616 0.4178056478418139 930 1300 1800 2100 2400 2700 3200 3200 3200 3200 3200 76edb44 2025-01-06 17:49:00.346382+00:00 0.16.0

Comparison with the latest previous benchmark

A lower (negative) value means the current version performs better than the previous one.

Type Name Request Count Failure Count Median Response Time Average Response Time Min Response Time Max Response Time Average Content Size Requests/s
GET /auth/whoami
POST /dynamique/session/
POST /dynamique/session/bulk
GET /dynamique/status/
POST /dynamique/status/
GET /dynamique/status/FRALLEGO002006P3
GET /dynamique/status/FRALLEGO002006P3/history
POST /dynamique/status/bulk
POST /statique/
GET /statique/?limit=10
GET /statique/?limit=100
PUT /statique/FR073EP7QU5233
GET /statique/FRALLEGO002006P3
POST /statique/bulk
Aggregated

@jmaupetit jmaupetit merged commit 6e5afa4 into main Jan 6, 2025
15 checks passed
@jmaupetit jmaupetit deleted the api-update-sentry-context branch January 6, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Item related to the API service improvement needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants