Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.93k stars 441 forks source link

[Question] Application Insights internal telemetry client settings and NodeJS runtime #5879

Open gunzip opened 4 years ago

gunzip commented 4 years ago

Azure functions v2 NodeJS runtime

Question

Hi @brettsam, I read here that with C# runtime you can get the internal AI client.

I've read the docs abot the NodeJS runtime, but I cannot find an answer to some questions related to AI client instantiation:

1) applicationInsights.defaultClient is a singleton across all functions that belong to the same functionapp service ? 2) if it is a singleton, when I call setup() in one functions, I'm overriding the configuration of all clients for every other function ? 3) how does applicationInsights.defaultClient relate to the internal ai client used by the function runtime ? when I call setup() on this client, does it affect the internal client as well ? 4) if not, is there a way to get / configure the internal AI client in JS functions ?

I'm mostly asking because we're experiencing SNAT port exhaustion and we want to try passing a custom http agent to the AI client (but there are other use cases as well).

Thank you in advance for any answer !

(I've answered 1 & 2 myself and it looks like the answer is yes to both)

simenstoa commented 4 years ago

Hi, we are experiencing SNAT port exhaustion as well when using the TelemetryClient in Azure functions v2 Java runtime. And are wondering about the exact same things as described in the question above for the Java runtime.

mhoeger commented 4 years ago

The AI client used by the runtime is a C# client, so a different instance altogether.

if not, is there a way to get / configure the internal AI client in JS functions ?

I don't believe so but @brettsam would know best!

For issues around SNAT port exhaustion, our general guidance is outlined here, but it seems like @gunzip may have still been running into issues despite using a singleton? Wondering if you found a resolution? (Again sorry about the delay in response!)