Azure / Azure-Functions

1.12k stars 199 forks source link

Application Insights, Multi-Role application map, correlation #519

Open henning-krause opened 7 years ago

henning-krause commented 7 years ago

I'm running an Azure Function which I call from a .NET Core application hosted on an Azure-Kubernetes cluster.

I've enabled the "Multi-role Application Map" preview and want to get the connections from the core application to the Azure functions to be drawn when there are corresponding calls.

Now I got this working by adding the OperationId and RequestId values from a DependencyTelemetry to the HTTP request and by creating a corresponding RequestTelemetry on the Azure Function where I set the Operation.Id and Operation.ParentId to the values of the request headers.

This works and looks good on the map.

However, The Azure Functions runtime itself creates another Request-Telemetry which appears on the map (I see it because my own RequestTelemetry use a different Cloud.RoleName).

Now, I'd rather use the RequestTelemetry created by the runtime instead of my own, but I don't know how to inject the OperationId and RequestId into that instance.

And since I have no access to the TelemetryConfiguration of the Runtime, I cannot create a TelemetryInitializer of my own.

Is there a way to achieve this?

TheeJamesLee commented 7 years ago

Hi,

I've never truly achieved this and brought this up in the past - you have no access to their telemetry client context. The workaround is to just not use their implementation until it can be wired correctly to achieve correlation (this is a bigger task than a couple of lines and I'm fairly sure it is somewhere on their backlog).

Azure/Azure-Functions#390 - closest discussion to what you are looking to achieve. (I would guessed commenting here so people in MSFT can see that others are looking for this fix) Azure/Azure-Functions#245 - further down this discussions widens around correlation as a whole.

ColbyTresness commented 5 years ago

@alexkarcher-msft