-
Notifications
You must be signed in to change notification settings - Fork 26
test: add tracing #2968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
danstarns
wants to merge
14
commits into
dev
Choose a base branch
from
tracing
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
test: add tracing #2968
Changes from 8 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e460672
test: add tracing
danstarns 7960a9b
docs: update
danstarns 3486474
refactor: bash updates
danstarns b8d76fb
test: snapshot remove versions
danstarns a081ac2
refactor: use postgre with env
danstarns 413fddf
package: remove supertest
danstarns 958a16e
Update core-features/tracing/prisma/schema.prisma
danstarns ea2338d
Update core-features/tracing/index.test.js
danstarns 094b516
Merge branch 'dev' into tracing
Jolg42 60ac254
Update core-features/tracing/app.js
danstarns 29c14f8
Merge branch 'dev' into tracing
danstarns 001ed2c
Update core-features/tracing/tracing.js
danstarns dd6c00f
test: update snapshot
danstarns 5c7051d
Merge branch 'dev' into tracing
janpio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,5 @@ | ||
# Tracing | ||
|
||
Tests that tracing works within another traced application. | ||
|
||
Spins up a fastify web server, performs a request against that server, and then asserts that those traces and Prisma traces are nested correctly within each other. |
This file contains hidden or 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,25 @@ | ||
require('./tracing') | ||
const Fastify = require('fastify') | ||
const { PrismaClient } = require('@prisma/client') | ||
|
||
const app = Fastify() | ||
app.register(require('fastify-express')) | ||
|
||
const prisma = new PrismaClient() | ||
|
||
app.get('/users', async (_, reply) => { | ||
const users = await prisma.user.findMany() | ||
|
||
reply.send(users) | ||
}) | ||
|
||
async function main() { | ||
try { | ||
await app.listen(4000) | ||
} catch (error) { | ||
console.log('error starting app') | ||
throw error | ||
} | ||
} | ||
|
||
main() |
This file contains hidden or 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 @@ | ||
version: '3' | ||
services: | ||
otel: | ||
image: jaegertracing/all-in-one:1.35 | ||
environment: | ||
COLLECTOR_OTLP_ENABLED: 'true' | ||
COLLECTOR_ZIPKIN_HOST_PORT: ':9411' | ||
ports: | ||
- 6831:6831/udp | ||
- 6832:6832/udp | ||
- 5778:5778 | ||
- 16686:16686 | ||
- 4317:4317 | ||
- 4318:4318 | ||
- 14250:14250 | ||
- 14268:14268 | ||
- 14269:14269 | ||
- 9411:9411 |
This file contains hidden or 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,5 @@ | ||
#!/bin/sh | ||
|
||
set -eux | ||
|
||
lsof -ti tcp:4000 | xargs kill |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.