Skip to content

Commit 6579389

Browse files
committed
[chore] Upgrade to ingestor trifrost
1 parent ccf81a1 commit 6579389

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/index.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { App, Security, Cors, ConsoleExporter, JsonExporter, OtelHttpExporter, isDevMode } from '@trifrost/core';
1+
import {
2+
App,
3+
Security,
4+
Cors,
5+
ConsoleExporter,
6+
JsonExporter,
7+
OtelHttpExporter,
8+
isDevMode,
9+
} from '@trifrost/core';
210
import { css } from './css';
311
import { script } from './script';
412
import { type Env } from './types';
@@ -9,15 +17,16 @@ import { errorHandler } from './routes/error';
917
const app = await new App<Env>({
1018
client: { css, script },
1119
tracing: {
12-
exporters: ({env}) => {
13-
if (isDevMode(env)) return [new ConsoleExporter()];
20+
exporters: ({ env }) => {
21+
if (isDevMode(env)) return new ConsoleExporter();
1422
return [
1523
new JsonExporter(),
1624
new OtelHttpExporter({
17-
logEndpoint: 'https://otlp.uptrace.dev/v1/logs',
18-
spanEndpoint: 'https://otlp.uptrace.dev/v1/traces',
25+
logEndpoint: 'https://ingest.trifrost.dev/v1/ingest/otel',
26+
spanEndpoint: 'https://ingest.trifrost.dev/v1/ingest/otel',
1927
headers: {
20-
'uptrace-dsn': env.UPTRACE_DSN,
28+
'x-ingest-key': env.TRIFROST_INGESTOR_KEY,
29+
'x-ingest-client': env.TRIFROST_INGESTOR_CLIENT,
2130
},
2231
}),
2332
];

src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export type Env = {
66
* @see https://www.trifrost.dev/docs/context-state-management#type-safe-context-definitions
77
*/
88
ASSETS: Fetcher;
9-
UPTRACE_DSN: string;
9+
TRIFROST_INGESTOR_KEY: string;
10+
TRIFROST_INGESTOR_CLIENT: string;
1011
};
1112

1213
export type Context<State extends Record<string, unknown> = {}> =

0 commit comments

Comments
 (0)