-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b32759e
commit 4165d78
Showing
11 changed files
with
115 additions
and
108 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
57 changes: 0 additions & 57 deletions
57
dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/src/app.controller.ts
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
dev-packages/e2e-tests/test-applications/nestjs-distributed-tracing/src/app.module.ts
This file was deleted.
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
42 changes: 42 additions & 0 deletions
42
.../e2e-tests/test-applications/nestjs-distributed-tracing/src/trace-initiator.controller.ts
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,42 @@ | ||
import { Controller, Get, Headers, Param } from '@nestjs/common'; | ||
import { TraceInitiatorService } from './trace-initiator.service'; | ||
|
||
@Controller() | ||
export class TraceInitiatorController { | ||
constructor(private readonly traceInitiatorService: TraceInitiatorService) {} | ||
|
||
@Get('test-inbound-headers/:id') | ||
testInboundHeaders(@Headers() headers, @Param('id') id: string) { | ||
return this.traceInitiatorService.testInboundHeaders(headers, id); | ||
} | ||
|
||
@Get('test-outgoing-http/:id') | ||
async testOutgoingHttp(@Param('id') id: string) { | ||
return this.traceInitiatorService.testOutgoingHttp(id); | ||
} | ||
|
||
@Get('test-outgoing-fetch/:id') | ||
async testOutgoingFetch(@Param('id') id: string) { | ||
return this.traceInitiatorService.testOutgoingFetch(id); | ||
} | ||
|
||
@Get('test-outgoing-fetch-external-allowed') | ||
async testOutgoingFetchExternalAllowed() { | ||
return this.traceInitiatorService.testOutgoingFetchExternalAllowed(); | ||
} | ||
|
||
@Get('test-outgoing-fetch-external-disallowed') | ||
async testOutgoingFetchExternalDisallowed() { | ||
return this.traceInitiatorService.testOutgoingFetchExternalDisallowed(); | ||
} | ||
|
||
@Get('test-outgoing-http-external-allowed') | ||
async testOutgoingHttpExternalAllowed() { | ||
return this.traceInitiatorService.testOutgoingHttpExternalAllowed(); | ||
} | ||
|
||
@Get('test-outgoing-http-external-disallowed') | ||
async testOutgoingHttpExternalDisallowed() { | ||
return this.traceInitiatorService.testOutgoingHttpExternalDisallowed(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ages/e2e-tests/test-applications/nestjs-distributed-tracing/src/trace-initiator.module.ts
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,10 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TraceInitiatorController } from './trace-initiator.controller'; | ||
import { TraceInitiatorService } from './trace-initiator.service'; | ||
|
||
@Module({ | ||
imports: [], | ||
controllers: [TraceInitiatorController], | ||
providers: [TraceInitiatorService], | ||
}) | ||
export class TraceInitiatorModule {} |
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
17 changes: 17 additions & 0 deletions
17
...s/e2e-tests/test-applications/nestjs-distributed-tracing/src/trace-receiver.controller.ts
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,17 @@ | ||
import { Controller, Get, Headers } from '@nestjs/common'; | ||
import { TraceReceiverService } from './trace-receiver.service'; | ||
|
||
@Controller() | ||
export class TraceReceiverController { | ||
constructor(private readonly traceReceiverService: TraceReceiverService) {} | ||
|
||
@Get('external-allowed') | ||
externalAllowed(@Headers() headers) { | ||
return this.traceReceiverService.externalAllowed(headers); | ||
} | ||
|
||
@Get('external-disallowed') | ||
externalDisallowed(@Headers() headers) { | ||
return this.traceReceiverService.externalDisallowed(headers); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...kages/e2e-tests/test-applications/nestjs-distributed-tracing/src/trace-receiver.module.ts
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,10 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TraceReceiverController } from './trace-receiver.controller'; | ||
import { TraceReceiverService } from './trace-receiver.service'; | ||
|
||
@Module({ | ||
imports: [], | ||
controllers: [TraceReceiverController], | ||
providers: [TraceReceiverService], | ||
}) | ||
export class TraceReceiverModule {} |
18 changes: 18 additions & 0 deletions
18
...ages/e2e-tests/test-applications/nestjs-distributed-tracing/src/trace-receiver.service.ts
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,18 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
@Injectable() | ||
export class TraceReceiverService { | ||
externalAllowed(headers: Record<string, string>) { | ||
return { | ||
headers, | ||
route: 'external-allowed', | ||
}; | ||
} | ||
|
||
externalDisallowed(headers: Record<string, string>) { | ||
return { | ||
headers, | ||
route: 'external-disallowed', | ||
}; | ||
} | ||
} |
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