Skip to content

Commit b72b406

Browse files
authored
Merge pull request #291 from cardanoapi/feat/apm-trace-correlation
Add traceparent header support for APM
2 parents 075ec05 + df6a8ff commit b72b406

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dbsync-api/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const dynamicCors = (req:Request, res:Response, next:any) => {
2626
// Allow requests from any origin but with credentials
2727
res.header('Access-Control-Allow-Origin', origin || '*');
2828
res.header('Access-Control-Allow-Methods', 'GET,HEAD,PUT,PATCH,POST,DELETE');
29-
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
29+
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Tracestate, Traceparent');
3030
res.header('Access-Control-Allow-Credentials', 'true');
3131

3232
// Handle preflight requests

frontend/src/app/layout.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,15 @@ function embedApmScript() {
116116
environment: environments.IS_IN_PRODUCTION_MODE
117117
? environments.network
118118
: 'local',
119-
serverUrlPrefix: '/status'
119+
serverUrlPrefix: '/status',
120+
breakdownMetrics: true,
121+
propagateTracestate: true,
122+
distributedTracingOrigins: [
123+
"https://sanchonet.api.agents.cardanoapi.io",
124+
"https://api.agents.cardanoapi.io",
125+
"https://preprod.api.agents.cardanoapi.io",
126+
"https://preview.api.agents.cardanoapi.io"
127+
],
120128
};
121129
const htmlStr = 'elasticApm.init(' + JSON.stringify(config) + ')';
122130
return process.env.NEXT_PUBLIC_APM_ENABLED ? (

0 commit comments

Comments
 (0)