Skip to content

refactor(docker): make telemetry env uniform across compose services - #21840

Open
devashish2203 wants to merge 7 commits into
pfp-8979-mae-auth-layerfrom
pfp-8980-telemetry-env-uniform
Open

devashish2203 wants to merge 7 commits into
pfp-8979-mae-auth-layerfrom
pfp-8980-telemetry-env-uniform

Conversation

@devashish2203

@devashish2203 devashish2203 commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #21839.

What

Makes the telemetry env (DATAHUB_SERVER_TYPE, DATAHUB_TELEMETRY_ENABLED, USAGE_AGGREGATION_ENABLED, USAGE_AGGREGATION_FLUSH_INTERVAL_SECONDS, USAGE_AGGREGATION_ALIGNMENT_PERIOD_SECONDS, USAGE_AGGREGATION_INCLUDE_AGENT_NAME) uniform across the Docker compose services.

Rule:

  • GMS, MCE and MAE: every service carries the keys. Quickstart services get the quickstart values (DATAHUB_SERVER_TYPE=quickstart), debug services the dev values (DATAHUB_SERVER_TYPE=dev).
  • system-update: debug services only, as env/docker/variants/debug/system-update.env already states. Quickstart system-update services keep none.

Changes:

  • env/docker/mae-consumer.env: adds the telemetry and usage-aggregation keys as ${KEY:-default} opt-ins, the same values as env/docker/mce-consumer.env.
  • env/docker/variants/debug/mae-consumer.env: deleted (it held only these keys), and its slot removed from the two debug MAE env_file lists.
  • MAE DATAHUB_SERVER_TYPE lives in environment: (quickstart in the base anchor, dev in the dev anchor, explicit on the two postgres quickstart services), as for GMS and MCE: a later env file's ${KEY:-default} resolves against the value an earlier file set, so a variant file cannot change this default.
  • system-update-debug-postgres-cdc uses the postgres debug env_file list, like the other debug system-update services.
  • The unused x-datahub-quickstart-telemetry-env anchor is removed.

Effect on rendered compose (container x key, old -> new)

Three containers change, six keys each; nothing else changes.

Container Scenario DATAHUB_SERVER_TYPE DATAHUB_TELEMETRY_ENABLED USAGE_AGGREGATION_ENABLED ..._FLUSH_INTERVAL_SECONDS ..._ALIGNMENT_PERIOD_SECONDS ..._INCLUDE_AGENT_NAME
datahub-mae-consumer-quickstart-consumers plain compose, profile quickstart-consumers absent -> quickstart absent -> true absent -> true absent -> 30 absent -> 3600 absent -> true
same Gradle quickstart, allImages; AI smoke leg (both providers) absent -> quickstart absent -> false absent -> true absent -> 30 absent -> 3600 absent -> true
same smoke-test/run-quickstart.sh absent -> quickstart absent -> false absent -> true absent -> 5 absent -> 3600 absent -> true
same shell overrides absent -> shell value (all six)
datahub-mae-consumer-quickstart-consumers-cdc plain compose, profile quickstart-consumers-cdc absent -> quickstart absent -> true absent -> true absent -> 30 absent -> 3600 absent -> true
same Gradle quickstartCDC absent -> quickstart absent -> false absent -> true absent -> 30 absent -> 3600 absent -> true
same shell overrides absent -> shell value (all six)
system-update-debug-postgres-cdc plain compose, profile debug-postgres-cdc absent -> dev absent -> true absent -> true absent -> 30 absent -> 3600 absent -> true
same Gradle quickstartPgCdcDebug absent -> dev absent -> false absent -> true absent -> 30 absent -> 3600 absent -> true
same shell overrides absent -> shell value (all six)

Runtime effect

  • Telemetry is never turned on. An absent DATAHUB_TELEMETRY_ENABLED means the application default (telemetry.enabledServer: true). Gradle, smoke and the AI leg now pass false to these containers; the docker/build.gradle value and the run-quickstart.sh value still win.
  • Inert in MAE: the MAE consumer excludes ScheduledAnalyticsFactory and does not scan the telemetry or usage-aggregation factory packages, so none of the six keys changes its behaviour.
  • Inert telemetry in system-update: it excludes ScheduledAnalyticsFactory (the daily report); it builds TrackingService, but nothing in datahub-upgrade calls it.
  • One real change: system-update-debug-postgres-cdc now creates the usage-aggregation beans (USAGE_AGGREGATION_ENABLED=true) and reports server type dev instead of the default prod, the same as every other debug system-update service. This is local Micrometer export only.
  • Precedence: MAE DATAHUB_SERVER_TYPE on debug services moves from an env file to environment:, so under plain compose an ad-hoc or job env file can no longer override it there (Gradle still can, through interpolation). GMS and MCE already behave this way; no env file sets it today.

The runtime effect was checked by reading the code (component scans and callers), not on a running stack.

CLI quickstart

./gradlew :docker:generateQuickstartComposeConfig leaves docker/quickstart/ unchanged: released-CLI users see no change.

Still inline in smoke-test/run-quickstart.sh

  • DATAHUB_TELEMETRY_ENABLED=false: the shell value reaches every service that names the key. A smoke:<config> label can pick a debug profile, where it reaches the debug system-update services. The smoke job folder could only match that by also giving every quickstart system-update service the key, which is a further value change. Only the comment is updated.
  • KAFKA_LISTENER_CONCURRENCY=3: the two postgres quickstart MAE services and two MCE services still do not name the key.
  • USAGE_AGGREGATION_FLUSH_INTERVAL_SECONDS export: GMS reads 30 from env/common/gms.env before the job layer, so the job layer's default cannot take effect.

Verification

  • Compose env snapshot (bare, shell, smoke, AI and Gradle scenarios) on the base and head branches: the diff is exactly the table above (78 entries). ZDU checked by hand: its job folder sets none of these keys, and its debug-consumers services show no change.
  • ./gradlew :docker:generateQuickstartComposeConfig: no change.
  • python3 smoke-test/check_env_parity.py: passes.
  • shellcheck smoke-test/run-quickstart.sh: no warnings (one pre-existing info note).

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly PR Title Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable): not applicable, compose env only
  • Docs related to the changes have been added/updated (if applicable): not applicable
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Breaking Changes: not a breaking change

🤖 Generated with Claude Code


Summary by cubic

Makes the telemetry and usage-aggregation environment variables uniform across the Docker compose GMS, MCE, and MAE services. Previously MAE consumers carried none of these keys and system-update-debug-postgres-cdc missed the debug telemetry, so they could report the wrong server type or skip usage exports. The affected containers now carry the same keys as GMS and MCE: quickstart values on quickstart services, dev values on debug services.

  • MAE consumers now read the six telemetry and usage keys from env/docker/mae-consumer.env; their DATAHUB_SERVER_TYPE moves to compose environment: because its quickstart/debug default differs.
  • The debug MAE variant file and the unused quickstart telemetry anchor are removed.
  • system-update-debug-postgres-cdc now uses the debug env list, so it enables usage aggregation and reports DATAHUB_SERVER_TYPE=dev.
  • Rendered compose changes cover three containers; the quickstart CLI output is unchanged.

Written for commit 0f6e475. Summary will update on new commits.

View guided diff Turn on auto-fix

Every GMS, MCE and MAE service now carries the telemetry and usage
aggregation keys (quickstart values on quickstart services, dev values on
debug services), and every debug system-update service reads the debug
variant layer. Three containers change:

- datahub-mae-consumer-quickstart-consumers and -consumers-cdc gain the
  quickstart values (now in env/docker/mae-consumer.env).
- system-update-debug-postgres-cdc gains the dev values from
  env/docker/variants/debug/system-update.env.

MAE's DATAHUB_SERVER_TYPE moves to environment:, as for GMS and MCE,
because its default differs between quickstart and debug. The unused
quickstart telemetry anchor and the MAE debug variant file are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devashish2203 devashish2203 added the env-change-intended The PR changes rendered Docker compose env on purpose; lets the env snapshot diff check pass label Dec 3, 2026
@cursor

cursor Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

PR Summary

Overview
Unifies telemetry and OSS usage-aggregation environment variables across Docker Compose so MAE consumers match GMS/MCE, and fixes one debug system-update service that missed debug env files.

Telemetry keys (DATAHUB_TELEMETRY_ENABLED, USAGE_AGGREGATION_*, etc.) move from the removed x-datahub-quickstart-telemetry-env anchor and deleted env/docker/variants/debug/mae-consumer.env into env/docker/mae-consumer.env. MAE DATAHUB_SERVER_TYPE is set in compose environment: (quickstart vs dev), like GMS/MCE, so variant env files cannot override it.

system-update-debug-postgres-cdc now uses the postgres debug env_file list so it gets the same debug telemetry as other debug system-update services. Postgres quickstart MAE profiles stop inlining the old telemetry anchor and instead rely on the shared mae env plus explicit DATAHUB_SERVER_TYPE: quickstart.

Rendered compose changes are limited to three containers (two postgres quickstart MAE services and that system-update debug CDC service); quickstart CLI output is unchanged. A comment in smoke-test/run-quickstart.sh is updated to reflect which services receive inline DATAHUB_TELEMETRY_ENABLED=false.

Reviewed by Cursor Bugbot for commit a01db8e. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Smart test selection

pytest smoke tests

Mode: active. Only the selection below runs for the pytest smoke tests on this PR (applied: smart).

  • Selection: smart: tests for the tagged features, plus always-run modules, this PR's changed tests, and the plumbing sample if the PR changes the pytest harness
  • Size: 102 of 853 tests in 1 batch, predicted longest batch ~2 min
  • Tags: change-type: pytest-plumbing, test-infra; feature-dev: billing-metrics; feature-user: analytics
  • Confidence: MEDIUM (4 changed files)
  • Classifier reasoning: The change moves telemetry and usage-aggregation env settings between docker compose files and a quickstart script, which touches usage aggregation (billing-metrics) and the usage events behind analytics, with no direct product code change.

Medium confidence: a wrong tag means tests are skipped, so check the tags above against what this PR touches.

Selected scopes (28 files or classes, 102 tests)
  • tests/e2e/analytics/test_analytics.py
  • tests/e2e/analytics/test_highlights.py
  • tests/e2e/audit_events/audit_events_test.py
  • tests/e2e/authorization/test_self_entity_auth.py
  • tests/e2e/cli/user_groups_cmd/test_user_cmd.py
  • tests/e2e/delete/delete_assertion_cascade_test.py
  • tests/e2e/delete/delete_test.py
  • tests/e2e/domains/domain_entities_batching_test.py
  • tests/e2e/entity_versioning/test_versioning_ingest.py
  • tests/e2e/frontend/test_static_asset_encodings.py
  • tests/e2e/glossary/glossary_children_count_test.py
  • tests/e2e/lineage/test_lineage_sdk.py
  • tests/e2e/mcp/mcp_test.py
  • tests/e2e/metrics/test_metrics.py
  • tests/e2e/metrics/test_queue_ingest_usage.py
  • tests/e2e/metrics/test_usage_aggregation_audit.py::TestUsageAggregationActiveIdentities
  • tests/e2e/metrics/test_usage_aggregation_audit.py::TestUsageAggregationAdminSessions
  • tests/e2e/metrics/test_usage_aggregation_audit.py::TestUsageAggregationByteMetrics
  • tests/e2e/metrics/test_usage_aggregation_audit.py::TestUsageAggregationGraphqlOutputDedup
  • tests/e2e/metrics/test_usage_aggregation_audit.py::TestUsageAggregationPatTraffic
  • tests/e2e/object_storage/test_object_storage.py
  • tests/e2e/openapi/v3/test_scroll_entities.py
  • tests/e2e/patch/test_domain_patches.py
  • tests/e2e/read_only/test_analytics.py
  • tests/e2e/read_only/test_services_up.py
  • tests/e2e/restli/test_restli_batch_ingestion.py
  • tests/e2e/schema_fields/test_schemafields.py
  • tests/e2e/search/test_search_projection.py::TestSearchProjection

Add the run-all-tests:pytest label to run the full pytest suite on this PR.

Playwright E2E tests

This run: smart

  • Selection: smart: specs tagged analytics, billing-metrics plus the tests the change affects
  • Size: 2 tests in 1 spec file, ~1 min predicted on 1 shard(s)
Specs selected because of this PR (1)
Spec Tests Why
analytics/analytics.spec.ts 2/2 tagged analytics

Add the run-all-tests:playwright label to run the full Playwright suite on this PR.

commit 0f6e475 · workflow run

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

# Conflicts:
#	docker/profiles/docker-compose.gms.yml
#	env/docker/mae-consumer.env

@david-leifker david-leifker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch was successfully deployed

1 active deployment
Preview — 0f6e4751 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

env-change-intended The PR changes rendered Docker compose env on purpose; lets the env snapshot diff check pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants