Skip to content

telemetry: classify Contoso, Crontoso Inc, and EmployeeHub as internal tenants - #252

Open
amilandi wants to merge 2 commits into
mainfrom
amilandin/adk-internal-tenants-add-contoso-crontoso
Open

telemetry: classify Contoso, Crontoso Inc, and EmployeeHub as internal tenants#252
amilandi wants to merge 2 commits into
mainfrom
amilandin/adk-internal-tenants-add-contoso-crontoso

Conversation

@amilandi

Copy link
Copy Markdown
Contributor

Two ESS-internal dogfood/demo tenancies were resolving as customer on the External dashboards, inflating apparent customer volume on the Capability Usage and FlightCheck charts.

The customer-attribution analysis from the last review pass (PR #242 follow-up) surfaced these tenant names via the /organization and /me?$select=companyName lookups:

tenant_name tenant_id 90-day events
Contoso ed667978-98e2-41a3-ad41-bafc8f728f02 423
Crontoso, Inc 99f9fd00-6145-4c3e-b3ba-d4c7e59470d8 790

Both are team-owned test tenants. Also promotes EmployeeHub (935884d7-bdee-469b-a461-fcc530a3ac83, the tenant called out in PR #242's attribution comment) from an env-var override to the hardcoded list so it doesn't rely on a runtime setting for its correct classification.

Changes

solutions/ess-maker-skills/scripts/flightcheck/telemetry.py

  • Introduces _HARDCODED_INTERNAL_TENANT_IDS (frozenset) as the source of well-known internal tenancy classification, seeded with Microsoft Corp + EmployeeHub + the two Contoso IDs above. Each ID is a named module constant (EMPLOYEEHUB_TENANT_ID, CONTOSO_INTERNAL_TENANT_ID, CRONTOSO_INTERNAL_TENANT_ID) so analytics tooling and follow-up scripts can enumerate the same set without string duplication.
  • _parse_internal_tenant_ids now unions the hardcoded set with the env-var extension (ESS_ADK_INTERNAL_TENANTS) rather than seeding from the single corp GUID. Env-var behavior is unchanged.
  • Comment block updated to reflect the split (hardcoded = well-known long-lived; env var = one-off / short-lived).

tests/test_adk_telemetry.py

  • New regression test_classify_tenant_hardcoded_internal_dogfood_tenants clears the _parse_internal_tenant_ids cache, unsets ESS_ADK_INTERNAL_TENANTS, and asserts each of the three new hardcoded IDs classifies as internal (plus case/whitespace insensitivity on CONTOSO_INTERNAL_TENANT_ID).
  • Existing tests (test_classify_tenant_microsoft_corp_is_internal, _env_allowlist_extends, _non_guid_maps_to_unknown) still pass unchanged — the corp tenant remains internal and the env-var extension mechanism is preserved.

Historical data

Events already emitted with tenantClass=customer before this change aren't reclassified. To exclude them from the External dashboards for the pre-fix window, I've added a supplementary tenantId not in (…) filter to the affected chart tiles on the Capability Usage and FlightCheck dashboards. That side-fix ships with this PR as a dashboard config update, not a code change.

Verification

$ python -m pytest tests/test_adk_telemetry.py -q -k classify_tenant
6 passed

Full tests/test_adk_telemetry.py also green; no touch to production emit code paths (the frozenset and helper signatures are unchanged for callers).

ADO: https://o365exchange.visualstudio.com/O365%20Core/_workitems/edit/7764297

amilandin_microsoft and others added 2 commits August 25, 2026 10:26
…l tenants

Analysis of the customer-attribution dashboard (post-PR #242) surfaced twointernal ESS dogfood/demo tenancies that were still resolving as customer:

- Contoso (tenant_id ed667978-98e2-41a3-ad41-bafc8f728f02)- Crontoso, Inc (tenant_id 99f9fd00-6145-4c3e-b3ba-d4c7e59470d8)

Both are team-owned test tenants -- their traffic was polluting the Externalcustomer bucket on the Capability Usage and FlightCheck dashboards andinflating apparent customer volume.

Adds both plus the previously known EmployeeHub dogfood tenant(935884d7-bdee-469b-a461-fcc530a3ac83, called out in PR #242's attributioncomment) to _HARDCODED_INTERNAL_TENANT_IDS in flightcheck/telemetry.py.The env-var extension mechanism (ESS_ADK_INTERNAL_TENANTS) is retained; thehardcoded list is now the well-known long-lived set.

Historical events already emitted with tenant_class=customer are unaffected;the Aria dashboards get a supplementary chart-level tenant_id exclusion tocover the pre-fix window.

Regression test: test_classify_tenant_hardcoded_internal_dogfood_tenantsclears the parse cache and asserts each of the three new hardcoded IDsclassifies as internal without the env var, and is case/whitespace insensitive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 70ddf006-7f8d-48e7-9afa-3fbae73b3864
Adds the Cocreate test tenancy (8d36aacf-bbb3-4388-ac14-8844210f377b,
devtestcocreate0630.onmicrosoft.com) to the hardcoded internal-tenant
frozenset. Aria external dashboards already have this GUID in their
per-tile tenant Id notIn filter (applied via REST alongside this commit).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 70ddf006-7f8d-48e7-9afa-3fbae73b3864
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.

1 participant