Skip to content

feat(telemetry): warn at startup when required env vars are missing#224

Closed
jeanscherf wants to merge 1 commit into
mainfrom
feat/telemetry-env-var-warnings
Closed

feat(telemetry): warn at startup when required env vars are missing#224
jeanscherf wants to merge 1 commit into
mainfrom
feat/telemetry-env-var-warnings

Conversation

@jeanscherf

Copy link
Copy Markdown
Member

Summary

  • _get_system_role(): emits logger.warning() when APPFND_CONHOS_SYSTEM_ROLE is unset, instead of silently defaulting to unknown
  • _get_ord_id(): emits logger.warning() when ORD_DOCUMENT_ID is unset, instead of silently omitting sap.ord.id from the OTel resource
  • Follows the existing logging.getLogger(__name__) convention used throughout the telemetry module

Test plan

  • Run with env vars unset — confirm both warnings appear in application logs at startup
  • Run with env vars set — confirm no warnings are emitted
  • Existing unit tests in tests/core/unit/telemetry/test_config.py pass unchanged

@jeanscherf jeanscherf force-pushed the feat/telemetry-env-var-warnings branch from ad1991d to 7f6b2ce Compare July 14, 2026 16:11
Emit logger.warning() when APPFND_CONHOS_SYSTEM_ROLE or ORD_DOCUMENT_ID
are unset so developers get immediate feedback at runtime rather than
silently producing malformed telemetry or incomplete metering data.
@jeanscherf jeanscherf force-pushed the feat/telemetry-env-var-warnings branch from 7f6b2ce to 7de5301 Compare July 14, 2026 16:16
value = os.getenv(ENV_SYSTEM_ROLE)
if not value:
logger.warning(
"APPFND_CONHOS_SYSTEM_ROLE is not set. "

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

APPFND_CONHOS_SYSTEM_ROLE still the name? I thought, we suposed to remove the "conhos" from naming.

Should we add something like: "review app.yaml env object" or something like it?

@jeanscherf

Copy link
Copy Markdown
Member Author

Closing — system role will be injected automatically from the blueprint onboarding file in CI. SDK-level warnings are not needed.

@jeanscherf jeanscherf closed this Jul 15, 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.

3 participants