-
Notifications
You must be signed in to change notification settings - Fork 956
Existing detectors fail to compile: breaking change in @opentelemetry/[email protected] #3676
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingpriority:p1Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etcBugs which cause problems in end-user applications such as crashes, data inconsistencies, etc
Description
What happened?
Steps to Reproduce
npm i --save-exact @opentelemetry/[email protected]npm i --save-dev typescript- create file
detector.ts, add the code below
// detector.ts
import { Resource, Detector, ResourceDetectionConfig } from "@opentelemetry/resources";
class EmptyResourceDetector implements Detector{
async detect(_config?: ResourceDetectionConfig): Promise<Resource> {
return Resource.empty();
}
}npx tsc detector.ts --lib es2017
Expected Result
Compiles as it did with @opentelemetry/[email protected]
Actual Result
Fails with a compiler error.
Additional Details
Introduced in #3460
OpenTelemetry Setup Code
// no OpenTelemetry setup is necessary.package.json
{
"dependencies": {
"@opentelemetry/resources": "1.10.0"
},
"devDependencies": {
"typescript": "^4.9.5"
}
}Relevant log output
detector.ts:5:9 - error TS2739: Type 'IResource' is missing the following properties from type 'Resource': _attributes, _syncAttributes, _asyncAttributesPromise
5 return Resource.empty();
~~~~~~~~~~~~~~~~~~~~~~~~aabmass
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpriority:p1Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etcBugs which cause problems in end-user applications such as crashes, data inconsistencies, etc