Skip to content

Move Azure Monitor files into src/azureMonitor/ subdirectory - #23

Merged
Hector Hernandez (hectorhdzg) merged 4 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/restructure-azuremonitor
Apr 20, 2026
Merged

Hector Hernandez (hectorhdzg) merged 4 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/restructure-azuremonitor

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member

No description provided.

Restructure src/ to match the Python distro layout:
- azureMonitorSetup.ts, loader.ts -> src/azureMonitor/
- browserSdkLoader/ -> src/azureMonitor/browserSdkLoader/
- generated/ -> src/azureMonitor/generated/
- logs/ -> src/azureMonitor/logs/
- metrics/ -> src/azureMonitor/metrics/
- traces/ -> src/azureMonitor/traces/

Update all import paths in moved files and test files accordingly.
No functional changes.

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 reorganizes Azure Monitor-specific implementation under src/azureMonitor/ and updates internal imports/tests accordingly, aligning the distro and unit tests with the new module layout.

Changes:

  • Move Azure Monitor traces/metrics/logs/browser SDK loader/live metrics code under src/azureMonitor/.
  • Update distro wiring (src/distro/distro.ts) to import Azure Monitor components from the new locations.
  • Update unit tests’ imports to reference the new src/azureMonitor/... paths.

Reviewed changes

Copilot reviewed 27 out of 51 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/internal/unit/traces/traceHandler.test.ts Updates imports to new src/azureMonitor/traces and src/azureMonitor/metrics paths.
test/internal/unit/traces/sampler.test.ts Updates sampler import path to src/azureMonitor/traces.
test/internal/unit/traces/azureFnInstrumentation.test.ts Updates imports to new src/azureMonitor/traces and src/azureMonitor/metrics paths.
test/internal/unit/metrics/standardMetrics.test.ts Updates imports to src/azureMonitor/metrics modules.
test/internal/unit/metrics/performanceMetrics.test.ts Updates import to src/azureMonitor/metrics/performanceCounters.
test/internal/unit/metrics/metricHandler.test.ts Updates import to src/azureMonitor/metrics.
test/internal/unit/metrics/liveMetricsFilter.test.ts Updates imports to src/azureMonitor/generated and src/azureMonitor/metrics/quickpulse.
test/internal/unit/metrics/liveMetrics.test.ts Updates imports to src/azureMonitor/metrics/quickpulse and src/azureMonitor/generated.
test/internal/unit/metrics/availableMemory.test.ts Updates import to src/azureMonitor/metrics/utils.
test/internal/unit/logs/logHandler.test.ts Updates imports to src/azureMonitor/logs and src/azureMonitor/metrics.
test/internal/unit/logs/batchLogRecordProcessor.test.ts Updates imports to src/azureMonitor/logs and src/azureMonitor/traces.
test/internal/unit/browserSdkLoader/browserSdkLoader.test.ts Updates imports to src/azureMonitor/browserSdkLoader.
src/distro/distro.ts Re-points Azure Monitor imports to src/azureMonitor/* and updates setup import.
src/azureMonitor/traces/spanProcessor.ts Fixes relative import to shared logger after move.
src/azureMonitor/traces/sampler.ts Fixes relative import to shared types after move.
src/azureMonitor/traces/index.ts Adds new traces entrypoint re-export.
src/azureMonitor/traces/handler.ts Fixes relative imports to shared config and common utils after move.
src/azureMonitor/metrics/utils.ts Fixes relative import to shared logger after move.
src/azureMonitor/metrics/types.ts Introduces Azure Monitor metrics constants/types now under azureMonitor tree.
src/azureMonitor/metrics/standardMetrics.ts Fixes relative import to shared config after move.
src/azureMonitor/metrics/quickpulse/utils.ts Fixes relative imports to shared types/utils/logger after move.
src/azureMonitor/metrics/quickpulse/types.ts Adds quickpulse-related types/enums under azureMonitor tree.
src/azureMonitor/metrics/quickpulse/liveMetrics.ts Fixes relative imports to shared/types/utils after move.
src/azureMonitor/metrics/quickpulse/filtering/validator.ts Adds quickpulse filter validation logic under azureMonitor tree.
src/azureMonitor/metrics/quickpulse/filtering/quickpulseErrors.ts Adds quickpulse error types under azureMonitor tree.
src/azureMonitor/metrics/quickpulse/filtering/projection.ts Adds derived metric projection logic under azureMonitor tree.
src/azureMonitor/metrics/quickpulse/filtering/filter.ts Adds runtime filter evaluation logic under azureMonitor tree.
src/azureMonitor/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.ts Adds configuration error tracking utility under azureMonitor tree.
src/azureMonitor/metrics/quickpulse/export/sender.ts Adds Quickpulse sender implementation under azureMonitor tree.
src/azureMonitor/metrics/quickpulse/export/exporter.ts Adds Quickpulse metric exporter implementation under azureMonitor tree.
src/azureMonitor/metrics/performanceCounters.ts Fixes relative imports to shared config/logger after move.
src/azureMonitor/metrics/index.ts Adds new metrics entrypoint re-export.
src/azureMonitor/metrics/handler.ts Fixes relative imports to shared config/logger after move.
src/azureMonitor/logs/logRecordProcessor.ts Fixes relative import to shared logger after move.
src/azureMonitor/logs/index.ts Adds new logs entrypoint re-export.
src/azureMonitor/logs/handler.ts Fixes relative imports to shared config and log utils after move.
src/azureMonitor/logs/batchLogRecordProcessor.ts Adds Azure-specific batch processor under azureMonitor tree.
src/azureMonitor/loader.ts Fixes relative imports to shared modules after move.
src/azureMonitor/generated/static-helpers/urlTemplate.ts Adds generated URL template helper under azureMonitor tree.
src/azureMonitor/generated/quickpulseClient.ts Adds generated Quickpulse client wrapper under azureMonitor tree.
src/azureMonitor/generated/models/models.ts Adds generated Quickpulse models/serializers under azureMonitor tree.
src/azureMonitor/generated/models/index.ts Adds generated models barrel export under azureMonitor tree.
src/azureMonitor/generated/logger.ts Adds generated logger helper under azureMonitor tree.
src/azureMonitor/generated/index.ts Adds generated barrel exports under azureMonitor tree.
src/azureMonitor/generated/api/quickpulseContext.ts Adds generated Quickpulse REST client context under azureMonitor tree.
src/azureMonitor/generated/api/options.ts Adds generated operation options types under azureMonitor tree.
src/azureMonitor/generated/api/operations.ts Adds generated publish/ping operations under azureMonitor tree.
src/azureMonitor/generated/api/index.ts Adds generated api barrel exports under azureMonitor tree.
src/azureMonitor/browserSdkLoader/browserSdkLoaderHelper.ts Adds browser SDK loader helper under azureMonitor tree.
src/azureMonitor/browserSdkLoader/browserSdkLoader.ts Fixes relative imports to shared/types/utils after move.
src/azureMonitor/azureMonitorSetup.ts Fixes relative imports to shared config/types/utils after move.

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

- Moved connectionStringParser, types, statsbeat, logUtils, and
  opentelemetryInstrumentationPatcher from src/utils/ to src/azureMonitor/utils/
- Split common.ts: AzMon-specific functions (ignoreOutgoingRequestHook,
  getOsPrefix, getResourceProvider, msToTimeSpan) moved to azureMonitor/utils/,
  general functions (parseResourceDetectorsFromEnvVar, isFunctionApp) kept in utils/
- Renamed azureMonitorSetup.ts to azureMonitor/index.ts
- Updated all import paths accordingly

@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 d5dda30 into microsoft:main Apr 20, 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