Skip to content

Commit

Permalink
fix: set otel url on web build
Browse files Browse the repository at this point in the history
  • Loading branch information
sprutton1 committed Aug 19, 2024
1 parent 5c20684 commit 98f6068
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
- name: Build
if: ${{ inputs.service == 'web' }}
working-directory: app/web
env:
VITE_OTEL_EXPORTER_OTLP_ENDPOINT: ${{ env.VITE_SI_WORKSPACE_URL }}
run: pnpm run build

- name: Deploy
Expand Down
2 changes: 1 addition & 1 deletion app/web/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const { envVariables } = getProjectEnvVariables();
let otelEndpoint =
envVariables.VITE_OTEL_EXPORTER_OTLP_ENDPOINT ??
import.meta.env.VITE_OTEL_EXPORTER_OTLP_ENDPOINT;
if (!otelEndpoint) otelEndpoint = window.location.host;
if (!otelEndpoint) otelEndpoint = window.location.hostname;
const sdk = new HoneycombWebSDK({
endpoint: `${otelEndpoint}/v1/traces`,
serviceName: "si-vue",
Expand Down

0 comments on commit 98f6068

Please sign in to comment.