You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -124,13 +106,13 @@ describe('postgresjs auto instrumentation', () => {
124
106
'db.namespace': 'test_db',
125
107
'db.system.name': 'postgres',
126
108
'db.operation.name': 'SELECT',
127
-
'db.query.text': `SELECT * FROM "User" WHERE "email" = ? AND "name" = ?`,
109
+
'db.query.text': 'SELECT * FROM "User" WHERE "email" = ? AND "name" = ?',
128
110
'sentry.op': 'db',
129
111
'sentry.origin': 'auto.db.postgresjs',
130
112
'server.address': 'localhost',
131
113
'server.port': 5444,
132
114
}),
133
-
description: `SELECT * FROM "User" WHERE "email" = ? AND "name" = ?`,
115
+
description: 'SELECT * FROM "User" WHERE "email" = ? AND "name" = ?',
134
116
op: 'db',
135
117
status: 'ok',
136
118
origin: 'auto.db.postgresjs',
@@ -342,13 +324,13 @@ describe('postgresjs auto instrumentation', () => {
342
324
'db.namespace': 'test_db',
343
325
'db.system.name': 'postgres',
344
326
'db.operation.name': 'SELECT',
345
-
'db.query.text': `SELECT * FROM "User" WHERE "email" = ? AND "name" = ?`,
327
+
'db.query.text': 'SELECT * FROM "User" WHERE "email" = ? AND "name" = ?',
346
328
'sentry.op': 'db',
347
329
'sentry.origin': 'auto.db.postgresjs',
348
330
'server.address': 'localhost',
349
331
'server.port': 5444,
350
332
}),
351
-
description: `SELECT * FROM "User" WHERE "email" = ? AND "name" = ?`,
333
+
description: 'SELECT * FROM "User" WHERE "email" = ? AND "name" = ?',
352
334
op: 'db',
353
335
status: 'ok',
354
336
origin: 'auto.db.postgresjs',
@@ -621,10 +603,72 @@ describe('postgresjs auto instrumentation', () => {
621
603
constEXPECTED_TRANSACTION={
622
604
transaction: 'Test Transaction',
623
605
spans: expect.arrayContaining([
624
-
createDbSpanMatcher('CREATE TABLE'),
625
-
createDbSpanMatcher('INSERT'),
626
-
createDbSpanMatcher('UPDATE'),
627
-
createDbSpanMatcher('SELECT'),
606
+
expect.objectContaining({
607
+
data: expect.objectContaining({
608
+
'db.namespace': 'test_db',
609
+
'db.system.name': 'postgres',
610
+
'db.operation.name': 'CREATE TABLE',
611
+
'db.query.text':
612
+
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
613
+
'sentry.op': 'db',
614
+
'sentry.origin': 'auto.db.postgresjs',
615
+
'server.address': 'localhost',
616
+
'server.port': 5444,
617
+
}),
618
+
description:
619
+
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
620
+
op: 'db',
621
+
status: 'ok',
622
+
origin: 'auto.db.postgresjs',
623
+
}),
624
+
expect.objectContaining({
625
+
data: expect.objectContaining({
626
+
'db.namespace': 'test_db',
627
+
'db.system.name': 'postgres',
628
+
'db.operation.name': 'INSERT',
629
+
'db.query.text': `INSERT INTO "User" ("email", "name") VALUES ('Foo', '${EXISTING_TEST_EMAIL}')`,
630
+
'sentry.op': 'db',
631
+
'sentry.origin': 'auto.db.postgresjs',
632
+
'server.address': 'localhost',
633
+
'server.port': 5444,
634
+
}),
635
+
description: `INSERT INTO "User" ("email", "name") VALUES ('Foo', '${EXISTING_TEST_EMAIL}')`,
636
+
op: 'db',
637
+
status: 'ok',
638
+
origin: 'auto.db.postgresjs',
639
+
}),
640
+
expect.objectContaining({
641
+
data: expect.objectContaining({
642
+
'db.namespace': 'test_db',
643
+
'db.system.name': 'postgres',
644
+
'db.operation.name': 'UPDATE',
645
+
'db.query.text': `UPDATE "User" SET "name" = 'Foo' WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
646
+
'sentry.op': 'db',
647
+
'sentry.origin': 'auto.db.postgresjs',
648
+
'server.address': 'localhost',
649
+
'server.port': 5444,
650
+
}),
651
+
description: `UPDATE "User" SET "name" = 'Foo' WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
652
+
op: 'db',
653
+
status: 'ok',
654
+
origin: 'auto.db.postgresjs',
655
+
}),
656
+
expect.objectContaining({
657
+
data: expect.objectContaining({
658
+
'db.namespace': 'test_db',
659
+
'db.system.name': 'postgres',
660
+
'db.operation.name': 'SELECT',
661
+
'db.query.text': `SELECT * FROM "User" WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
662
+
'sentry.op': 'db',
663
+
'sentry.origin': 'auto.db.postgresjs',
664
+
'server.address': 'localhost',
665
+
'server.port': 5444,
666
+
}),
667
+
description: `SELECT * FROM "User" WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
668
+
op: 'db',
669
+
status: 'ok',
670
+
origin: 'auto.db.postgresjs',
671
+
}),
628
672
]),
629
673
};
630
674
@@ -639,10 +683,72 @@ describe('postgresjs auto instrumentation', () => {
639
683
constEXPECTED_TRANSACTION={
640
684
transaction: 'Test Transaction',
641
685
spans: expect.arrayContaining([
642
-
createDbSpanMatcher('CREATE TABLE'),
643
-
createDbSpanMatcher('INSERT'),
644
-
createDbSpanMatcher('SELECT'),
645
-
createDbSpanMatcher('DELETE'),
686
+
expect.objectContaining({
687
+
data: expect.objectContaining({
688
+
'db.namespace': 'test_db',
689
+
'db.system.name': 'postgres',
690
+
'db.operation.name': 'CREATE TABLE',
691
+
'db.query.text':
692
+
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
693
+
'sentry.op': 'db',
694
+
'sentry.origin': 'auto.db.postgresjs',
695
+
'server.address': 'localhost',
696
+
'server.port': 5444,
697
+
}),
698
+
description:
699
+
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
700
+
op: 'db',
701
+
status: 'ok',
702
+
origin: 'auto.db.postgresjs',
703
+
}),
704
+
expect.objectContaining({
705
+
data: expect.objectContaining({
706
+
'db.namespace': 'test_db',
707
+
'db.system.name': 'postgres',
708
+
'db.operation.name': 'INSERT',
709
+
'db.query.text': `INSERT INTO "User" ("email", "name") VALUES ('Foo', '${EXISTING_TEST_EMAIL}')`,
710
+
'sentry.op': 'db',
711
+
'sentry.origin': 'auto.db.postgresjs',
712
+
'server.address': 'localhost',
713
+
'server.port': 5444,
714
+
}),
715
+
description: `INSERT INTO "User" ("email", "name") VALUES ('Foo', '${EXISTING_TEST_EMAIL}')`,
716
+
op: 'db',
717
+
status: 'ok',
718
+
origin: 'auto.db.postgresjs',
719
+
}),
720
+
expect.objectContaining({
721
+
data: expect.objectContaining({
722
+
'db.namespace': 'test_db',
723
+
'db.system.name': 'postgres',
724
+
'db.operation.name': 'SELECT',
725
+
'db.query.text': `SELECT * FROM "User" WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
726
+
'sentry.op': 'db',
727
+
'sentry.origin': 'auto.db.postgresjs',
728
+
'server.address': 'localhost',
729
+
'server.port': 5444,
730
+
}),
731
+
description: `SELECT * FROM "User" WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
732
+
op: 'db',
733
+
status: 'ok',
734
+
origin: 'auto.db.postgresjs',
735
+
}),
736
+
expect.objectContaining({
737
+
data: expect.objectContaining({
738
+
'db.namespace': 'test_db',
739
+
'db.system.name': 'postgres',
740
+
'db.operation.name': 'DELETE',
741
+
'db.query.text': `DELETE FROM "User" WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
742
+
'sentry.op': 'db',
743
+
'sentry.origin': 'auto.db.postgresjs',
744
+
'server.address': 'localhost',
745
+
'server.port': 5444,
746
+
}),
747
+
description: `DELETE FROM "User" WHERE "email" = '${EXISTING_TEST_EMAIL}'`,
748
+
op: 'db',
749
+
status: 'ok',
750
+
origin: 'auto.db.postgresjs',
751
+
}),
646
752
]),
647
753
};
648
754
@@ -658,10 +764,70 @@ describe('postgresjs auto instrumentation', () => {
658
764
constEXPECTED_TRANSACTION={
659
765
transaction: 'Test Transaction',
660
766
spans: expect.arrayContaining([
661
-
createDbSpanMatcher('CREATE TABLE'),
662
-
createDbSpanMatcher('INSERT'),
663
-
createDbSpanMatcher('SELECT'),
664
-
createDbSpanMatcher('DROP TABLE'),
767
+
expect.objectContaining({
768
+
data: expect.objectContaining({
769
+
'db.namespace': 'test_db',
770
+
'db.system.name': 'postgres',
771
+
'db.operation.name': 'CREATE TABLE',
772
+
'db.query.text': 'CREATE TABLE "User" ("id" SERIAL NOT NULL, "email" TEXT NOT NULL, PRIMARY KEY ("id"))',
773
+
'sentry.op': 'db',
774
+
'sentry.origin': 'auto.db.postgresjs',
775
+
'server.address': 'localhost',
776
+
'server.port': 5444,
777
+
}),
778
+
description: 'CREATE TABLE "User" ("id" SERIAL NOT NULL, "email" TEXT NOT NULL, PRIMARY KEY ("id"))',
779
+
op: 'db',
780
+
status: 'ok',
781
+
origin: 'auto.db.postgresjs',
782
+
}),
783
+
expect.objectContaining({
784
+
data: expect.objectContaining({
785
+
'db.namespace': 'test_db',
786
+
'db.system.name': 'postgres',
787
+
'db.operation.name': 'INSERT',
788
+
'db.query.text': 'INSERT INTO "User" ("email") VALUES (?)',
789
+
'sentry.op': 'db',
790
+
'sentry.origin': 'auto.db.postgresjs',
791
+
'server.address': 'localhost',
792
+
'server.port': 5444,
793
+
}),
794
+
description: 'INSERT INTO "User" ("email") VALUES (?)',
795
+
op: 'db',
796
+
status: 'ok',
797
+
origin: 'auto.db.postgresjs',
798
+
}),
799
+
expect.objectContaining({
800
+
data: expect.objectContaining({
801
+
'db.namespace': 'test_db',
802
+
'db.system.name': 'postgres',
803
+
'db.operation.name': 'SELECT',
804
+
'db.query.text': 'SELECT * FROM "User" WHERE "email" = ?',
805
+
'sentry.op': 'db',
806
+
'sentry.origin': 'auto.db.postgresjs',
807
+
'server.address': 'localhost',
808
+
'server.port': 5444,
809
+
}),
810
+
description: 'SELECT * FROM "User" WHERE "email" = ?',
811
+
op: 'db',
812
+
status: 'ok',
813
+
origin: 'auto.db.postgresjs',
814
+
}),
815
+
expect.objectContaining({
816
+
data: expect.objectContaining({
817
+
'db.namespace': 'test_db',
818
+
'db.system.name': 'postgres',
819
+
'db.operation.name': 'DROP TABLE',
820
+
'db.query.text': 'DROP TABLE "User"',
821
+
'sentry.op': 'db',
822
+
'sentry.origin': 'auto.db.postgresjs',
823
+
'server.address': 'localhost',
824
+
'server.port': 5444,
825
+
}),
826
+
description: 'DROP TABLE "User"',
827
+
op: 'db',
828
+
status: 'ok',
829
+
origin: 'auto.db.postgresjs',
830
+
}),
665
831
]),
666
832
};
667
833
@@ -676,10 +842,70 @@ describe('postgresjs auto instrumentation', () => {
676
842
constEXPECTED_TRANSACTION={
677
843
transaction: 'Test Transaction',
678
844
spans: expect.arrayContaining([
679
-
createDbSpanMatcher('CREATE TABLE'),
680
-
createDbSpanMatcher('INSERT'),
681
-
createDbSpanMatcher('SELECT'),
682
-
createDbSpanMatcher('DROP TABLE'),
845
+
expect.objectContaining({
846
+
data: expect.objectContaining({
847
+
'db.namespace': 'test_db',
848
+
'db.system.name': 'postgres',
849
+
'db.operation.name': 'CREATE TABLE',
850
+
'db.query.text': 'CREATE TABLE "User" ("id" SERIAL NOT NULL, "email" TEXT NOT NULL, PRIMARY KEY ("id"))',
851
+
'sentry.op': 'db',
852
+
'sentry.origin': 'auto.db.postgresjs',
853
+
'server.address': 'localhost',
854
+
'server.port': 5444,
855
+
}),
856
+
description: 'CREATE TABLE "User" ("id" SERIAL NOT NULL, "email" TEXT NOT NULL, PRIMARY KEY ("id"))',
857
+
op: 'db',
858
+
status: 'ok',
859
+
origin: 'auto.db.postgresjs',
860
+
}),
861
+
expect.objectContaining({
862
+
data: expect.objectContaining({
863
+
'db.namespace': 'test_db',
864
+
'db.system.name': 'postgres',
865
+
'db.operation.name': 'INSERT',
866
+
'db.query.text': 'INSERT INTO "User" ("email") VALUES (?)',
867
+
'sentry.op': 'db',
868
+
'sentry.origin': 'auto.db.postgresjs',
869
+
'server.address': 'localhost',
870
+
'server.port': 5444,
871
+
}),
872
+
description: 'INSERT INTO "User" ("email") VALUES (?)',
873
+
op: 'db',
874
+
status: 'ok',
875
+
origin: 'auto.db.postgresjs',
876
+
}),
877
+
expect.objectContaining({
878
+
data: expect.objectContaining({
879
+
'db.namespace': 'test_db',
880
+
'db.system.name': 'postgres',
881
+
'db.operation.name': 'SELECT',
882
+
'db.query.text': 'SELECT * FROM "User" WHERE "email" = ?',
883
+
'sentry.op': 'db',
884
+
'sentry.origin': 'auto.db.postgresjs',
885
+
'server.address': 'localhost',
886
+
'server.port': 5444,
887
+
}),
888
+
description: 'SELECT * FROM "User" WHERE "email" = ?',
0 commit comments