Skip to content

docs: clarify Application Insights ingestion, cold_start semantics, and KQL shapes#85

Merged
yeongseon merged 1 commit intomainfrom
docs/p2-app-insights-cold-start-kql-79
Apr 26, 2026
Merged

docs: clarify Application Insights ingestion, cold_start semantics, and KQL shapes#85
yeongseon merged 1 commit intomainfrom
docs/p2-app-insights-cold-start-kql-79

Conversation

@yeongseon
Copy link
Copy Markdown
Owner

Closes #79

Summary

P2 documentation accuracy fixes from the external review. Pure docs change — no source modifications.

1. Application Insights scope disclaimer (early in README)

Added a Scope disclaimer callout immediately after the What it does bullet list, before any KQL example. The previous "Application Insights-ready" framing was technically accurate but implicit — the disclaimer existed only midway through the README, after readers had already seen examples assuming customDimensions parsing.

The new disclaimer states plainly: this package writes structured JSON to Python logging / stdout. How those fields appear in Application Insights depends on the Azure Functions host, worker, logging configuration, and ingestion pipeline. The library does not own ingestion or schema mapping. Both customDimensions-parsed and raw-message shapes are valid in production.

2. cold_start semantics documented precisely

Added a callout in both README (Invocation Context section) and docs/usage.md (Cold Start Detection section):

cold_start=True means the first invocation observed by this Python worker process after module load. It is not a platform-level cold start metric and does not correspond to App Service plan / instance allocation cold starts reported by Azure Functions metrics.

This matches the actual implementation: _cold_start is a process-global flag flipped on the first inject_context() call after module import. It is informational for log correlation, not a substitute for Azure metrics.

3. KQL examples split into both ingestion shapes

The README Query in Application Insights section now has two clearly labeled subsections:

  • When JSON fields are parsed into customDimensions — the original queries.
  • When JSON remains in the message column — same queries rewritten with parse_json(message) and tostring(payload.<field>).

Both shapes occur in real Azure Functions deployments depending on the worker, host configuration, and Application Insights connection mode. Documenting only the parsed shape misled users whose payloads land as raw text.

Validation

  • make lint — clean (no source files touched, but README/docs changes verified through pre-commit hooks)
  • make test — 142 passed, 3 skipped, 97.05% coverage
  • No source changes; no behavior changes; no public API changes.

Acceptance checklist (from #79)

  • README "Application Insights-ready" disclaimer added near the top
  • cold_start semantics documented in README and docs/usage.md
  • KQL examples split into both ingestion shapes
  • No code changes; pure docs PR

…nd KQL shapes

Closes #79

- Add a scope disclaimer in the README 'What it does' section: this
  package writes structured JSON to Python logging / stdout; how those
  fields appear in Application Insights depends on the host, worker,
  logging configuration, and ingestion pipeline. The library does not
  own ingestion or schema mapping.
- Document precise cold_start semantics in both README and
  docs/usage.md: cold_start=True means the first invocation observed by
  this Python worker process after module load, not a platform-level
  cold start metric. It does not correspond to App Service plan /
  instance allocation cold starts.
- Split the README KQL examples into two ingestion shapes: one for the
  customDimensions-parsed shape and one for the raw-message shape using
  parse_json(message). Both are valid in real deployments.
@yeongseon yeongseon merged commit 270cb96 into main Apr 26, 2026
12 checks passed
@yeongseon yeongseon deleted the docs/p2-app-insights-cold-start-kql-79 branch April 26, 2026 10:23
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.

P2: documentation accuracy (Application Insights, cold start semantics, KQL examples)

1 participant