Fredrik Johansson
Fredrik Johansson

Reputation: 35

Is there a way to inform Application Insights about route structure?

My .Net Framework Web API has a few endpoints, all structured in a similar way.

Endpoint1 - /User/{userId}/Resource1/{resourceId}/...
Endpoint2 - /User/{userId}/Resource2/{resourceId}/...

This pattern can be more sub-resources deep.

However, this turns out to be a bit problematic in the various tools in Application Insights. The errors blade show each operation by their individual URL. Not grouped by endpoint. I can easily see if /User/123/Resource1/abc/ is causing errors but it is difficult to tell if that particular endpoint is problematic. Makes sense?

Is there a way to inform Application Insights to be more smart in how it groups operations in the UI and the other tools?

Upvotes: 1

Views: 36

Answers (1)

ZakiMa
ZakiMa

Reputation: 6281

You can use telemetry initializer to modify OperationName. In your case you can replace actual identifiers with "{userId}" and "{resourceId}"

Upvotes: 0

Related Questions