Skip to content

Commit

Permalink
DEVPROD-5599: Update Honeycomb Trace link end time (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
SupaJoon authored Mar 28, 2024
1 parent 6b6efcb commit c825a39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/spruce/src/constants/externalResources.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("getParsleyBuildLogURL", () => {
});
});

describe("getTaskTraceUrl", () => {
describe("getHoneycombTraceUrl", () => {
it("generates the correct url", () => {
expect(
getHoneycombTraceUrl(
Expand All @@ -28,7 +28,7 @@ describe("getTaskTraceUrl", () => {
new Date("2023-07-07T19:09:00"),
),
).toBe(
"/datasets/evergreen-agent/trace?trace_id=abcdef&trace_start_ts=1688756921&trace_end_ts=1688756940",
"/datasets/evergreen-agent/trace?trace_id=abcdef&trace_start_ts=1688756921&trace_end_ts=1688756941",
);
});
});
Expand Down
11 changes: 9 additions & 2 deletions apps/spruce/src/constants/externalResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,21 @@ export const getParsleyTestLogURL = (buildId: string, testId: string) =>
export const getParsleyBuildLogURL = (buildId: string) =>
`${getParsleyUrl()}/resmoke/${buildId}/all`;

/**
* Generates a URL for accessing a trace in the Honeycomb dashboard.
* @param traceId - The ID of the trace.
* @param startTs - The start timestamp of the trace. Note that this timestamp is truncated to the nearest second.
* @param endTs - The end timestamp of the trace. Note that this timestamp is rounded up to the nearest second.
* @returns The URL for accessing the trace in the Honeycomb dashboard.
*/
export const getHoneycombTraceUrl = (
traceId: string,
startTs: Date,
endTs: Date,
) =>
): string =>
`${getHoneycombBaseURL()}/datasets/evergreen-agent/trace?trace_id=${traceId}&trace_start_ts=${getUnixTime(
new Date(startTs),
)}&trace_end_ts=${getUnixTime(new Date(endTs))}`;
)}&trace_end_ts=${getUnixTime(new Date(endTs)) + 1}`;

export const getHoneycombSystemMetricsUrl = (
taskId: string,
Expand Down

0 comments on commit c825a39

Please sign in to comment.