fix(http): build error
This commit is contained in:
parent
4571ede515
commit
5cc7794daa
12
package.json
12
package.json
@ -31,6 +31,13 @@
|
||||
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.ts'",
|
||||
"watch": "tsc -w"
|
||||
},
|
||||
"keywords": [
|
||||
"tachybase",
|
||||
"opentelemetry",
|
||||
"nodejs",
|
||||
"tracing",
|
||||
"instrumentation"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://git.daoyoucloud.com/TomyJan/opentelemetry-auto-instrumentations/issues"
|
||||
},
|
||||
@ -103,7 +110,10 @@
|
||||
"files": [
|
||||
"build/src/**/*.js",
|
||||
"build/src/**/*.js.map",
|
||||
"build/src/**/*.d.ts"
|
||||
"build/src/**/*.d.ts",
|
||||
"doc",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"changelog": {
|
||||
"labels": {
|
||||
|
2
plugins/node/opentelemetry-instrumentation-http/.npmrc
Normal file
2
plugins/node/opentelemetry-instrumentation-http/.npmrc
Normal file
@ -0,0 +1,2 @@
|
||||
registry=https://registry.npmjs.org/
|
||||
@tachybase:registry=https://registry.npmjs.org/
|
14801
plugins/node/opentelemetry-instrumentation-http/package-lock.json
generated
Normal file
14801
plugins/node/opentelemetry-instrumentation-http/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,30 +1,38 @@
|
||||
{
|
||||
"name": "@opentelemetry/instrumentation-http",
|
||||
"version": "0.52.1",
|
||||
"description": "OpenTelemetry instrumentation for `node:http` and `node:https` http client and server modules",
|
||||
"name": "@tachybase/opentelemetry-instrumentation-http",
|
||||
"version": "0.0.1",
|
||||
"description": "OpenTelemetry instrumentation for `node:http` and `node:https` http client and server modules for TachyBase",
|
||||
"author": "TachyBase Team",
|
||||
"homepage": "https://git.daoyoucloud.com/TomyJan/opentelemetry-auto-instrumentations/plugins/node/opentelemetry-instrumentation-http",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"main": "build/src/index.js",
|
||||
"types": "build/src/index.d.ts",
|
||||
"repository": "open-telemetry/opentelemetry-js",
|
||||
"exports": {
|
||||
".": "./build/src/index.js",
|
||||
"./register": "./build/src/register.js"
|
||||
},
|
||||
"repository": "https://git.daoyoucloud.com/TomyJan/opentelemetry-auto-instrumentations",
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run compile",
|
||||
"compile": "tsc --build",
|
||||
"clean": "tsc --build --clean",
|
||||
"test:cjs": "nyc mocha test/**/*.test.ts",
|
||||
"test:esm": "nyc node --experimental-loader=@opentelemetry/instrumentation/hook.mjs ../../../node_modules/mocha/bin/mocha 'test/**/*.test.mjs'",
|
||||
"test": "npm run test:cjs && npm run test:esm",
|
||||
"tdd": "npm run test -- --watch-extensions ts --watch",
|
||||
"compile": "tsc --build",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"lint:fix": "eslint . --ext .ts --fix",
|
||||
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../../",
|
||||
"version": "node ../../../scripts/version-update.js",
|
||||
"watch": "tsc --build --watch",
|
||||
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
|
||||
"prewatch": "node ../../../scripts/version-update.js",
|
||||
"peer-api-check": "node ../../../scripts/peer-api-check.js",
|
||||
"align-api-deps": "node ../../../scripts/align-api-deps.js",
|
||||
"maint:regenerate-test-certs": "cd test/fixtures && ./regenerate.sh"
|
||||
"precompile": "cross-var lerna run version --include-dependencies",
|
||||
"prewatch": "npm run precompile",
|
||||
"prepublishOnly": "npm run compile",
|
||||
"tdd": "npm run test -- --watch-extensions ts --watch",
|
||||
"test": "npm run test:cjs && npm run test:esm",
|
||||
"watch": "tsc --build --watch"
|
||||
},
|
||||
"keywords": [
|
||||
"tachybase",
|
||||
"opentelemetry",
|
||||
"http",
|
||||
"nodejs",
|
||||
@ -32,21 +40,11 @@
|
||||
"profiling",
|
||||
"instrumentation"
|
||||
],
|
||||
"author": "OpenTelemetry Authors",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
"bugs": {
|
||||
"url": "https://git.daoyoucloud.com/TomyJan/opentelemetry-auto-instrumentations/issues"
|
||||
},
|
||||
"files": [
|
||||
"build/src/**/*.js",
|
||||
"build/src/**/*.js.map",
|
||||
"build/src/**/*.d.ts",
|
||||
"doc",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"peerDependencies": {
|
||||
"@opentelemetry/api": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opentelemetry/api": "1.9.0",
|
||||
@ -73,15 +71,18 @@
|
||||
"superagent": "9.0.2",
|
||||
"typescript": "4.4.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opentelemetry/api": "^1.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@opentelemetry/core": "1.25.1",
|
||||
"@opentelemetry/instrumentation": "0.52.1",
|
||||
"@opentelemetry/semantic-conventions": "1.25.1",
|
||||
"semver": "^7.5.2"
|
||||
},
|
||||
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http",
|
||||
"sideEffects": false
|
||||
"files": [
|
||||
"build/src/**/*.js",
|
||||
"build/src/**/*.js.map",
|
||||
"build/src/**/*.d.ts",
|
||||
"doc",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
]
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ import {
|
||||
Https,
|
||||
} from './types';
|
||||
import * as utils from './utils';
|
||||
import { VERSION } from './version';
|
||||
import packageJson from '../package.json';
|
||||
import {
|
||||
InstrumentationBase,
|
||||
InstrumentationNodeModuleDefinition,
|
||||
@ -70,7 +70,7 @@ export class HttpInstrumentation extends InstrumentationBase<HttpInstrumentation
|
||||
private _httpClientDurationHistogram!: Histogram;
|
||||
|
||||
constructor(config: HttpInstrumentationConfig = {}) {
|
||||
super('@opentelemetry/instrumentation-http', VERSION, config);
|
||||
super('@opentelemetry/instrumentation-http', packageJson?.version, config);
|
||||
this._headerCapture = this._createHeaderCapture();
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@ import {
|
||||
SEMATTRS_NET_PEER_PORT,
|
||||
SEMATTRS_NET_TRANSPORT,
|
||||
} from '@opentelemetry/semantic-conventions';
|
||||
import * as assert from 'assert';
|
||||
import * as nock from 'nock';
|
||||
import assert from 'assert';
|
||||
import nock from 'nock';
|
||||
import * as path from 'path';
|
||||
import { HttpInstrumentation } from '../../src/http';
|
||||
import { HttpInstrumentationConfig } from '../../src/types';
|
||||
@ -609,7 +609,7 @@ describe('HttpInstrumentation', () => {
|
||||
)}`, async () => {
|
||||
try {
|
||||
await httpRequest.get(arg);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// request has been made
|
||||
// nock throw
|
||||
assert.ok(error.message.startsWith('Nock: No match for request'));
|
||||
@ -625,7 +625,7 @@ describe('HttpInstrumentation', () => {
|
||||
)}`, async () => {
|
||||
try {
|
||||
await httpRequest.get(arg as any);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// request has been made
|
||||
// nock throw
|
||||
assert.ok(
|
||||
|
@ -33,7 +33,7 @@ instrumentation.enable();
|
||||
instrumentation.disable();
|
||||
|
||||
import * as http from 'http';
|
||||
import * as request from 'request-promise-native';
|
||||
import request from 'request-promise-native';
|
||||
import * as superagent from 'superagent';
|
||||
// Temporarily removed. See https://github.com/open-telemetry/opentelemetry-js/issues/3344
|
||||
// import * as got from 'got';
|
||||
|
@ -40,7 +40,7 @@ import {
|
||||
} from '@opentelemetry/semantic-conventions';
|
||||
import * as assert from 'assert';
|
||||
import * as fs from 'fs';
|
||||
import * as nock from 'nock';
|
||||
import nock from 'nock';
|
||||
import * as path from 'path';
|
||||
import { HttpInstrumentation } from '../../src/http';
|
||||
import { assertSpan } from '../utils/assertSpan';
|
||||
@ -473,7 +473,7 @@ describe('HttpsInstrumentation', () => {
|
||||
)}`, async () => {
|
||||
try {
|
||||
await httpsRequest.get(arg);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// request has been made
|
||||
// nock throw
|
||||
assert.ok(error.message.startsWith('Nock: No match for request'));
|
||||
@ -489,7 +489,7 @@ describe('HttpsInstrumentation', () => {
|
||||
)}`, async () => {
|
||||
try {
|
||||
await httpsRequest.get(arg as any);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// request has been made
|
||||
// nock throw
|
||||
assert.ok(
|
||||
|
@ -33,7 +33,7 @@ instrumentation.enable();
|
||||
instrumentation.disable();
|
||||
|
||||
import * as http from 'http';
|
||||
import * as request from 'request-promise-native';
|
||||
import request from 'request-promise-native';
|
||||
import * as superagent from 'superagent';
|
||||
// Temporarily removed. See https://github.com/open-telemetry/opentelemetry-js/issues/3344
|
||||
// import * as got from 'got';
|
||||
|
@ -390,7 +390,7 @@ describe('HttpInstrumentation Integration tests', () => {
|
||||
`${protocol}://localhost:${mockServerPort}/timeout`,
|
||||
{ timeout: 1 }
|
||||
);
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
assert.ok(err.message.startsWith('timeout'));
|
||||
}
|
||||
|
||||
|
@ -2,36 +2,12 @@
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "build",
|
||||
"rootDir": "."
|
||||
"rootDir": ".",
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"test/**/*.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../api"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/opentelemetry-context-async-hooks"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/opentelemetry-core"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/opentelemetry-sdk-trace-base"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/opentelemetry-sdk-trace-node"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/opentelemetry-semantic-conventions"
|
||||
},
|
||||
{
|
||||
"path": "../../../packages/sdk-metrics"
|
||||
},
|
||||
{
|
||||
"path": "../opentelemetry-instrumentation"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user