Skip to content

Commit 53eacfd

Browse files
authored
Add query and mutation prefixes when reporting Open Telemetry spans (#9701)
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
1 parent 2ec5140 commit 53eacfd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

packages/core/src/lib/core/mutations/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ export function getMutationsForList(list: InitialisedList) {
691691
},
692692
async resolve(_, { data }, context, info) {
693693
return await withSpan(
694-
info.fieldName,
694+
`mutation ${info.fieldName}`,
695695
async () => {
696696
return createOne(data, list, context)
697697
},
@@ -709,7 +709,7 @@ export function getMutationsForList(list: InitialisedList) {
709709
},
710710
async resolve(_, { data }, context, info) {
711711
return await withSpan(
712-
info.fieldName,
712+
`mutation ${info.fieldName}`,
713713
async () => {
714714
return promisesButSettledWhenAllSettledAndInOrder(await createMany(data, list, context))
715715
},
@@ -729,7 +729,7 @@ export function getMutationsForList(list: InitialisedList) {
729729
},
730730
async resolve(_, { where, data }, context, info) {
731731
return await withSpan(
732-
info.fieldName,
732+
`mutation ${info.fieldName}`,
733733
async () => {
734734
return updateOne({ where, data }, list, context)
735735
},
@@ -757,7 +757,7 @@ export function getMutationsForList(list: InitialisedList) {
757757
},
758758
async resolve(_, { data }, context, info) {
759759
return await withSpan(
760-
info.fieldName,
760+
`mutation ${info.fieldName}`,
761761
async () => {
762762
return promisesButSettledWhenAllSettledAndInOrder(await updateMany(data, list, context))
763763
},
@@ -776,7 +776,7 @@ export function getMutationsForList(list: InitialisedList) {
776776
},
777777
async resolve(_, { where }, context, info) {
778778
return await withSpan(
779-
info.fieldName,
779+
`mutation ${info.fieldName}`,
780780
async () => {
781781
return deleteOne(where, list, context)
782782
},
@@ -794,7 +794,7 @@ export function getMutationsForList(list: InitialisedList) {
794794
},
795795
async resolve(_, { where }, context, info) {
796796
return await withSpan(
797-
info.fieldName,
797+
`mutation ${info.fieldName}`,
798798
async () => {
799799
return promisesButSettledWhenAllSettledAndInOrder(await deleteMany(where, list, context))
800800
},
@@ -867,7 +867,7 @@ export function getMutationsForList(list: InitialisedList) {
867867
},
868868
async resolve(_, { where }, context, info) {
869869
return await withSpan(
870-
info.fieldName,
870+
`mutation ${info.fieldName}`,
871871
async () => {
872872
return actionOne(where, list, context, action)
873873
},
@@ -887,7 +887,7 @@ export function getMutationsForList(list: InitialisedList) {
887887
},
888888
async resolve(_, { where }, context, info) {
889889
return await withSpan(
890-
info.fieldName,
890+
`mutation ${info.fieldName}`,
891891
async () => {
892892
return promisesButSettledWhenAllSettledAndInOrder(
893893
await actionMany(where, list, context, action)

packages/core/src/lib/core/queries/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function getQueriesForList(list: InitialisedList) {
1616
},
1717
async resolve(_, args, context, info) {
1818
return await withSpan(
19-
info.fieldName,
19+
`query ${info.fieldName}`,
2020
async () => {
2121
return queries.findOne(args, list, context, info)
2222
},
@@ -30,7 +30,7 @@ export function getQueriesForList(list: InitialisedList) {
3030
args: list.graphql.types.findManyArgs,
3131
async resolve(_, args, context, info) {
3232
return await withSpan(
33-
info.fieldName,
33+
`query ${info.fieldName}`,
3434
async () => {
3535
return queries.findMany(args, list, context, info)
3636
},
@@ -49,7 +49,7 @@ export function getQueriesForList(list: InitialisedList) {
4949
},
5050
async resolve(_, args, context, info) {
5151
return await withSpan(
52-
info.fieldName,
52+
`query ${info.fieldName}`,
5353
async () => {
5454
return queries.count(args, list, context, info)
5555
},

0 commit comments

Comments
 (0)