Skip to content

Commit 5750f35

Browse files
authored
Shared queue consumer telemetry improvements and perf changes (#1619)
* Shared queue consumer telemetry improvements * findUnique -> findFirst to stop the prisma dataloader issue on api key auth * Added action stats, audited all actions and improved reasons * Better debug logging filtering
1 parent 11f2832 commit 5750f35

File tree

6 files changed

+1085
-652
lines changed

6 files changed

+1085
-652
lines changed

apps/webapp/app/env.server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ const EnvironmentSchema = z.object({
190190

191191
// Internal OTEL environment variables
192192
INTERNAL_OTEL_TRACE_EXPORTER_URL: z.string().optional(),
193-
INTERNAL_OTEL_TRACE_EXPORTER_AUTH_HEADER_NAME: z.string().optional(),
194-
INTERNAL_OTEL_TRACE_EXPORTER_AUTH_HEADER_VALUE: z.string().optional(),
193+
INTERNAL_OTEL_TRACE_EXPORTER_AUTH_HEADERS: z.string().optional(),
195194
INTERNAL_OTEL_TRACE_LOGGING_ENABLED: z.string().default("1"),
196195
// this means 1/20 traces or 5% of traces will be sampled (sampled = recorded)
197196
INTERNAL_OTEL_TRACE_SAMPLING_RATE: z.string().default("20"),

apps/webapp/app/models/runtimeEnvironment.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getUsername } from "~/utils/username";
55
export type { RuntimeEnvironment };
66

77
export async function findEnvironmentByApiKey(apiKey: string) {
8-
const environment = await prisma.runtimeEnvironment.findUnique({
8+
const environment = await prisma.runtimeEnvironment.findFirst({
99
where: {
1010
apiKey,
1111
},
@@ -25,7 +25,7 @@ export async function findEnvironmentByApiKey(apiKey: string) {
2525
}
2626

2727
export async function findEnvironmentByPublicApiKey(apiKey: string) {
28-
const environment = await prisma.runtimeEnvironment.findUnique({
28+
const environment = await prisma.runtimeEnvironment.findFirst({
2929
where: {
3030
pkApiKey: apiKey,
3131
},
@@ -45,7 +45,7 @@ export async function findEnvironmentByPublicApiKey(apiKey: string) {
4545
}
4646

4747
export async function findEnvironmentById(id: string) {
48-
const environment = await prisma.runtimeEnvironment.findUnique({
48+
const environment = await prisma.runtimeEnvironment.findFirst({
4949
where: {
5050
id,
5151
},
@@ -85,7 +85,7 @@ export async function createNewSession(environment: RuntimeEnvironment, ipAddres
8585
}
8686

8787
export async function disconnectSession(environmentId: string) {
88-
const environment = await prisma.runtimeEnvironment.findUnique({
88+
const environment = await prisma.runtimeEnvironment.findFirst({
8989
where: {
9090
id: environmentId,
9191
},

apps/webapp/app/v3/marqs/devQueueConsumer.server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ export class DevQueueConsumer {
280280
kind: SpanKind.CONSUMER,
281281
attributes: {
282282
...attributesFromAuthenticatedEnv(this.env),
283-
[SEMINTATTRS_FORCE_RECORDING]: true,
284283
},
285284
},
286285
ROOT_CONTEXT

0 commit comments

Comments
 (0)