Skip to content

Commit

Permalink
fix(gatsby): Fix tracing for createPages (#35795)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jun 1, 2022
1 parent 625b141 commit 4c180eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/gatsby/src/services/create-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { actions } from "../redux/actions"
import { deleteUntouchedPages, findChangedPages } from "../utils/changed-pages"
import { getDataStore } from "../datastore"

const isInitialCreatePages = true
let createPagesCount = 0
export async function createPages({
parentSpan,
gatsbyNodeGraphQLFunction,
Expand Down Expand Up @@ -44,11 +46,15 @@ export async function createPages({
return returnValue
}

createPagesCount += 1
const traceId = isInitialCreatePages
? `initial-createPages`
: `createPages #${createPagesCount}`
await apiRunnerNode(
`createPages`,
{
graphql: wrappedGraphQL,
traceId: `initial-createPages`,
traceId,
waitForCascadingActions: true,
parentSpan: activity.span,
deferNodeMutation,
Expand Down

0 comments on commit 4c180eb

Please sign in to comment.