Title: set user.id on each flask request · Issue #136 · microsoft/ApplicationInsights-Python · GitHub
Open Graph Title: set user.id on each flask request · Issue #136 · microsoft/ApplicationInsights-Python
X Title: set user.id on each flask request · Issue #136 · microsoft/ApplicationInsights-Python
Description: How can I set the context.user.id or context.user.authUserId for a Flask App ? I have wrapped the flask app with appinsights = AppInsights(app) and I see the requests in my App Insight. I have tried @app.before_request def before_request...
Open Graph Description: How can I set the context.user.id or context.user.authUserId for a Flask App ? I have wrapped the flask app with appinsights = AppInsights(app) and I see the requests in my App Insight. I have trie...
X Description: How can I set the context.user.id or context.user.authUserId for a Flask App ? I have wrapped the flask app with appinsights = AppInsights(app) and I see the requests in my App Insight. I have trie...
Opengraph URL: https://github.com/microsoft/ApplicationInsights-Python/issues/136
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"set user.id on each flask request","articleBody":"How can I set the context.user.id or context.user.authUserId for a Flask App ?\r\nI have wrapped the flask app with `appinsights = AppInsights(app)` and I see the requests in my App Insight.\r\nI have tried\r\n```python\r\n@app.before_request\r\ndef before_request():\r\n user_id = request.headers.get(\"X-Ms-Client-Principal-Name\") # header provided by AAD auth on Azure Web app\r\n appinsights._exception_telemetry_client.context.user.id = user_id\r\n appinsights._exception_telemetry_client.context.user.authUserId = user_id\r\n appinsights.flush()\r\n```\r\nbut without success. ","author":{"url":"https://github.com/sdementen","@type":"Person","name":"sdementen"},"datePublished":"2018-11-14T21:55:16Z","url":"https://github.com/microsoft/ApplicationInsights-Python/issues/136"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ef402869-5a4d-8324-c75c-432d7aff906d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8178:25853D:109799:15E63B:6B04B10A |
| html-safe-nonce | 10ea9b48c9fd10c43c6bc41827c7ea482dc0afe063591b356722b9f0cc567ab8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTc4OjI1ODUzRDoxMDk3OTk6MTVFNjNCOjZCMDRCMTBBIiwidmlzaXRvcl9pZCI6IjY1MjAzNDYxMzA1MzMxMDE4MzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 253495d8659f4ced7967c65e6281a0be88fb7cfb76a3db61adfb110c44d5bf78 |
| hovercard-subject-tag | issue:380903836 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/ApplicationInsights-Python/136/issue_layout |
| twitter:image | https://opengraph.githubassets.com/635a9adb98911ca5d3212d01532e81a519295539b2a32d61c2b94a1ac65c82c1/microsoft/ApplicationInsights-Python/issues/136 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/635a9adb98911ca5d3212d01532e81a519295539b2a32d61c2b94a1ac65c82c1/microsoft/ApplicationInsights-Python/issues/136 |
| og:image:alt | How can I set the context.user.id or context.user.authUserId for a Flask App ? I have wrapped the flask app with appinsights = AppInsights(app) and I see the requests in my App Insight. I have trie... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sdementen |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/ApplicationInsights-Python git https://github.com/microsoft/ApplicationInsights-Python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 26877260 |
| octolytics-dimension-repository_nwo | microsoft/ApplicationInsights-Python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 26877260 |
| octolytics-dimension-repository_network_root_nwo | microsoft/ApplicationInsights-Python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width