@midwayjs/otel 3.5.1 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -71,7 +71,7 @@ You can find more information at [opentelemetry-js](https://github.com/open-tele
71
71
  Enable component first.
72
72
 
73
73
  ```typescript
74
- import { Configuration } from '@midwayjs/decorator';
74
+ import { Configuration } from '@midwayjs/core';
75
75
  import * as koa from '@midwayjs/koa';
76
76
  import * as otel from '@midwayjs/otel';
77
77
 
@@ -10,7 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OtelConfiguration = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
14
13
  const core_1 = require("@midwayjs/core");
15
14
  const tracer_decorator_1 = require("./decorator/tracer.decorator");
16
15
  const service_1 = require("./service");
@@ -47,15 +46,15 @@ let OtelConfiguration = class OtelConfiguration {
47
46
  }
48
47
  };
49
48
  __decorate([
50
- (0, decorator_1.Inject)(),
49
+ (0, core_1.Inject)(),
51
50
  __metadata("design:type", core_1.MidwayDecoratorService)
52
51
  ], OtelConfiguration.prototype, "decoratorService", void 0);
53
52
  __decorate([
54
- (0, decorator_1.Inject)(),
53
+ (0, core_1.Inject)(),
55
54
  __metadata("design:type", service_1.TraceService)
56
55
  ], OtelConfiguration.prototype, "traceService", void 0);
57
56
  OtelConfiguration = __decorate([
58
- (0, decorator_1.Configuration)({
57
+ (0, core_1.Configuration)({
59
58
  namespace: 'otel',
60
59
  })
61
60
  ], OtelConfiguration);
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Trace = exports.TRACE_KEY = void 0;
4
- const decorator_1 = require("@midwayjs/decorator");
4
+ const core_1 = require("@midwayjs/core");
5
5
  exports.TRACE_KEY = 'decorator:open_telemetry_key';
6
6
  function Trace(spanName) {
7
- return (0, decorator_1.createCustomMethodDecorator)(exports.TRACE_KEY, {
7
+ return (0, core_1.createCustomMethodDecorator)(exports.TRACE_KEY, {
8
8
  spanName,
9
9
  });
10
10
  }
package/dist/service.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Span } from '@opentelemetry/api';
2
1
  import { IMidwayApplication } from '@midwayjs/core';
2
+ import { Span } from '@opentelemetry/api';
3
3
  export declare class TraceService {
4
4
  private currentTracerName;
5
5
  protected app: IMidwayApplication;
package/dist/service.js CHANGED
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TraceService = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
13
+ const core_1 = require("@midwayjs/core");
14
14
  const api_1 = require("@opentelemetry/api");
15
15
  let TraceService = class TraceService {
16
16
  async init() {
@@ -30,18 +30,18 @@ let TraceService = class TraceService {
30
30
  }
31
31
  };
32
32
  __decorate([
33
- (0, decorator_1.App)(),
33
+ (0, core_1.App)(),
34
34
  __metadata("design:type", Object)
35
35
  ], TraceService.prototype, "app", void 0);
36
36
  __decorate([
37
- (0, decorator_1.Init)(),
37
+ (0, core_1.Init)(),
38
38
  __metadata("design:type", Function),
39
39
  __metadata("design:paramtypes", []),
40
40
  __metadata("design:returntype", Promise)
41
41
  ], TraceService.prototype, "init", null);
42
42
  TraceService = __decorate([
43
- (0, decorator_1.Provide)(),
44
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
43
+ (0, core_1.Provide)(),
44
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
45
45
  ], TraceService);
46
46
  exports.TraceService = TraceService;
47
47
  //# sourceMappingURL=service.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midwayjs/otel",
3
3
  "description": "midway open telemetry component",
4
- "version": "3.5.1",
4
+ "version": "3.6.0",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -10,10 +10,9 @@
10
10
  "index.d.ts"
11
11
  ],
12
12
  "devDependencies": {
13
- "@midwayjs/core": "^3.5.1",
14
- "@midwayjs/decorator": "^3.4.11",
15
- "@midwayjs/koa": "^3.5.1",
16
- "@midwayjs/mock": "^3.5.1",
13
+ "@midwayjs/core": "^3.6.0",
14
+ "@midwayjs/koa": "^3.6.0",
15
+ "@midwayjs/mock": "^3.6.0",
17
16
  "@opentelemetry/core": "^1.0.1",
18
17
  "@opentelemetry/sdk-trace-base": "^1.0.1",
19
18
  "@opentelemetry/sdk-trace-node": "^1.0.1"
@@ -42,5 +41,5 @@
42
41
  "type": "git",
43
42
  "url": "https://github.com/midwayjs/midway.git"
44
43
  },
45
- "gitHead": "3b63fc768617037644602dd5ad66d3734ce01b16"
44
+ "gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
46
45
  }