Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseRFelix committed Aug 13, 2024
1 parent c0f3f73 commit b483989
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 47 deletions.
6 changes: 3 additions & 3 deletions packages/web/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { registerOTel } from "@vercel/otel";

import { getOpentelemetryServiceName } from "~/utils/service-name";

export function register() {
registerOTel({
serviceName:
process.env.NEXT_PUBLIC_VERCEL_URL ??
"fallback-osmosis-frontend-service-name",
serviceName: getOpentelemetryServiceName(),
instrumentationConfig: {
fetch: {
propagateContextUrls: ["*"],
Expand Down
9 changes: 3 additions & 6 deletions packages/web/server/api/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { type CreateNextContextOptions } from "@trpc/server/adapters/next";

import { AssetLists } from "~/config/generated/asset-lists";
import { ChainList } from "~/config/generated/chain-list";
import { getOpentelemetryServiceName } from "~/utils/service-name";

/** tRPC context for Next.js endpoints. */
export const createNextTrpcContext = (_opts: CreateNextContextOptions) => {
return createInnerTRPCContext({
assetLists: AssetLists,
chainList: ChainList,
opentelemetryServiceName:
process.env.NEXT_PUBLIC_VERCEL_URL ??
"fallback-osmosis-frontend-service-name",
opentelemetryServiceName: getOpentelemetryServiceName(),
});
};

Expand All @@ -21,8 +20,6 @@ export const createEdgeTrpcContext = (_opts: FetchCreateContextFnOptions) => {
return createInnerTRPCContext({
assetLists: AssetLists,
chainList: ChainList,
opentelemetryServiceName:
process.env.NEXT_PUBLIC_VERCEL_URL ??
"fallback-osmosis-frontend-service-name",
opentelemetryServiceName: getOpentelemetryServiceName(),
});
};
17 changes: 0 additions & 17 deletions packages/web/utils/__tests__/sentry-init.spec.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/web/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createServerSideHelpers } from "@trpc/react-query/server";
import { AssetLists } from "~/config/generated/asset-lists";
import { ChainList } from "~/config/generated/chain-list";
import { appRouter } from "~/server/api/root-router";
import { getOpentelemetryServiceName } from "~/utils/service-name";

/**
* tRPC helpers for SSR queries, useful for data prefetching
Expand All @@ -13,6 +14,7 @@ export const trpcHelpers = createServerSideHelpers({
ctx: {
assetLists: AssetLists,
chainList: ChainList,
opentelemetryServiceName: getOpentelemetryServiceName(),
},
transformer: superjson,
});
21 changes: 0 additions & 21 deletions packages/web/utils/sentry-init.ts

This file was deleted.

6 changes: 6 additions & 0 deletions packages/web/utils/service-name.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function getOpentelemetryServiceName(): string {
return (
process.env.NEXT_PUBLIC_VERCEL_URL ??
"fallback-osmosis-frontend-service-name"
);
}

0 comments on commit b483989

Please sign in to comment.