Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-76447

CPO is missing the UserAgent in the telemetry options when authenticating to Azure Cloud

    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • In Progress
    • Enhancement
    • Hide
      Cause: The Control Plane Operator (CPO) was not setting the TelemetryOptions.ApplicationID in the Azure SDK client options when creating Azure ARM SDK clients. This meant Azure API requests from the CPO did not include a proper application User-Agent identifier.
      Consequence: Azure API requests from the Control Plane Operator could not be properly attributed or traced in Azure telemetry and monitoring, making it difficult to identify and troubleshoot CPO-originated requests.
      Fix: Added a CPOUserAgent constant ("hypershift-cpo") and a NewARMClientOptions helper function that creates Azure ARM client options with proper cloud configuration and TelemetryOptions.ApplicationID. Updated all Azure SDK client creation points in the CPO, including virtual network, network security group, resource group, and Key Vault clients, to use the new telemetry-enabled options.
      Result: All Azure API requests from the Control Plane Operator now include the "hypershift-cpo" application identifier in the User-Agent header, enabling proper request attribution and tracing in Azure telemetry and monitoring.
      Show
      Cause: The Control Plane Operator (CPO) was not setting the TelemetryOptions.ApplicationID in the Azure SDK client options when creating Azure ARM SDK clients. This meant Azure API requests from the CPO did not include a proper application User-Agent identifier. Consequence: Azure API requests from the Control Plane Operator could not be properly attributed or traced in Azure telemetry and monitoring, making it difficult to identify and troubleshoot CPO-originated requests. Fix: Added a CPOUserAgent constant ("hypershift-cpo") and a NewARMClientOptions helper function that creates Azure ARM client options with proper cloud configuration and TelemetryOptions.ApplicationID. Updated all Azure SDK client creation points in the CPO, including virtual network, network security group, resource group, and Key Vault clients, to use the new telemetry-enabled options. Result: All Azure API requests from the Control Plane Operator now include the "hypershift-cpo" application identifier in the User-Agent header, enabling proper request attribution and tracing in Azure telemetry and monitoring.
    • None
    • None
    • None
    • None

      This is a clone of issue OCPBUGS-74498. The following is the description of the original issue:

      Description of problem

      The Control Plane Operator (CPO) is not setting the UserAgent in the Azure SDK telemetry options when creating Azure ARM SDK clients. This means Azure API requests from CPO do not include proper application identification for request tracing and telemetry purposes.

      When authenticating to Azure Cloud, the Azure SDK's TelemetryOptions.ApplicationID is not configured, resulting in requests that cannot be properly attributed to the Control Plane Operator.

      Version-Release number of selected component (if applicable)

      4.20, 4.21, 4.22

      How reproducible

      Always

      Steps to Reproduce

      1. Deploy an OpenShift hosted control plane cluster on Azure
      2. Trigger control plane operations that make Azure API calls
      3. Monitor Azure API requests from the control-plane-operator
      4. Observe the User-Agent header in requests to Azure ARM APIs

      Actual results

      Azure ARM SDK requests from CPO do not include a proper application User-Agent identifier. The requests are not easily attributable to the control-plane-operator in Azure telemetry/monitoring.

      Expected results

      Azure ARM SDK requests should include a User-Agent header identifying the Control Plane Operator for proper request tracing.

      Additional info

      The fix should add TelemetryOptions with ApplicationID to the Azure SDK client options:

      options := &arm.ClientOptions{
          ClientOptions: azcore.ClientOptions{
              Cloud: cloudConfig,
              Telemetry: policy.TelemetryOptions{
                  ApplicationID: "[cpo-useragent]",
              },
          },
      }
      

              hypershift-automation hypershift-team automation
              rh-ee-brcox Bryan Cox
              None
              None
              Yu Li Yu Li
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: