-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add official OpenTelemetry Nest.js core instrumentation to the default instrumentations set. It adds Nest.js specific instrumentation such as controllers and requests handlers. Nest specific spans are properly structured inside the HTTP/Express ones. Co-authored-by: Noemi Lapresta <[email protected]>
- Loading branch information
1 parent
78bd040
commit c07b3a4
Showing
29 changed files
with
16,920 additions
and
36 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: "patch" | ||
type: "add" | ||
--- | ||
|
||
Add support for Nest.js |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec::Matchers.define :have_nest_context_span do | ||
match do |actual| | ||
context_span = Span.find_by_name!(actual) | ||
raise "No Nest.js request context span found with name: '#{actual}'" unless context_span | ||
|
||
Span.root.transitive_parent_of?(context_span) && | ||
context_span.instrumentation_library_name == "@opentelemetry/instrumentation-nestjs-core" | ||
end | ||
end | ||
|
||
RSpec::Matchers.define :have_nest_handler_span do | ||
match do |actual| | ||
handler_span = Span.find_by_name!(actual) | ||
raise "No Nest.js handler span found with name: '#{actual}'" unless handler_span | ||
|
||
Span.root.transitive_parent_of?(handler_span) && | ||
handler_span.instrumentation_library_name == "@opentelemetry/instrumentation-nestjs-core" | ||
end | ||
end |
Oops, something went wrong.