Open vasalis opened 3 years ago
Thanks for reporting this. Will take a look at this.
In order to solve the issue I ended up using Application Insights for React https://docs.microsoft.com/en-us/azure/azure-monitor/app/javascript-react-plugin It was very easy to do and at the same time it provides much more options for integration with App Insights (for example tracking custom events, metrics etc). Maybe this could be the approach for the next version. Just a thought :)
@vasalis - very good idea. I personally use the React plugin for many projects, based on yo teams.
Describe the bug Enabling application insights does not track fetch requests, even by enabling them on App Insights configuration.
To Reproduce Steps to reproduce the behavior:
Create a new Teams app with Application Insights enabled. For example a Tab using personal scope.
Change JavaScript snippet to enable tracking of fetch requests, like this:
{ instrumentationKey: "{{APPINSIGHTS_INSTRUMENTATIONKEY}}", disableFetchTracking: false, enableCorsCorrelation: true, distributedTracingMode: 2, });
Create a fetch request, for example:
useEffect(() => { fetch("https://backend", { method: "GET", headers: { Accept: "application/json", "Content-Type": "application/json" } }) .then(response => response.json()) }, []);
The request is not tracked on Application insights.
Expected behavior The request should be logged on Application Insights as a dependency.
Detailed information
3.0.3
)yoteams-build-core
): [eg: 1.0.0]Additional information Also, when enabling Application Insights on the generator, I would expect to enable tracking of fetch requests and distributed tracing by default. Moreover, upgrading to the latest version of Application Insights did not solve the issue.