microsoft / azure-gradle-plugins

Azure Plugins for Gradle
MIT License
45 stars 28 forks source link

Issue #166: Use the AzureTelemetryClient's default constructor #172

Closed enaess closed 1 year ago

enaess commented 1 year ago

Re-organizing the code here, this will stop the AzureTelemetryClient from sending the message for QuickPulseService and others. This is because of implicit initialization of classes (even when not intended to be used) pulls in yet other dependencies.

The following network requests are no longer being issued.

enaess commented 1 year ago

@Flanker32 Here is yet another pull request for you, for same issue

Flanker32 commented 1 year ago

@enaess Thank you for your efforts. However, our current behavior is that even if you disable telemetry, our tooling will still send one last telemetry to indicate that one machine has turned off telemetry, and then it will stop collecting any more information. I will talk to our product manager about this and update you as soon as possible.

Meanwhile, could you please share the issue that you encountered with this extra network request? This way, we can try to find a solution to fix your issue quickly.

enaess commented 1 year ago

Yeah, this PR completely disables any communication with Microsoft Telemetry services. My expectation was that if I disabled telemetry, then nothing gets transmitted, even a "telemetry disabled" message.

From a network perspective, I see 4 messages being transmitted: 2 name lookups for Microsoft, and two different services being accessed. I have no idea to why and what data being transmitted.

I can certainly work around this by sandboxing the build disabling Internet access entirely from the docker containers running the build.

The other concern I have with this is that even in the case of the "telemetry disabled" message, it causes a large amount of classes and libraries to be loaded when there is absolutely no reason to do so (performance).

Flanker32 commented 1 year ago

Yeah, this PR completely disables any communication with Microsoft Telemetry services. My expectation was that if I disabled telemetry, then nothing gets transmitted, even a "telemetry disabled" message.

From a network perspective, I see 4 messages being transmitted: 2 name lookups for Microsoft, and two different services being accessed. I have no idea to why and what data being transmitted.

I can certainly work around this by sandboxing the build disabling Internet access entirely from the docker containers running the build.

The other concern I have with this is that even in the case of the "telemetry disabled" message, it causes a large amount of classes and libraries to be loaded when there is absolutely no reason to do so (performance).

Got it, thanks a lot for your message! Currently java azure tooling leverage Application Insights client for telemetry, I'll check whether there are some configurations to disable the extra requests.

Flanker32 commented 1 year ago

@enaess Thanks again for your support. After discussion with our PM, we will disable all telemetries when allowTelemetry is set to false, related changes has been submitted in PR https://github.com/microsoft/azure-gradle-plugins/pull/173

enaess commented 1 year ago

Awesome!!!