-
Notifications
You must be signed in to change notification settings - Fork 255
[Beta] Add startSpan, withSpan, Route Strategy #2647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: beta
Are you sure you want to change the base?
Conversation
shared/AppInsightsCore/src/OpenTelemetry/attribute/attributeContainer.ts
Fixed
Show fixed
Hide fixed
shared/AppInsightsCore/src/OpenTelemetry/interfaces/config/IOTelTraceCfg.ts
Fixed
Show fixed
Hide fixed
f8bce57 to
4bd44b0
Compare
bc8e145 to
e7b0b79
Compare
- Attribute Container with inheritance - Initial OTelAPI with span creation - Prior to Removing IOTelContext, IOTelContextManager and IOTelSpanContext
Change API Surface - Use IReadableSpan instead of IOTelSpan Removed - IOTelSpanContext (use IDistributedTraceContext instead) - IOTelLink - IOTelContext - IOTelContextManager Renamed - IOTelTraceCfg -> ITraceCfg - IOTelTraceApi -> ITraceApi Changed - IReadableSpan - removed droppedEventCount - removed droppedLinksCount - changed spanContext, parentSpanContext return IDistributedTraceContext instead - ITraceApi - add getActiveSpan, setActiveSpan - IOTelApi - removed context (IOTelContextManager) - ITraceCfg - added suppressTracing config
…nclude in the build
e7b0b79 to
0d494ec
Compare
1bf69c4 to
207affd
Compare
c2f2008 to
5014727
Compare
9f4ec24 to
549f782
Compare
549f782 to
02e150e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This draft PR adds OpenTelemetry-compatible tracing API support to the Application Insights JavaScript SDK, including span creation, route strategy, and attribute containers with inheritance.
Changes:
- Adds comprehensive OpenTelemetry tracing API documentation
- Implements span creation helpers (
startSpan,withSpan,useSpan) - Adds route strategy and attribute container functionality
- Refactors sampling logic to use factory functions
- Introduces Request telemetry type support
Reviewed changes
Copilot reviewed 53 out of 182 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/OTel/otelApi.md | Complete API reference for OpenTelemetry functionality |
| docs/OTel/examples.md | Comprehensive examples and usage patterns |
| docs/OTel/README.md | Overview and quick start guide |
| common/Tests/Framework/src/Assert.ts | Adds doesNotThrow helper method |
| common/Tests/Framework/src/AITestClass.ts | Adds storage clearing methods for tests |
| channels/.../SamplingScoreGenerator.ts | Refactors to factory pattern |
| channels/.../HashCodeScoreGenerator.ts | Converts class to standalone function |
| channels/.../Sample.ts | Refactors to factory function pattern |
| channels/.../RequestData.ts | New file for Request telemetry data |
| channels/.../RemoteDependencyData.ts | New file for dependency telemetry |
| channels/.../Data.ts | Helper for creating data structures |
| channels/.../Serializer.ts | Refactors serialization logic |
| channels/.../Sender.ts | Updates for new telemetry types |
| channels/.../IRequestData.ts | Interface for Request telemetry |
| channels/.../EnvelopeCreator.ts | Adds Request envelope creator |
| channels/.../Sender.tests.ts | Updates test data type references |
| channels/.../Sample.tests.ts | Updates for refactored sampling |
| README.md | Adds OpenTelemetry section |
| AISKULight/src/index.ts | Adds IRequestTelemetry export |
| AISKULight/Tests/.../otelNegative.tests.ts | Negative tests for OTel without provider |
| AISKULight/Tests/.../aiskuliteunittests.ts | Registers new test suite |
| AISKULight/Tests/.../AISKULightSize.Tests.ts | Updates size thresholds |
| AISKU/src/internal/trace/spanUtils.ts | Core span utilities and telemetry conversion |
| AISKU/src/applicationinsights-web.ts | Exports OTel interfaces |
| AISKU/src/InternalConstants.ts | Adds UNDEFINED_VALUE constant |
| AISKU/src/Init.ts | Exports IRequestTelemetry |
| AISKU/src/IApplicationInsights.ts | Extends interface with OTel APIs |
| AISKU/src/AISku.ts | Implements OTel API initialization |
| AISKU/examples/span-usage-example.ts | Example of span usage |
| AISKU/Tests/.../applicationinsights.e2e.tests.ts | E2E tests for CDN and data types |
| AISKU/Tests/.../aiskuunittests.ts | Registers new OTel test suites |
| AISKU/Tests/.../WithSpan.Tests.ts | Comprehensive withSpan tests |
| AISKU/Tests/.../UseSpan.Tests.ts | Comprehensive useSpan tests |
| AISKU/Tests/.../TraceSuppression.Tests.ts | Tests for trace suppression |
| AISKU/Tests/.../OTelInit.Tests.ts | OTel initialization tests |
| AISKU/Tests/.../AISKUSize.Tests.ts | Updates size thresholds |
Files not reviewed (1)
- common/config/rush/npm-shrinkwrap.json: Language not supported
Comments suppressed due to low confidence (1)
docs/OTel/examples.md:1
- Corrected spelling of 'Semabtic' to 'Semantic'
# OpenTelemetry Examples and Patterns
02e150e to
eb870e6
Compare
- add additional tests - Changed to only create OTel SDK after initialization - Negative tests - Refactor to use ITraceHost instead of core - Add URL redaction - Additional tests - Remove truncation - Change how OTel is lazily initialized and used - Add 1ds MsWebSpan creation
eb870e6 to
07edc6a
Compare
Change API Surface
Removed
Renamed
Changed
IReadableSpan
ITraceApi
IOTelApi
ITraceCfg
add additional tests
Changed to only create OTel SDK after initialization
Negative tests
Refactor to use ITraceHost instead of core
Add URL redaction
Additional tests
Remove truncation
Change how OTel is lazily initialized and used
Add 1ds MsWebSpan creation