Skip to content

Commit de3a207

Browse files
authored
Fixes ApplicationInsights exception handling (#9)
* Make logging sample clearer * Add exception correlation in Application Insights Minor adjustments to documentation, including PowerShell runner
1 parent c8554fa commit de3a207

28 files changed

+266
-81
lines changed

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,28 +97,51 @@ To quickly see the application running using pre-built docker images and docker-
9797

9898
### Using OpenTelemetry
9999

100+
1. Clone this repository
100101
1. Open terminal under `ready-to-run\sample`
101102
1. Execute `docker-compose up`
102-
1. Generate load with `watch -n 2 curl --request GET http://localhost:5001/api/enqueue/WebSiteA`
103-
1. View traces in [Jaeger](http://localhost:16686/)
104-
1. View metrics by searching for "Enqueued_Item" in [Prometheus](http://localhost:9090)
105-
1. Build dashboards in [Grafana](http://localhost:3000/) (admin/password1)
103+
1. Generate load in terminal with
104+
105+
```bash
106+
watch -n 2 curl --request GET http://localhost:5001/api/enqueue/WebSiteA
107+
```
108+
109+
for PowerShell use this script:
110+
111+
```Powershell
112+
while (1) {Invoke-WebRequest -Uri http://localhost:5001/api/enqueue/WebSiteA; sleep 2}
113+
```
114+
115+
4. View traces in [Jaeger](http://localhost:16686/)
116+
5. View metrics by searching for "Enqueued_Item" in [Prometheus](http://localhost:9090)
117+
6. Build dashboards in [Grafana](http://localhost:3000/) (admin/password1)
106118

107119
### Using Application Insights SDK
108120

121+
1. Clone this repository
109122
1. Open terminal under `ready-to-run\sample`
110-
2. Add .env file with following content:
123+
1. Create file `ready-to-run\sample\.env` with following content:
111124

112125
```env
113126
USE_APPLICATIONINSIGHTS=true
114127
USE_OPENTELEMETRY=false
115128
AI_INSTRUMENTATIONKEY=<ENTER-APPLICATION-INSIGHTS-INSTRUMENTATION-KEY>
116129
```
117130

118-
3. Execute `docker-compose up`
119-
4. Generate load with `watch -n 2 curl --request GET http://localhost:5001/api/enqueue/WebSiteA`
120-
5. View logs, traces and metrics in Azure Portal Application Insights
131+
4. Execute `docker-compose up`
132+
5. Generate load in terminal with
121133

134+
```bash
135+
watch -n 2 curl --request GET http://localhost:5001/api/enqueue/WebSiteA
136+
```
137+
138+
for PowerShell use this script:
139+
140+
```Powershell
141+
while (1) {Invoke-WebRequest -Uri http://localhost:5001/api/enqueue/WebSiteA; sleep 2}
142+
```
143+
144+
5. View logs, traces and metrics in Azure Portal Application Insights
122145

123146
## Conclusion
124147

media/003-ai-e2e-traces-and-logs.jpg

214 KB
Loading

media/003-ai-e2e-traces.jpg

120 KB
Loading

media/03-ai-custom-tracing.png

32.4 KB
Loading

media/04-ai-span-error-search.png

85.5 KB
Loading

media/04-ai-trace-and-logs.png

214 KB
Loading

media/04-ot-span-error-search.png

92.1 KB
Loading

media/04-ot-span-error.png

77.2 KB
Loading
85.8 KB
Loading

media/05-ai-e2e-with-exception.png

52.8 KB
Loading

0 commit comments

Comments
 (0)