-
Notifications
You must be signed in to change notification settings - Fork 250
fix: Fixing CNI Telemtry Service run by CNS #3824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the CNI telemetry service initialization issue where it was failing to start due to an empty Application Insights instrumentation key. The fix ensures that the telemetry service uses the proper AI configuration from the CNS configuration instead of an empty basic configuration.
- Updates the
startTelemetryService
function to accept CNS configuration and properly initialize AI telemetry settings - Adds validation to check for Application Insights instrumentation key before starting the telemetry service
- Introduces proper telemetry configuration mapping from CNS settings to AI config
@@ -94,6 +94,7 @@ const ( | |||
// Service name. | |||
name = "azure-cns" | |||
pluginName = "azure-vnet" | |||
aiPluginName = "AzureCNI" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the PR title 'Telemtry' which should be 'Telemetry'. While this constant name is correct, ensure consistency in naming throughout the codebase.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Behzad Mirkhanzadeh <[email protected]>
if cnsconfig.TelemetrySettings.AppInsightsInstrumentationKey != "" { | ||
err = tb.CreateAITelemetryHandle(aiConfig, ts.DisableTrace, ts.DisableMetric, ts.DisableEvent) | ||
} else { | ||
logger.Printf("No Application Insights key provided for CNI telemetry service") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check other way and remove else?
if cnsconfig.TelemetrySettings.AppInsightsInstrumentationKey == "" {
logger.Printf("No Application Insights key provided for CNI telemetry service")
return
}
err = tb.CreateAITelemetryHandle(aiConfig, ts.DisableTrace, ts.DisableMetric, ts.DisableEvent)
Discussed in the team meeting today - we may want to consider doing telemetry for CNI directly in CNI rather than CNS, to account for scenarios where CNI can't talk to CNS. |
This PR fixes an issue where the CNI telemetry service was failing to start by CNS due to an empty Application Insights (AI) instrumentation key. The telemetry service was being initialized with a basic configuration that lacked the proper AI settings from the CNS configuration.
Requirements:
Notes: