-
Notifications
You must be signed in to change notification settings - Fork 545
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
feat(detector-aws): add DetectorSync implementation for beanstalk detector #2330
feat(detector-aws): add DetectorSync implementation for beanstalk detector #2330
Conversation
…ce for beanstalk detector
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2330 +/- ##
==========================================
- Coverage 90.97% 90.42% -0.56%
==========================================
Files 146 150 +4
Lines 7492 7373 -119
Branches 1502 1527 +25
==========================================
- Hits 6816 6667 -149
- Misses 676 706 +30
|
@@ -235,7 +235,11 @@ function getDisabledInstrumentationsFromEnv() { | |||
export function getResourceDetectorsFromEnv(): Array<Detector | DetectorSync> { | |||
const resourceDetectors = new Map< | |||
string, | |||
Detector | DetectorSync | Detector[] | DetectorSync[] | |||
| Detector |
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.
note for reviewer: this is necessary to allow this single refactor instead of doing all AWS detector at once.
@@ -15,7 +15,14 @@ | |||
*/ | |||
|
|||
export * from './AwsEc2Detector'; | |||
export * from './AwsBeanstalkDetector'; | |||
export { |
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.
note for reviewer: small step forward for open-telemetry/opentelemetry-js#4186
@@ -16,7 +16,7 @@ | |||
|
|||
import * as assert from 'assert'; | |||
import * as sinon from 'sinon'; | |||
import { awsBeanstalkDetector, AwsBeanstalkDetector } from '../../src'; | |||
import { awsBeanstalkDetector, AwsBeanstalkDetectorSync } from '../../src'; |
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.
note for reviewer: the AwsBeanstalkDetector
became a wrapper for AwsBeanstalkDetectorSync
class so we have to stub the later, hence the import and the changes in stubs
closed in favour of #2376 following this suggestion |
Context
Another PR moving away from the deprecated
Detector
interface in favour to theDetectorSync
interface. This time is for AWS Beanstalk detector and it might help a bit in open-telemetry/opentelemetry-js#3582Not doing all detectors at once:
Short description of the changes
AwsBeanstalkDetectorSync
class and instanceAwsBeanstalkDetector
reuse the new sync instanceNote: since this package is marked as stable (major version is 1) we are doing a non breaking change by adding the new class and mark the current as
deprecated
. The async detector changes behavior, it does not throw anymore, and it was discussed in last SIG meeting (2024-07-31). The outcome was we're okay with that.A couple of PRs will follow: