Title: Allow setting custom context properties for applicationinsights.exceptions.enable() · Issue #103 · microsoft/ApplicationInsights-Python · GitHub
Open Graph Title: Allow setting custom context properties for applicationinsights.exceptions.enable() · Issue #103 · microsoft/ApplicationInsights-Python
X Title: Allow setting custom context properties for applicationinsights.exceptions.enable() · Issue #103 · microsoft/ApplicationInsights-Python
Description: Currently there doesn't seem to be an easy way to use applicationinsights.exceptions.enable() while also sending context properties for those unhandled exceptions. Looking at the code it seems that one has to do something like the follow...
Open Graph Description: Currently there doesn't seem to be an easy way to use applicationinsights.exceptions.enable() while also sending context properties for those unhandled exceptions. Looking at the code it seems that...
X Description: Currently there doesn't seem to be an easy way to use applicationinsights.exceptions.enable() while also sending context properties for those unhandled exceptions. Looking at the code it seems ...
Opengraph URL: https://github.com/microsoft/ApplicationInsights-Python/issues/103
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow setting custom context properties for applicationinsights.exceptions.enable()","articleBody":"Currently there doesn't seem to be an easy way to use `applicationinsights.exceptions.enable()` while also sending context properties for those unhandled exceptions. Looking at the code it seems that one has to do something like the following currently (not tested):\r\n\r\n```py\r\nfrom applicationinsights import channel, TelemetryClient\r\nfrom applicationinsights.exceptions import enable\r\n\r\nchannel = channel.TelemetryChannel()\r\nclient = TelemetryClient(\"my-key\", channel)\r\nclient.context.properties[\"foo\"] = \"bar\"\r\nenable(\"my-key\", telemetry_channel=channel) # must be kw arg\r\n```\r\n\r\nI think https://github.com/Microsoft/ApplicationInsights-Python/issues/56 would help for this case as well so that the user doesn't have to deal with TelemetryChannel objects.\r\n\r\nGiven bug https://github.com/Microsoft/ApplicationInsights-Python/pull/102 I think that the above code currently wouldn't work anyway since the `track_exception` call that happens in the background doesn't get `properties` which triggers the bug where the context properties are ignored as well.","author":{"url":"https://github.com/letmaik","@type":"Person","name":"letmaik"},"datePublished":"2018-06-26T14:33:41Z","url":"https://github.com/microsoft/ApplicationInsights-Python/issues/103"}
| 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:c406ea81-ef32-a7d2-c2b2-d7d81f62c4c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7F8:266CF3:12F6FF:195F36:6B04B173 |
| html-safe-nonce | f28477acca16c57f78965116e1980624d531cc7a262d140420ef662b01c9a09b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0Y4OjI2NkNGMzoxMkY2RkY6MTk1RjM2OjZCMDRCMTczIiwidmlzaXRvcl9pZCI6IjU1NDUxNjA5Mjk2NjQzNDg1MzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3ef1fa48a5afc50e19cdfc889a95c0dd2c6a23f7c882f5d063e07e4ec35d1a47 |
| hovercard-subject-tag | issue:335849377 |
| 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/103/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b44611e1bb86318648a33b649cab674ea273c26cee109faac004d2a41da2e503/microsoft/ApplicationInsights-Python/issues/103 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b44611e1bb86318648a33b649cab674ea273c26cee109faac004d2a41da2e503/microsoft/ApplicationInsights-Python/issues/103 |
| og:image:alt | Currently there doesn't seem to be an easy way to use applicationinsights.exceptions.enable() while also sending context properties for those unhandled exceptions. Looking at the code it seems that... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | letmaik |
| 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