Skip to content

Add Mobile Onboarding Telemetry data model, AttributeName, and feature flag (common4j), Fixes AB#3549086#3039

Draft
Copilot wants to merge 2 commits into
devfrom
copilot/add-onboarding-telemetry-model
Draft

Add Mobile Onboarding Telemetry data model, AttributeName, and feature flag (common4j), Fixes AB#3549086#3039
Copilot wants to merge 2 commits into
devfrom
copilot/add-onboarding-telemetry-model

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

Foundational PBI for the Mobile Onboarding Telemetry feature — creates the data model, OTel span attribute, and feature flag that all other PBIs in this feature depend on.

New classes (common4j/.../telemetry/)

  • OnboardingTelemetryData — Gson-serializable data class modeling the "onboarding" sub-schema within the MATS blob. All fields use @SerializedName snake_case keys. Schema version defaults to "1.0.0" via @Builder.Default.
  • OnboardingStep — Lightweight step record (step_id, duration_ms).
  • OnboardingStepId — 28-value enum of discrete auth-journey milestones (e.g. DeviceRegistrationStarted, TokenIssued, ComplianceRemediationCompleted).

All three use Lombok @Builder + @Getter + @Accessors(prefix = "m").

OnboardingTelemetryData data = OnboardingTelemetryData.builder()
        .correlationId(correlationId)
        .sessionCorrelationId(sessionCorrelationId)   // nullable
        .authOutcome("succeeded")
        .onboardingMode("brokered")
        .msalBrokerAppUsed(true)
        .stepsList(steps)
        .build();
// Serializes to: { "onboarding_schema_version": "1.0.0", "correlation_id": "...", ... }

Enum additions

  • AttributeName.session_correlation_id — OTel span attribute for the session-scoped correlation ID. ⚠️ Must be mirrored in the Broker repo's AttributeName.java.

Feature flag

  • CommonFlight.ENABLE_ONBOARDING_TELEMETRY("EnableOnboardingTelemetry", false).

Tests

OnboardingTelemetryDataTest covers JSON key correctness via @SerializedName, full serialization/deserialization roundtrip, @Builder.Default schema version, nullable field defaults, and OnboardingStepId completeness.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Xmx3072m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • identitydivision.pkgs.visualstudio.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Xmx3072m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Objective

Create the foundational data model, OpenTelemetry span attribute, and feature flag for the Mobile Onboarding Telemetry feature in common4j.

Target Repository

  • Repo: AzureAD/microsoft-authentication-library-common-for-android
  • Base Branch: dev
  • Module: common4j

Context

The Mobile Onboarding Telemetry feature tracks interactive token request onboarding journeys across brokered and non-brokered Android auth flows. The onboarding telemetry is a nested sub-schema ("onboarding" key) within the existing MATS blob. This PBI creates the data classes that model the sub-schema, adds the session_correlation_id span attribute, and defines the feature flag. All other PBIs in this feature depend on this one.

Feature Flag

Add ENABLE_ONBOARDING_TELEMETRY("EnableOnboardingTelemetry", false) to CommonFlight.java.

Technical Requirements

  1. Create OnboardingTelemetryData.java in common4j/src/main/com/microsoft/identity/common/java/telemetry/ with fields:

    • onboardingSchemaVersion (String, default "1.0.0")
    • correlationId (String)
    • sessionCorrelationId (String, nullable)
    • actionStartTime, actionEndTime (Long)
    • authOutcome (String enum: succeeded, failed, canceled, incomplete)
    • errorCode (String, nullable)
    • clientAppId, appName, appVer, resource, scope (String)
    • msalBrokerAppUsed (Boolean)
    • msalVersion, brokerVersion, sdkVersion (String)
    • onboardingMode (String enum: brokered, non-brokered)
    • uxFlowUsed (List of String)
    • remediationNeeded (Boolean)
    • blockingErrors (List of String)
    • stepsList (List of OnboardingStep)
    • stepCount (Integer)
    • lastBlockingError, lastLoadedDomain, lastCompletedStep (String, nullable)
    • mdmEnrollmentStartTs, mdmEnrollmentResumeTs (Long, nullable)
    • complianceRemediationStartTs, complianceRemediationResumeTs (Long, nullable)
    • profile (String enum: personal, work)
    • wpCreationTs (Long, nullable, epoch ms)
    • Use @SerializedName annotations matching JSON keys (e.g., "onboarding_schema_version", "session_correlation_id")
    • Use Gson serialization, provide builder pattern (Lombok @builder if available, or manual)
  2. Create OnboardingStep.java in same package:

    • Fields: stepId (String), durationMs (long)
    • With @SerializedName annotations
  3. Create OnboardingStepId.java enum in same package with values:
    AccountSelectionStarted, AuthenticationStarted, CredentialEntryCompleted, PasskeyAuthStarted, CertBasedAuthStarted, StrongAuthSetupStarted, StrongAuthSetupCompleted, AuthenticatorMfaLinkingStarted, CABlockReceived, InterruptFlowStarted, ConsentPromptShown, TermsOfUseShown, PasswordResetRequired, BrokerInstallPrompted, DeviceRegistrationStarted, DeviceRegistrationCompleted, DeviceRegistrationUpgradeStarted, MDMEnrollmentStarted, CompanyPortalLaunched, WebCpEnrollmentStarted, GoogleEnrollmentStarted, IntuneAppProtectionRequired, ComplianceRemediationStarted, ComplianceRemediationCompleted, PrtAcquired, TokenIssued, UserCanceled, AuthorizationTimedOut

  4. Add session_correlation_id to AttributeName.java enum in common4j/src/main/com/microsoft/identity/common/java/opentelemetry/AttributeName.java

  5. Add feature flag ENABLE_ONBOARDING_TELEMETRY("EnableOnboardingTelemetry", false) to CommonFlight.java in common4j/src/main/com/microsoft/identity/common/java/flighting/CommonFlight.java

Acceptance Criteria

  • OnboardingTelemetryData serializes to JSON with correct @SerializedName keys
  • OnboardingStep and OnboardingStepId are defined and usable
  • AttributeName.session_correlation_id compiles
  • CommonFlight.ENABLE_ONBOARDING_TELEMETRY defined with default false
  • Unit tests for serialization/deserialization roundtrip
  • No new lint warnings
  • Compile check passes: ./gradlew :common4j:compileDebugKotlin

Follow .github/copilot-instructions.md strictly.
Fixes AB#3549086


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@github-actions
Copy link
Copy Markdown

✅ Work item link check complete. Description contains link AB#3549086 to an Azure Boards work item.

@github-actions github-actions Bot changed the title [WIP] Add foundational data model for Mobile Onboarding Telemetry [WIP] Add foundational data model for Mobile Onboarding Telemetry, Fixes AB#3549086 Mar 19, 2026
…e flag

Co-authored-by: wzhipan <40340482+wzhipan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add foundational data model for Mobile Onboarding Telemetry, Fixes AB#3549086 Add Mobile Onboarding Telemetry data model, AttributeName, and feature flag (common4j) Mar 20, 2026
Copilot AI requested a review from wzhipan March 20, 2026 00:06
@github-actions github-actions Bot changed the title Add Mobile Onboarding Telemetry data model, AttributeName, and feature flag (common4j) Add Mobile Onboarding Telemetry data model, AttributeName, and feature flag (common4j), Fixes AB#3549086 Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants