Skip to content

Commit

Permalink
fixed root span starttime to use run_started_at instead of created_at
Browse files Browse the repository at this point in the history
  • Loading branch information
nikordaris committed May 4, 2022
1 parent c6f3c55 commit 0bd92b9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ const step_1 = __nccwpck_require__(9431);
async function traceWorkflowRunJobs({ provider, workflowRunJobs, }) {
var _a, _b, _c, _d, _e, _f, _g;
const tracer = provider.getTracer("otel-export-trace");
const startTime = new Date(workflowRunJobs.workflowRun.created_at);
const startTime = new Date(workflowRunJobs.workflowRun.run_started_at ||
workflowRunJobs.workflowRun.created_at);
let headRef = undefined;
let baseRef = undefined;
let baseSha = undefined;
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "otel-export-trace",
"version": "1.5.7",
"version": "1.5.8",
"description": "Github Action to export Open Telemetry traces for Workflow runs",
"main": "lib/index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/tracing/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export async function traceWorkflowRunJobs({
}: TraceWorkflowRunJobsParams): Promise<SpanContext> {
const tracer = provider.getTracer("otel-export-trace");

const startTime = new Date(workflowRunJobs.workflowRun.created_at);
const startTime = new Date(
workflowRunJobs.workflowRun.run_started_at ||
workflowRunJobs.workflowRun.created_at
);
let headRef = undefined;
let baseRef = undefined;
let baseSha = undefined;
Expand Down

0 comments on commit 0bd92b9

Please sign in to comment.