Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ jobs:
generate-client-and-cli-install,
generate-client-install,
generate-client-install-on-sub-project,
tracing,
]
clientEngine: ['library', 'binary']
os: [ubuntu-latest] #, windows-latest, macos-latest]
Expand Down
5 changes: 5 additions & 0 deletions core-features/tracing/README.md
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.
26 changes: 26 additions & 0 deletions core-features/tracing/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// enable Otel tracing in this app
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()
18 changes: 18 additions & 0 deletions core-features/tracing/docker-compose.yml
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
5 changes: 5 additions & 0 deletions core-features/tracing/finally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -eux

lsof -ti tcp:4000 | xargs kill
Loading