Skip to content

Commit

Permalink
Merge pull request #27 from MetinSeylan/hotfix/decorator
Browse files Browse the repository at this point in the history
Hotfix observer decorators
  • Loading branch information
MetinSeylan authored Feb 26, 2022
2 parents 1863c76 + f8431ec commit 573b10f
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions dist/Metric/Injectors/DecoratorCounterMetricInjector.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/Metric/Injectors/DecoratorObserverMetricInjector.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tsconfig.build.tsbuildinfo

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metinseylan/nestjs-opentelemetry",
"version": "2.0.3",
"version": "2.0.4",
"description": "deeply integrated OpenTelemetry module for Nestjs",
"author": "[email protected]",
"license": "MIT",
Expand Down
2 changes: 2 additions & 0 deletions src/Metric/Injectors/DecoratorCounterMetricInjector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export class DecoratorCounterMetricInjector extends BaseMetricInjector {
!this.isAffected(provider.metatype.prototype[key])
) {
const options = this.getOptions(provider.metatype.prototype[key]);
if (options.type !== DecoratorType.COUNTER) return;

const name =
options['name']?.toLowerCase() ??
this.generateName(provider, provider.metatype.prototype[key]);
Expand Down
3 changes: 3 additions & 0 deletions src/Metric/Injectors/DecoratorObserverMetricInjector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export class DecoratorObserverMetricInjector extends BaseMetricInjector {
const options = this.getOptions(
isControllerDecorated ? controller.metatype : prototype,
);

if (options.type !== DecoratorType.OBSERVER) return;

const name = this.generateName(controller, prototype, options);
const metric = this.generateMetric(name, options['options']);

Expand Down

0 comments on commit 573b10f

Please sign in to comment.