Commit 4b3a3b6
committed
fix(instrumentation): preserve ESM export aliases (#9436)
Named ESM imports could retain the original function because IITM only replaced the default binding after instrumentation. Preserve aliases that reference the original default export and synchronize patched builtin exports so every supported import form observes instrumentation.1 parent 50dbd17 commit 4b3a3b6
89 files changed
Lines changed: 1015 additions & 510 deletions
File tree
- .github
- integration-tests
- helpers
- packages
- datadog-instrumentations
- src
- helpers
- test/helpers
- datadog-plugin-ai/test/integration-test
- datadog-plugin-amqp10/test/integration-test
- datadog-plugin-amqplib/test/integration-test
- datadog-plugin-anthropic/test/integration-test
- datadog-plugin-aws-durable-execution-sdk-js/test/integration-test
- datadog-plugin-aws-sdk/test/integration-test
- datadog-plugin-axios/test/integration-test
- datadog-plugin-azure-cosmos/test/integration-test
- datadog-plugin-azure-event-hubs/test/integration-test/core-test
- datadog-plugin-azure-service-bus/test/integration-test/core-test
- datadog-plugin-body-parser/test/integration-test
- datadog-plugin-bullmq/test/integration-test
- datadog-plugin-bunyan/test/integration-test
- datadog-plugin-cassandra-driver/test/integration-test
- datadog-plugin-claude-agent-sdk/test/integration-test
- datadog-plugin-confluentinc-kafka-javascript/test/integration-test
- datadog-plugin-connect/test/integration-test
- datadog-plugin-cookie-parser/test/integration-test
- datadog-plugin-cookie/test/integration-test
- datadog-plugin-couchbase/test/integration-test
- datadog-plugin-crypto/test/integration-test
- datadog-plugin-dns/test/integration-test
- datadog-plugin-elasticsearch/test/integration-test
- datadog-plugin-express-mongo-sanitize/test/integration-test
- datadog-plugin-express-session/test/integration-test
- datadog-plugin-express/test/integration-test
- datadog-plugin-fastify/test/integration-test
- datadog-plugin-generic-pool/test/integration-test
- datadog-plugin-google-cloud-pubsub/test/integration-test
- datadog-plugin-google-cloud-vertexai/test/integration-test
- datadog-plugin-google-genai/test/integration-test
- datadog-plugin-graphql/test/integration-test
- datadog-plugin-grpc/test/integration-test
- datadog-plugin-handlebars/test/integration-test
- datadog-plugin-hapi/test/integration-test
- datadog-plugin-hono/test/integration-test
- datadog-plugin-http2/test/integration-test
- datadog-plugin-http/test/integration-test
- datadog-plugin-ioredis/test/integration-test
- datadog-plugin-iovalkey/test/integration-test
- datadog-plugin-kafkajs/test/integration-test
- datadog-plugin-knex/test/integration-test
- datadog-plugin-koa/test/integration-test
- datadog-plugin-langchain/test/integration-test
- datadog-plugin-ldapjs/test/integration-test
- datadog-plugin-light-my-request/test/integration-test
- datadog-plugin-limitd-client/test/integration-test
- datadog-plugin-lodash/test/integration-test
- datadog-plugin-mariadb/test/integration-test
- datadog-plugin-memcached/test/integration-test
- datadog-plugin-mercurius/test/integration-test
- datadog-plugin-microgateway-core/test/integration-test
- datadog-plugin-moleculer/test/integration-test
- datadog-plugin-mongodb-core/test
- integration-test
- datadog-plugin-mongoose/test/integration-test
- datadog-plugin-multer/test/integration-test
- datadog-plugin-mysql2/test/integration-test
- datadog-plugin-mysql/test/integration-test
- datadog-plugin-net/test/integration-test
- datadog-plugin-next/test/integration-test
- datadog-plugin-node-serialize/test/integration-test
- datadog-plugin-openai/test/integration-test
- datadog-plugin-opensearch/test/integration-test
- datadog-plugin-oracledb/test/integration-test
- datadog-plugin-passport-http/test/integration-test
- datadog-plugin-pg/test/integration-test
- datadog-plugin-pino/test/integration-test
- datadog-plugin-prisma/test/integration-test
- datadog-plugin-process/test/integration-test
- datadog-plugin-pug/test/integration-test
- datadog-plugin-redis/test/integration-test
- datadog-plugin-restify/test/integration-test
- datadog-plugin-rhea/test/integration-test
- datadog-plugin-router/test/integration-test
- datadog-plugin-sequelize/test/integration-test
- datadog-plugin-tedious/test/integration-test
- datadog-plugin-url/test/integration-test
- datadog-plugin-vm/test/integration-test
- datadog-plugin-winston/test/integration-test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
674 | 682 | | |
| 683 | + | |
675 | 684 | | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
| 685 | + | |
| 686 | + | |
683 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
684 | 742 | | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | 743 | | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
| 744 | + | |
| 745 | + | |
698 | 746 | | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
| 747 | + | |
722 | 748 | | |
723 | | - | |
724 | | - | |
725 | | - | |
| 749 | + | |
726 | 750 | | |
727 | 751 | | |
728 | | - | |
729 | | - | |
| 752 | + | |
730 | 753 | | |
731 | 754 | | |
732 | 755 | | |
733 | 756 | | |
734 | 757 | | |
735 | | - | |
736 | 758 | | |
737 | 759 | | |
738 | 760 | | |
739 | 761 | | |
740 | | - | |
741 | 762 | | |
742 | 763 | | |
743 | 764 | | |
744 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
745 | 770 | | |
746 | | - | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
747 | 786 | | |
748 | 787 | | |
749 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
| |||
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
84 | 92 | | |
85 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
86 | 102 | | |
87 | 103 | | |
88 | 104 | | |
89 | 105 | | |
90 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
91 | 112 | | |
92 | 113 | | |
93 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
0 commit comments