Closed TheIceCreamTroll closed 7 months ago
@TheIceCreamTroll I've tested your example in a sample app using the same dependencies, typescript version, and node version. Using the same code to initialize Azure Monitor I'm not seeing any type errors when ts compiling the project or running the generated js file. Can I take a look at your tsconfig.json
and package.json
to better recreate your environment?
tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": false,
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true
}
}
package.json
{
"name": "",
"version": "",
"scripts": {
"build": "tsc",
"build:production": "npm run prestart && npm prune --production",
"watch": "tsc --w",
"prestart": "npm run build && func extensions install",
"start:host": "func start",
"start": "npm-run-all --parallel start:host watch",
"test": "npx jest --watchAll=true",
"gen": "graphql-codegen --config codegen.yml",
"gen:watch": "graphql-codegen --config codegen.yml --watch --silent=false"
},
"description": "",
"devDependencies": {
"@graphql-codegen/cli": "^3.3.0",
"@graphql-codegen/introspection": "^3.0.1",
"@graphql-codegen/typed-document-node": "^4.0.0",
"@graphql-codegen/typescript": "^3.0.3",
"@graphql-codegen/typescript-operations": "^3.0.3",
"@graphql-codegen/typescript-resolvers": "^3.2.0",
"@types/jest": "^27.4.0",
"@types/node": "^18.16.0",
"jest": "^27.5.1",
"jest-html-reporter": "^3.6.0",
"mongodb-memory-server": "^8.3.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.1.3"
},
"dependencies": {
"@apollo/cache-control-types": "^1.0.2",
"@apollo/server": "^4.6.0",
"@apollo/server-plugin-response-cache": "^4.1.2",
"@apollo/utils.keyvaluecache": "^3.0.0",
"@as-integrations/azure-functions": "^0.1.3",
"@azure/arm-maps": "^3.1.0-beta.1",
"@azure/cognitiveservices-contentmoderator": "^5.0.1",
"@azure/functions": "^3.5.1",
"@azure/identity": "^2.0.4",
"@azure/monitor-opentelemetry": "^1.2.0",
"@azure/monitor-opentelemetry-exporter": "^1.0.0-beta.17",
"@azure/ms-rest-azure-js": "^2.1.0",
"@azure/search-documents": "^11.2.1",
"@azure/storage-blob": "^12.8.0",
"@graphql-tools/graphql-file-loader": "^7.3.3",
"@graphql-tools/load": "^7.5.1",
"@graphql-tools/load-files": "^6.5.3",
"@graphql-tools/schema": "^8.3.1",
"@graphql-tools/stitch": "^8.4.3",
"@lucaspaganini/value-objects": "^1.3.1",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/api-logs": "^0.48.0",
"@opentelemetry/instrumentation": "^0.48.0",
"@opentelemetry/instrumentation-bunyan": "^0.35.0",
"@opentelemetry/instrumentation-dataloader": "^0.5.4",
"@opentelemetry/instrumentation-graphql": "^0.36.1",
"@opentelemetry/instrumentation-http": "^0.48.0",
"@opentelemetry/instrumentation-mongodb": "^0.38.1",
"@opentelemetry/resources": "^1.21.0",
"@opentelemetry/sdk-logs": "^0.48.0",
"@opentelemetry/sdk-trace-base": "^1.21.0",
"@opentelemetry/semantic-conventions": "^1.21.0",
"@types/archiver": "^5.3.1",
"apollo-datasource-mongodb": "^0.6.0",
"archiver": "^5.3.1",
"async-retry": "^1.3.3",
"axios": "^1.3.6",
"bunyan": "^1.8.15",
"dayjs": "^1.11.3",
"graphql": "^16.6.0",
"graphql-fields": "^2.0.3",
"graphql-middleware": "^6.1.33",
"graphql-mongo-fields": "^1.0.6",
"graphql-scalars": "^1.14.1",
"graphql-shield": "^7.6.5",
"jose": "^4.5.0",
"moment": "^2.29.1",
"mongoose": "^6.2.1",
"nanoid": "^3.3.2",
"openid-client": "^5.1.3",
"retry": "^0.13.1"
}
}
@TheIceCreamTroll The types issue should be resolved by #28459 and will be available in the next Azure Monitor OpenTelemetry release. Thank you again for your issue report!
Closing as the fix has been released.
Describe the bug Using a custom resource in the AzureMonitorOpenTelemetryOptions is prevented due to a type error
To Reproduce
@opentelemetry/resources
const customResource = new Resource({
});
const config: AzureMonitorOpenTelemetryOptions = { azureMonitorExporterOptions: { connectionString: process.env.APPLICATIONINSIGHTS_CONNECTION_STRING, }, resource: customResource, };
useAzureMonitor(config);
"@azure/monitor-opentelemetry": "^1.2.0", "@opentelemetry/resources": "^1.21.0", "@opentelemetry/semantic-conventions": "^1.21.0",