Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update metric spec to the latest otel lib
BREAKING CHANGE: Anything related to metrics sdk has changed. OTEL now has a stable spec and all the projects are moving towards new interfaces. Co-authored-by: Ivan Santos <pragmaticivan@gmail.com> Co-authored-by: Adrian Busse <hello@adrianmxb.com>
- Loading branch information
1 parent
48f724e
commit 6ed63ae
Showing
11 changed files
with
1,405 additions
and
1,130 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { createParamDecorator } from '@nestjs/common'; | ||
import { MetricOptions } from '@opentelemetry/api-metrics'; | ||
import { getOrCreateValueRecorder, MetricType } from '../metric-data'; | ||
import { getOrCreateHistogram, MetricType } from '../metric-data'; | ||
|
||
export const OtelValueRecorder = createParamDecorator((name: string, options?: MetricOptions) => { | ||
if (!name || name.length === 0) { | ||
throw new Error('OtelValueRecorder need a name argument'); | ||
} | ||
return getOrCreateValueRecorder(name, MetricType.ValueRecorder, options); | ||
return getOrCreateHistogram(name, MetricType.Histogram, options); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters