Skip to content
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

Existing detectors fail to compile: breaking change in @opentelemetry/[email protected] #3676

Closed
pichlermarc opened this issue Mar 15, 2023 · 0 comments · Fixed by #3677
Closed
Labels
bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc

Comments

@pichlermarc
Copy link
Member

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();
          ~~~~~~~~~~~~~~~~~~~~~~~~
@pichlermarc pichlermarc added bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc labels Mar 15, 2023
jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Mar 27, 2023
`@opentelemetry/[email protected]` has a bug that causes build break.

open-telemetry/opentelemetry-js#3676

This PR pin opentelemetry dependencies for now. We will upgrade versions when
1.11.0 is published.
jeremymeng added a commit to Azure/azure-sdk-for-js that referenced this issue Mar 27, 2023
`@opentelemetry/[email protected]` has a bug that causes build break.

open-telemetry/opentelemetry-js#3676

This PR pin opentelemetry dependencies for now. We will upgrade versions
when 1.11.0 is published.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p1 Bugs which cause problems in end-user applications such as crashes, data inconsistencies, etc
Projects
None yet
1 participant