-
Notifications
You must be signed in to change notification settings - Fork 235
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
Add support for mapping minified Javascript to source #178
Comments
Having this line in the AppInsightsModule.js
is also causing unnecessary errors as the map file isn't in the directory |
Hi, |
Are there any news on this? This is really necessary because otherwise the search for exceptions would be really painful. |
any news on this? |
Source map is finally supported. Enjoy and please let me know if you're experiencing any issues. |
@KamilSzostak is there UI feature to upload the |
@KamilSzostak Could you please shed a little light on what exactly is supported now? |
Anyone figure this out? Happy to hear AppInsights supports source maps now but where are the docs? |
I'll take a closer look at this issue in next milestone. |
Being able to see original source filenames and line numbers in the exception stack trace is extremely important. If this is supported then can just have one example of how to enable it @KamilSzostak? |
The single most important feature to any javascript developer. What is the due date for 1.0.16? |
Is there anything I can do to help this along? This makes appInsights unusable for us (from a front end perspective), but we'd like to keep everything in one place. |
Any update on this issue? About @KamilSzostak announcement: Source map is finally supported. Enjoy and please let me know if you're experiencing any issues. Is there any blog post, or official documentation that we can take as reference? Or was something announced but not working / released? If that's the case is in scope for 1.0.16? When could be the approx release date for this minor release? |
@tommck I presume you're referring to my comment. I disagree with your statement in that obfuscation is another barrier to penetration. The company I work at has a value proposition that is security-related. Every step we can take to make it harder to penetrate our security is a step we will take. Minification and obfuscation is not an impenetrable security mechanism and I don't think anyone is arguing that. But we also would prefer not to willy nilly have our source code available on the internet in such an easy fashion. Github offers private repos precisely to keep source code hidden. There's nothing wrong with wanting your code to be obfuscated and stay that way. I'd like to add that "there should be no way for people to penetrate your system even if they have the entire source code" - that's a wonderful premise but it doesn't really apply to agile teams that push out a lot of software that also don't have security experts to catch everything. Most, if not all apps, are penetrable. |
Github offers private repos because not all apps are downloaded to people's web browsers. If your app is securing something worth taking, obfuscating the code won't stop people. |
I feel like you're hyper-focusing on one small aspect of what I said that 1) I don't actually think is that important and 2) you're making assumptions about what we tell clients, none of which is accurate. Anyways. I don't really care to hyjack this thread over an unimportant discussion - I would still like to know when this feature (the Azure automated pickup of the source maps) will become available because I think a bunch of us want it. |
The Sentry SDK automatically uploads the sourcemaps to wherever it's needed, and we don't have to configure anything for it to do so. In AppIns' case, would we have to manually upload to blob storage our source maps after each release? and if so, would the association between different releases <-> sourcemaps be manual or automatic? Sorry, if i'm asking too many questions, i'm just trying to clear in my head how will this work compared to what we already use. |
@markwolff I think our team will still use the drag & drop feature especially in the transfer phase from manual to automatic. Just a general question about the source maps and how they work now. Thanks in advance if somebody can help me out! |
In order to make it backwards compatible with all versions of the Javascript SDK, we will search for sourcemaps based on the filename in the call stack. It is assumed the file is named in a standard way, e.g a stack frame at To answer your question, each time you build your app, it will generate a new source map. This new source map won't work on previous builds, even if the code has not changed at all. I think you could force this source map to work on other builds (by keeping its file naming constant), but you would have to ignore all of the filename info. The App Insights feature isn't built for this currently! |
Just adding an announcement to this thread -- automatic source map support should be rolled out completely and available for everyone to use. As previously discussed in this thread, you can link your AI resource with a storage account which contains your application's source maps. Each time you view an exception you can click "unminify" and it will try and fetch the corresponding source maps from your blob storage (regardless of folder structure!). Please try it out and let me know if this doesn't cover your particular application's scenario. Either open a new issue or reply back in this one with more details if isn't working for you. I am closing this issue since I believe this feature is now finally available. Docs: https://go.microsoft.com/fwlink/?linkid=2118047 |
@markwolff I've followed every step in the Docs. I've got my Deployment Pipeline in Azure Dev Ops configured to copy my source map files to Azure Storage |
Hey @RobARichardson can you post what the errors look like in your browser's F12 menu (and also the callstack itself if that is okay)? |
@markwolff Wasn't sure if you were asking for the minified or unminified version so I did both. Let me know if I can provide anything else. Very eager to get this working. |
Oops sorry I meant the call stack and F12 when you try to unminify from the Portal |
Ahh, that makes more sense. So, when I try to unminify from the Azure Portal, I'm seeing no errors in the Dev Tools Console at all. |
@markwolff I see the same error as @RobARichardson
|
@markwolff thank you, that's a wonderful feature. I'd like to point out a couple of scenarios though, where I think it
|
Since, the issue is closed, maybe log a new issue for that with a reference to this one? |
@jawn thank you, I opened 2 separate issues (the second could be considered maybe a feature request, but I think it is also a bug). Feel free to remove my previous comment. |
The way this feature is implemented it is not scaling beyond a single app per application insights instance, so it is not very useful. I dont think this implementation is working at all. Can you remove the need to flatten the folder structure and potentially support more than one app? |
@bjuraga There is no need to flatten folder structure. It will search for map files matching your folder structure, and so if you are able to tweak your folder names it should pick out the correct map file. |
Thanks @markwolff i will give the folder structure a bit more testing. |
@bjuraga Multiple apps should be supported through folder name differences. If your js files are consumed something like Another potential solution is to name your files with some unique hash each time you build, |
sure if the folder structure pans out and i host all my apps in a single app service as you stated with https://example.com/ then its just an extension of the folder structure example. |
Yes the example you posted above wouldn't work |
Thank you for clarifying @markwolff Is there a plan to support this? Or should i file a suggestion/bug/defect? |
There are currently no plans to support this. You can submit a feature request on our user voice page |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
From https://visualstudio.uservoice.com/forums/357324/suggestions/12292965
Currently Application Insights does not resolve minified Javascript to it's matching original source. This makes solving production issues impossible - and who doesn't minify? Please add support for map files (or some other method) for making this possible.
The text was updated successfully, but these errors were encountered: