Skip to content

Update samples - #11

Merged
Hector Hernandez (hectorhdzg) merged 2 commits into
microsoft:mainfrom
hectorhdzg:samples/simplify-and-update-to-microsoft-opentelemetry
Apr 10, 2026
Merged

Hector Hernandez (hectorhdzg) merged 2 commits into
microsoft:mainfrom
hectorhdzg:samples/simplify-and-update-to-microsoft-opentelemetry

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member
  • Remove JavaScript samples and v1/ folder nesting
  • Flatten structure to samples/src/*.ts
  • Update all imports from @azure/monitor-opentelemetry to @microsoft/opentelemetry
  • Replace useAzureMonitor/shutdownAzureMonitor with useMicrosoftOpenTelemetry/shutdownMicrosoftOpenTelemetry
  • Restructure options to use azureMonitor.azureMonitorExporterOptions nesting
  • Update README with configuration tables and clean up boilerplate

- Remove JavaScript samples and v1/ folder nesting
- Flatten structure to samples/src/*.ts
- Update all imports from @azure/monitor-opentelemetry to @microsoft/opentelemetry
- Replace useAzureMonitor/shutdownAzureMonitor with useMicrosoftOpenTelemetry/shutdownMicrosoftOpenTelemetry
- Restructure options to use azureMonitor.azureMonitorExporterOptions nesting
- Update README with configuration tables and clean up boilerplate

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 refreshes the repository samples by removing the legacy samples/v1/* JavaScript/TypeScript layout and consolidating TypeScript examples under samples/src/*.ts, updated to the @microsoft/opentelemetry API and the new azureMonitor.* option nesting. It also updates the root README with configuration tables and modernized onboarding guidance.

Changes:

  • Removed samples/v1/javascript and samples/v1/typescript sample sets and their per-language READMEs/package.json files.
  • Added a consolidated samples/ TypeScript sample project (new samples/package.json, samples/tsconfig.json, new top-level samples/README.md) and updated samples to call useMicrosoftOpenTelemetry.
  • Updated the root README.md to describe configuration options and point to the new samples directory.

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
samples/v1/typescript/src/offlineStorage.ts Removed legacy v1 TypeScript offline storage sample.
samples/v1/typescript/src/basicConnection.ts Removed legacy v1 TypeScript basic connection sample.
samples/v1/typescript/README.md Removed legacy v1 TypeScript samples README.
samples/v1/typescript/package.json Removed legacy v1 TypeScript samples package definition.
samples/v1/javascript/sampling.js Removed legacy v1 JavaScript sampling sample.
samples/v1/javascript/redactQueryStrings.js Removed legacy v1 JavaScript query-string redaction sample.
samples/v1/javascript/README.md Removed legacy v1 JavaScript samples README.
samples/v1/javascript/package.json Removed legacy v1 JavaScript samples package definition.
samples/v1/javascript/otlpExporter.js Removed legacy v1 JavaScript OTLP dual-export sample.
samples/v1/javascript/offlineStorage.js Removed legacy v1 JavaScript offline storage sample.
samples/v1/javascript/liveMetrics.js Removed legacy v1 JavaScript live metrics sample.
samples/v1/javascript/customTrace.js Removed legacy v1 JavaScript custom trace sample.
samples/v1/javascript/customMetric.js Removed legacy v1 JavaScript custom metric sample.
samples/v1/javascript/cloudRole.js Removed legacy v1 JavaScript cloud role sample.
samples/v1/javascript/basicConnection.js Removed legacy v1 JavaScript basic connection sample.
samples/tsconfig.json Added TS build configuration for the consolidated samples project.
samples/src/sampling.ts Updated sample to use @microsoft/opentelemetry and nested azureMonitor options.
samples/src/redactQueryStrings.ts Updated sample to use @microsoft/opentelemetry and nested azureMonitor options.
samples/src/otlpExporter.ts Updated sample to use @microsoft/opentelemetry APIs including shutdown.
samples/src/offlineStorage.ts Added new offline storage sample in the flattened samples/src layout.
samples/src/liveMetrics.ts Updated sample to use @microsoft/opentelemetry and nested azureMonitor options.
samples/src/customTrace.ts Updated sample to use @microsoft/opentelemetry APIs including shutdown.
samples/src/customMetric.ts Updated sample to use @microsoft/opentelemetry APIs including shutdown.
samples/src/cloudRole.ts Updated sample to use @microsoft/opentelemetry and nested azureMonitor options.
samples/src/basicConnection.ts Added new basic connection sample in the flattened samples/src layout.
samples/README.md Added consolidated samples README and run instructions for the new layout.
samples/package.json Added consolidated samples package definition for TypeScript builds.
README.md Updated root README with new package onboarding and configuration tables.

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

Comment thread README.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@rads-1996 Radhika Gupta (rads-1996) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit 2c52008 into microsoft:main Apr 10, 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