feat(config): 🧑‍💻 Add custom tracing URL support to Sentry config

This commit is contained in:
Jesse Wierzbinski 2024-07-26 00:02:48 +02:00
parent 7d1522cc1e
commit bc25896ed8
No known key found for this signature in database
6 changed files with 18 additions and 1 deletions

View file

@ -62,6 +62,8 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GIT_COMMIT=$(git rev-parse --short "$GITHUB_SHA")
provenance: mode=max
sbom: true
platforms: linux/amd64,linux/arm64

View file

@ -19,6 +19,11 @@ RUN mkdir -p /temp
COPY . /temp
# Copy dependencies
COPY --from=install /temp/node_modules /temp/node_modules
# Set current Git commit hash as an environment variable
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
# Build the project
WORKDIR /temp
RUN bun run build

View file

@ -3900,6 +3900,13 @@
"maximum": 1,
"default": 1
},
"trace_propagation_targets": {
"type": "array",
"items": {
"type": "string"
},
"default": []
},
"max_breadcrumbs": {
"type": "number",
"default": 100

View file

@ -37,6 +37,7 @@
"wc": "find server database *.ts docs packages types utils drizzle tests -type f -print0 | wc -m --files0-from=-",
"cli": "bun run cli/index.ts",
"prune": "ts-prune | grep -v server/ | grep -v dist/ | grep -v '(used in module)'",
"schema:generate": "bun run packages/config-manager/json-schema.ts > config/config.schema.json",
"check": "bunx tsc -p .",
"prepare": "bunx husky"
},

View file

@ -575,6 +575,7 @@ export const configValidator = z.object({
debug: z.boolean().default(false),
sample_rate: z.number().min(0).max(1.0).default(1.0),
traces_sample_rate: z.number().min(0).max(1.0).default(1.0),
trace_propagation_targets: z.array(z.string()).default([]),
max_breadcrumbs: z.number().default(100),
environment: z.string().optional(),
})

View file

@ -11,7 +11,8 @@ const sentryInstance =
maxBreadcrumbs: config.logging.sentry.max_breadcrumbs,
tracesSampleRate: config.logging.sentry.traces_sample_rate,
environment: config.logging.sentry.environment,
tracePropagationTargets: [config.http.bind],
tracePropagationTargets:
config.logging.sentry.trace_propagation_targets,
release: pkg.version,
});