Skip to content

Commit 71d43a0

Browse files
committed
chore: rename breadcrumbs category
1 parent 18f14eb commit 71d43a0

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ if (process.env.HAWK_CATCHER_TOKEN) {
88
HawkCatcher.init({
99
token: process.env.HAWK_CATCHER_TOKEN,
1010
release: `${name}-${version}`,
11+
breadcrumbs: {
12+
maxBreadcrumbs: 100
13+
}
1114
});
1215
}
1316

src/metrics/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const graphqlMetricsPlugin: ApolloServerPlugin = {
8282

8383
HawkCatcher.breadcrumbs.add({
8484
type: 'request',
85-
category: 'gql',
85+
category: 'GraphQL Operation',
8686
message: `${operationType} ${operationName} ${durationMs}ms${hasErrors ? ` [${ctx.errors!.length} error(s)]` : ''}`,
8787
level: hasErrors ? 'error' : 'debug',
8888
data: {

src/metrics/mongodb.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export function setupMongoMetrics(client: MongoClient): void {
309309

310310
HawkCatcher.breadcrumbs.add({
311311
type: 'request',
312-
category: 'db.query',
312+
category: 'MongoDB Operation',
313313
message: `${metadata.db}.${metadata.collectionFamily}.${metadata.commandName} ${event.duration}ms`,
314314
level: 'debug',
315315
data: {
@@ -355,7 +355,7 @@ export function setupMongoMetrics(client: MongoClient): void {
355355

356356
HawkCatcher.breadcrumbs.add({
357357
type: 'error',
358-
category: 'db.query',
358+
category: 'MongoDB operation',
359359
message: `${metadata.db}.${metadata.collectionFamily}.${metadata.commandName} FAILED: ${errorMsg} ${event.duration}ms`,
360360
level: 'error',
361361
data: {

src/rabbitmq.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export async function publish(exchange: string, route: string, message: string,
135135
await channel.publish(exchange, route, Buffer.from(message), options);
136136
HawkCatcher.breadcrumbs.add({
137137
type: 'request',
138-
category: 'amqp.publish',
138+
category: 'RabbitMQ Operation',
139139
message: `AMQP publish ${exchange || '(default)'}/${route}`,
140140
level: 'debug',
141141
data: {
@@ -147,7 +147,7 @@ export async function publish(exchange: string, route: string, message: string,
147147
} catch (err) {
148148
HawkCatcher.breadcrumbs.add({
149149
type: 'error',
150-
category: 'amqp.publish',
150+
category: 'RabbitMQ Operation',
151151
message: `AMQP publish FAILED ${exchange || '(default)'}/${route}: ${(err as Error).message}`,
152152
level: 'error',
153153
data: {

0 commit comments

Comments
 (0)