Skip to content

Commit eec90b9

Browse files
authored
add pg option to turn off attributes (#32)
## Summary Updates the `@highlight-run/node` SDK per customer request. Allow customers to control `pg` instrumentation via new setting. Fix express.js middleware handler incorrectly representing the end of an API request. Update dependency definition to correctly reference option types from `highlight.run` ## How did you test this change? spans showing correct duration <img width="1518" alt="Screenshot 2025-05-14 at 00 39 24" src="https://github.com/user-attachments/assets/f6261ffd-dd6a-4f10-b2e5-a8475f341ae0" /> <img width="1319" alt="Screenshot 2025-05-14 at 00 39 48" src="https://github.com/user-attachments/assets/504a413e-8f07-4f6e-8692-ec1456eb0599" /> <img width="441" alt="Screenshot 2025-05-14 at 00 55 41" src="https://github.com/user-attachments/assets/1c45e65a-6196-4048-9dff-428ee05e0791" /> with the `disablePgInstrumentationAttributes` setting off <img width="1347" alt="Screenshot 2025-05-14 at 00 57 23" src="https://github.com/user-attachments/assets/b875e191-660e-451f-84ba-b5ad4cc63a5f" /> ## Are there any deployment considerations? <!-- Backend - Do we need to consider migrations or backfilling data? --> ## Does this work require review from our design team? <!-- Request review from julian-highlight / our design team -->
1 parent 55b0538 commit eec90b9

File tree

16 files changed

+398
-316
lines changed

16 files changed

+398
-316
lines changed

e2e/nextjs/src/app/api/app-router-test/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { withAppRouterHighlight } from '@/app/_utils/app-router-highlight.config'
33
import logger from '@/highlight.logger'
44
import { statfsSync } from 'node:fs'
5-
import { Client } from 'pg'
65
import { z } from 'zod'
76

87
export const GET = withAppRouterHighlight(async function GET(request: Request) {
@@ -16,6 +15,8 @@ export const GET = withAppRouterHighlight(async function GET(request: Request) {
1615
if (sql === 'true') {
1716
try {
1817
console.info('😇 Connecting to Postgres...')
18+
const { Client } = await import('pg')
19+
1920
const pgClient = new Client({
2021
user: 'postgres',
2122
database: 'postgres',

e2e/nextjs/src/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const highlightConfig = {
99
environment: 'e2e-test',
1010
enableFsInstrumentation: true,
1111
disableConsoleRecording: false,
12-
debug: false,
12+
disablePgInstrumentationAttributes: false,
1313
} as NodeOptions
1414

1515
export async function register() {

0 commit comments

Comments
 (0)