Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/option-runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { isOtelActive, setupOtel } from "../src/setup";
import { withSpan as withMainSpan } from "../src/with-span";

const ENDPOINT = "http://collector.internal:4318";
const API_KEY_ID = "pho_sk_01h455vb4pex5vsknk084sn02s";
const TRACEPARENT_HEADER = "photon-developer-traceparent";
const SPAN_ID_PATTERN = /^[0-9a-f]{16}$/u;
const TRACE_ID_PATTERN = /^[0-9a-f]{32}$/u;
Expand Down Expand Up @@ -168,7 +169,7 @@ describe("option runtime", () => {
await runtime.withActiveSpan(
"developer.http",
{
attributes: { "photon.api_key.id": "pho_sk_test" },
attributes: { "photon.api_key.id": API_KEY_ID },
kind: SpanKind.SERVER,
parentContext: ROOT_CONTEXT,
},
Expand All @@ -181,7 +182,7 @@ describe("option runtime", () => {
const [server] = spanExporter.getFinishedSpans();
expect(server?.kind).toBe(SpanKind.SERVER);
expect(server?.parentSpanContext).toBeUndefined();
expect(server?.attributes["photon.api_key.id"]).toBe("pho_sk_test");
expect(server?.attributes["photon.api_key.id"]).toBe(API_KEY_ID);
expect(callbackSpanId).toBe(server?.spanContext().spanId);
await runtime.shutdown();
});
Expand Down
Loading