Skip to content
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

feature(frontend): adding synthetic attribute flag to FE instrumentation #631

Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN npm run build

FROM node:18-alpine AS runner
WORKDIR /app
RUN apk add --no-cache protoc
RUN apk add --no-cache protobuf-dev protoc
puckpuck marked this conversation as resolved.
Show resolved Hide resolved

ENV NODE_ENV=production

Expand Down
3 changes: 3 additions & 0 deletions src/frontend/utils/telemetry/FrontendTracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const FrontendTracer = async (collectorString: string) => {
'@opentelemetry/instrumentation-fetch': {
propagateTraceHeaderCorsUrls: /.*/,
clearTimingResources: true,
applyCustomAttributesOnSpan(span) {
puckpuck marked this conversation as resolved.
Show resolved Hide resolved
span.setAttribute('app.synthetic_request', 'false');
},
},
}),
],
Expand Down
18 changes: 12 additions & 6 deletions src/frontend/utils/telemetry/Instrumentation.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const opentelemetry = require("@opentelemetry/sdk-node")
const { getNodeAutoInstrumentations } = require("@opentelemetry/auto-instrumentations-node")
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc')
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc');

const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter(),
instrumentations: [ getNodeAutoInstrumentations() ]
})
instrumentations: [
getNodeAutoInstrumentations({
'@opentelemetry/instrumentation-fs': {
puckpuck marked this conversation as resolved.
Show resolved Hide resolved
enabled: false,
},
}),
],
});

sdk.start()
sdk.start();