Skip to content

Conditional azure monitor and readme updates - #33

Merged
Hector Hernandez (hectorhdzg) merged 6 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/conditional-azure-monitor-and-readme
Apr 22, 2026
Merged

Hector Hernandez (hectorhdzg) merged 6 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/conditional-azure-monitor-and-readme

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member

No description provided.

@hectorhdzg

Copy link
Copy Markdown
Member Author

Copilot resolve the merge conflicts in this pull request

Copilot AI 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.

Pull request overview

This PR makes Azure Monitor initialization conditional (so the distro can run as “OTLP-only”), refactors instrumentation/sampler/view construction into standalone helpers, and updates the README/options docs to reflect the intended usage patterns.

Changes:

  • Add src/distro/instrumentations.ts to create instrumentations, sampler, and metric views independently of Azure Monitor handlers.
  • Update useMicrosoftOpenTelemetry() to only initialize Azure Monitor components/handlers/readers when options.azureMonitor is provided.
  • Refresh README and option default documentation (badges, usage examples, and option tables).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/types.ts Updates option docstrings to match current defaults.
src/distro/instrumentations.ts New helper module to build instrumentations, sampler, and views.
src/distro/distro.ts Conditional Azure Monitor initialization + wiring to new helpers.
README.md Adds badges and expands usage/config documentation (A365, Azure Monitor, OTLP-only).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/distro/instrumentations.ts Outdated
Comment thread README.md Outdated
Comment thread src/distro/distro.ts
Comment thread src/distro/distro.ts Outdated
Comment thread src/distro/distro.ts Outdated
Comment thread src/distro/distro.ts Outdated
Comment thread src/distro/distro.ts
Distro changes:

- Azure Monitor handlers (MetricHandler, TraceHandler, LogHandler) are now only created when options.azureMonitor is provided, avoiding unnecessary exporters and processors in the pipeline for OTLP-only or A365-only users.

- Extracted instrumentation, sampler, and metric view creation into src/distro/instrumentations.ts so they are always available regardless of which backends are enabled.

- Global OTel providers (TracerProvider, MeterProvider, LoggerProvider) are always registered via NodeSDK.start(), ensuring all distro users get proper provider initialization.

README changes:

- Added Getting Started examples for OTLP-only, A365-only, and multi-backend usage.

- Added early-init guidance for proper instrumentation patching.

- Added full InstrumentationOptions table with all 12 instrumentations and actual defaults.

- Added missing a365.baggage and a365.hosting options tables.

- Added config precedence note (defaults > options > JSON > env vars).

Type fixes:

- Fixed enableLiveMetrics JSDoc default from false to true.

- Fixed enableTraceBasedSamplingForLogs JSDoc default from true to false.
Co-authored-by: Copilot <copilot@github.com>
@hectorhdzg
Hector Hernandez (hectorhdzg) force-pushed the hectorhdzg/conditional-azure-monitor-and-readme branch from e0b4d0a to 3a52232 Compare April 22, 2026 18:23
…nt sampler, improve Azure Monitor detection, add OTLP-only test
@hectorhdzg
Hector Hernandez (hectorhdzg) force-pushed the hectorhdzg/conditional-azure-monitor-and-readme branch from 3a52232 to 0eafa11 Compare April 22, 2026 18:35
@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit 9415fb5 into microsoft:main Apr 22, 2026
5 checks passed
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