From 8c0062127d425d17a8468a58cefd542f807a6aa0 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Thu, 31 Aug 2023 17:04:50 +0530 Subject: [PATCH 01/14] [Telemetry-Otel] Added support for OtlpGrpcSpanExporter exporter Signed-off-by: Shephali Mittal --- CHANGELOG.md | 1 + plugins/telemetry-otel/build.gradle | 44 ++++ .../licenses/kotlin-stdlib-1.6.20.jar.sha1 | 1 + .../licenses/kotlin-stdlib-LICENSE.txt | 202 ++++++++++++++++++ .../licenses/kotlin-stdlib-NOTICE.txt | 0 .../licenses/okhttp-4.10.0.jar.sha1 | 1 + .../licenses/okhttp-LICENSE.txt | 202 ++++++++++++++++++ .../telemetry-otel/licenses/okhttp-NOTICE.txt | 0 .../licenses/okio-jvm-3.0.0.jar.sha1 | 1 + .../licenses/okio-jvm-LICENSE.txt | 202 ++++++++++++++++++ .../licenses/okio-jvm-NOTICE.txt | 0 ...ntelemetry-exporter-common-1.26.0.jar.sha1 | 1 + .../opentelemetry-exporter-common-LICENSE.txt | 202 ++++++++++++++++++ .../opentelemetry-exporter-common-NOTICE.txt | 0 ...pentelemetry-exporter-otlp-1.26.0.jar.sha1 | 1 + .../opentelemetry-exporter-otlp-LICENSE.txt | 202 ++++++++++++++++++ .../opentelemetry-exporter-otlp-NOTICE.txt | 0 ...metry-exporter-otlp-common-1.26.0.jar.sha1 | 1 + ...telemetry-exporter-otlp-common-LICENSE.txt | 202 ++++++++++++++++++ ...ntelemetry-exporter-otlp-common-NOTICE.txt | 0 .../tracing/OTelResourceProvider.java | 14 +- .../OtlpGrpcSpanExporterProvider.java | 52 +++++ .../plugin-metadata/plugin-security.policy | 2 + 23 files changed, 1326 insertions(+), 5 deletions(-) create mode 100644 plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/kotlin-stdlib-LICENSE.txt create mode 100644 plugins/telemetry-otel/licenses/kotlin-stdlib-NOTICE.txt create mode 100644 plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/okhttp-LICENSE.txt create mode 100644 plugins/telemetry-otel/licenses/okhttp-NOTICE.txt create mode 100644 plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/okio-jvm-LICENSE.txt create mode 100644 plugins/telemetry-otel/licenses/okio-jvm-NOTICE.txt create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-common-LICENSE.txt create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-common-NOTICE.txt create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-LICENSE.txt create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-NOTICE.txt create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-LICENSE.txt create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-NOTICE.txt create mode 100644 plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df33dc6e3ace..d00bbe9110b7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - [BWC and API enforcement] Decorate the existing APIs with proper annotations (part 1) ([#9520](https://github.com/opensearch-project/OpenSearch/pull/9520)) - Add concurrent segment search related metrics to node and index stats ([#9622](https://github.com/opensearch-project/OpenSearch/issues/9622)) - Decouple replication lag from logic to fail stale replicas ([#9507](https://github.com/opensearch-project/OpenSearch/pull/9507)) +- [Telemetry-Otel] Added support for OtlpGrpcSpanExporter exporter ([#9666](https://github.com/opensearch-project/OpenSearch/pull/9666)) ### Dependencies - Bump `org.apache.logging.log4j:log4j-core` from 2.17.1 to 2.20.0 ([#8307](https://github.com/opensearch-project/OpenSearch/pull/8307)) diff --git a/plugins/telemetry-otel/build.gradle b/plugins/telemetry-otel/build.gradle index 04fa9df9a47d0..da5b80915a6fb 100644 --- a/plugins/telemetry-otel/build.gradle +++ b/plugins/telemetry-otel/build.gradle @@ -31,6 +31,12 @@ dependencies { api "io.opentelemetry:opentelemetry-semconv:${versions.opentelemetry}-alpha" api "io.opentelemetry:opentelemetry-sdk-logs:${versions.opentelemetry}-alpha" api "io.opentelemetry:opentelemetry-api-logs:${versions.opentelemetry}-alpha" + api "io.opentelemetry:opentelemetry-exporter-otlp:${versions.opentelemetry}" + api "io.opentelemetry:opentelemetry-exporter-common:${versions.opentelemetry}" + api "io.opentelemetry:opentelemetry-exporter-otlp-common:${versions.opentelemetry}" + api "com.squareup.okhttp3:okhttp:4.10.0" + api "org.jetbrains.kotlin:kotlin-stdlib:1.6.20" + api "com.squareup.okio:okio-jvm:3.0.0" testImplementation "io.opentelemetry:opentelemetry-sdk-testing:${versions.opentelemetry}" } @@ -45,6 +51,44 @@ thirdPartyAudit { ) ignoreMissingClasses( + 'android.net.http.X509TrustManagerExtensions', + 'android.net.ssl.SSLSockets', + 'android.os.Build$VERSION', + 'android.security.NetworkSecurityPolicy', + 'android.util.Log', + 'com.google.common.io.ByteStreams', + 'com.google.common.util.concurrent.FutureCallback', + 'com.google.common.util.concurrent.Futures', + 'com.google.common.util.concurrent.ListenableFuture', + 'com.google.common.util.concurrent.MoreExecutors', + 'io.grpc.CallOptions', + 'io.grpc.Channel', + 'io.grpc.ClientInterceptor', + 'io.grpc.ClientInterceptors', + 'io.grpc.Codec', + 'io.grpc.Codec$Identity', + 'io.grpc.Drainable', + 'io.grpc.KnownLength', + 'io.grpc.ManagedChannel', + 'io.grpc.Metadata', + 'io.grpc.Metadata$Key', + 'io.grpc.MethodDescriptor', + 'io.grpc.MethodDescriptor$Builder', + 'io.grpc.MethodDescriptor$Marshaller', + 'io.grpc.MethodDescriptor$MethodType', + 'io.grpc.Status', + 'io.grpc.Status$Code', + 'io.grpc.stub.AbstractFutureStub', + 'io.grpc.stub.AbstractStub', + 'io.grpc.stub.ClientCalls', + 'io.grpc.stub.MetadataUtils', + 'org.bouncycastle.jsse.BCSSLParameters', + 'org.bouncycastle.jsse.BCSSLSocket', + 'org.conscrypt.Conscrypt', + 'org.conscrypt.Conscrypt$Version', + 'org.conscrypt.ConscryptHostnameVerifier', + 'org.openjsse.javax.net.ssl.SSLParameters', + 'org.openjsse.javax.net.ssl.SSLSocket', 'io.opentelemetry.api.events.EventEmitter', 'io.opentelemetry.api.events.EventEmitterBuilder', 'io.opentelemetry.api.events.EventEmitterProvider', diff --git a/plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 b/plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 new file mode 100644 index 0000000000000..a26a3b6591dcf --- /dev/null +++ b/plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 @@ -0,0 +1 @@ +6cedc143badbb4f1c6b7f5a340b04edff1743208 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/kotlin-stdlib-LICENSE.txt b/plugins/telemetry-otel/licenses/kotlin-stdlib-LICENSE.txt new file mode 100644 index 0000000000000..d645695673349 --- /dev/null +++ b/plugins/telemetry-otel/licenses/kotlin-stdlib-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/telemetry-otel/licenses/kotlin-stdlib-NOTICE.txt b/plugins/telemetry-otel/licenses/kotlin-stdlib-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 b/plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 new file mode 100644 index 0000000000000..7cd464ff3effb --- /dev/null +++ b/plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 @@ -0,0 +1 @@ +cd63657ac15770ed1420647154c9f44645533bef \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/okhttp-LICENSE.txt b/plugins/telemetry-otel/licenses/okhttp-LICENSE.txt new file mode 100644 index 0000000000000..d645695673349 --- /dev/null +++ b/plugins/telemetry-otel/licenses/okhttp-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/telemetry-otel/licenses/okhttp-NOTICE.txt b/plugins/telemetry-otel/licenses/okhttp-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 b/plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 new file mode 100644 index 0000000000000..b75b63ec015bd --- /dev/null +++ b/plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 @@ -0,0 +1 @@ +0ab5a73fa2ccb4a36b0b5c69fe10b16d0255bcf8 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/okio-jvm-LICENSE.txt b/plugins/telemetry-otel/licenses/okio-jvm-LICENSE.txt new file mode 100644 index 0000000000000..d645695673349 --- /dev/null +++ b/plugins/telemetry-otel/licenses/okio-jvm-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/telemetry-otel/licenses/okio-jvm-NOTICE.txt b/plugins/telemetry-otel/licenses/okio-jvm-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 new file mode 100644 index 0000000000000..588736667f4ad --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 @@ -0,0 +1 @@ +f003bf36d89e59b6fa488f9a2428a2dbd48adca2 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-LICENSE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-LICENSE.txt new file mode 100644 index 0000000000000..d645695673349 --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-NOTICE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 new file mode 100644 index 0000000000000..818338e8ab214 --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 @@ -0,0 +1 @@ +b2ef104f9529d531e658e83f074dd1b51a497ba8 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-LICENSE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-LICENSE.txt new file mode 100644 index 0000000000000..d645695673349 --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-NOTICE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 new file mode 100644 index 0000000000000..792ba72f57e53 --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 @@ -0,0 +1 @@ +7b72ec795f710bbd5392fe8dc268eeb5ed8be5f9 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-LICENSE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-LICENSE.txt new file mode 100644 index 0000000000000..d645695673349 --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-NOTICE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/OTelResourceProvider.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/OTelResourceProvider.java index 1ec4818b8b73e..dc4348da8739a 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/OTelResourceProvider.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/OTelResourceProvider.java @@ -11,6 +11,8 @@ import org.opensearch.common.settings.Settings; import org.opensearch.telemetry.tracing.exporter.OTelSpanExporterFactory; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.concurrent.TimeUnit; import io.opentelemetry.api.OpenTelemetry; @@ -41,11 +43,13 @@ private OTelResourceProvider() {} * @return OpenTelemetry instance */ public static OpenTelemetry get(Settings settings) { - return get( - settings, - OTelSpanExporterFactory.create(settings), - ContextPropagators.create(W3CTraceContextPropagator.getInstance()), - Sampler.alwaysOn() + return AccessController.doPrivileged( + (PrivilegedAction) () -> get( + settings, + OTelSpanExporterFactory.create(settings), + ContextPropagators.create(W3CTraceContextPropagator.getInstance()), + Sampler.alwaysOn() + ) ); } diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java new file mode 100644 index 0000000000000..3e0d3647e74a5 --- /dev/null +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java @@ -0,0 +1,52 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.telemetry.tracing.exporter; + +import java.util.Collection; + +import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.trace.data.SpanData; +import io.opentelemetry.sdk.trace.export.SpanExporter; + +/** +* OtlpGrpcSpanExporterProvider class creates an instance of OtlpGrpcSpanExporter +*/ +public class OtlpGrpcSpanExporterProvider implements SpanExporter { + + private OtlpGrpcSpanExporter delegate; + + private OtlpGrpcSpanExporterProvider(OtlpGrpcSpanExporter exporter) { + this.delegate = exporter; + } + + /** + * create() is expected by OTelSpanExporterFactory. This creates an instance of + * OtlpGrpcSpanExporter and sets https endpoint. + */ + public static OtlpGrpcSpanExporterProvider create() { + OtlpGrpcSpanExporter exporter = OtlpGrpcSpanExporter.builder().setEndpoint("https://localhost:4317").build(); + return new OtlpGrpcSpanExporterProvider(exporter); + } + + @Override + public CompletableResultCode export(Collection spans) { + return delegate.export(spans); + } + + @Override + public CompletableResultCode flush() { + return delegate.flush(); + } + + @Override + public CompletableResultCode shutdown() { + return delegate.shutdown(); + } +} diff --git a/plugins/telemetry-otel/src/main/plugin-metadata/plugin-security.policy b/plugins/telemetry-otel/src/main/plugin-metadata/plugin-security.policy index 4480cbb2bab4b..726db3d3f4700 100644 --- a/plugins/telemetry-otel/src/main/plugin-metadata/plugin-security.policy +++ b/plugins/telemetry-otel/src/main/plugin-metadata/plugin-security.policy @@ -9,6 +9,8 @@ grant { permission java.lang.RuntimePermission "getClassLoader"; permission java.lang.RuntimePermission "accessDeclaredMembers"; + permission java.net.NetPermission "getProxySelector"; + permission java.net.SocketPermission "*", "connect,resolve"; }; From 9032d7dfbc10ece47d52e8bd95d71afdcb1dac7b Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Fri, 1 Sep 2023 19:23:45 +0530 Subject: [PATCH 02/14] Made endpoint settings configurable in Exporter Factory Signed-off-by: Shephali Mittal --- .../telemetry/OTelTelemetryPlugin.java | 3 +- .../telemetry/OTelTelemetrySettings.java | 10 +++++ .../exporter/OTelSpanExporterFactory.java | 32 ++++++++++--- .../OtlpGrpcSpanExporterProvider.java | 17 +++++-- .../OTelSpanExporterFactoryTests.java | 11 +++++ .../SettingsInjectableDummySpanExporter.java | 45 +++++++++++++++++++ 6 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/SettingsInjectableDummySpanExporter.java diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java index a1ca3adf4d2a2..0669e116a6073 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java @@ -44,7 +44,8 @@ public List> getSettings() { OTelTelemetrySettings.TRACER_EXPORTER_BATCH_SIZE_SETTING, OTelTelemetrySettings.TRACER_EXPORTER_DELAY_SETTING, OTelTelemetrySettings.TRACER_EXPORTER_MAX_QUEUE_SIZE_SETTING, - OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING + OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING, + OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT ); } diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java index 59c87cca22986..959bb1eed2642 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java @@ -60,6 +60,16 @@ private OTelTelemetrySettings() {} Setting.Property.Final ); + /** + * span exporter endpoint in string + */ + public static final Setting TRACER_SPAN_EXPORTER_ENDPOINT = Setting.simpleString( + "telemetry.otel.tracer.exporter.endpoint", + "", + Setting.Property.NodeScope, + Setting.Property.Final + ); + /** * Span Exporter type setting. */ diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java index cd4ffb160903b..7ba47b680452c 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java @@ -45,21 +45,41 @@ private OTelSpanExporterFactory() { */ public static SpanExporter create(Settings settings) { Class spanExporterProviderClass = OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING.get(settings); - SpanExporter spanExporter = instantiateSpanExporter(spanExporterProviderClass); + SpanExporter spanExporter = instantiateSpanExporter(spanExporterProviderClass, settings); logger.info("Successfully instantiated the SpanExporter class {}", spanExporterProviderClass); return spanExporter; } - private static SpanExporter instantiateSpanExporter(Class spanExporterProviderClass) { + private static SpanExporter instantiateSpanExporter(Class spanExporterProviderClass, Settings settings) { try { // Check we ourselves are not being called by unprivileged code. SpecialPermission.check(); return AccessController.doPrivileged((PrivilegedExceptionAction) () -> { try { - return (SpanExporter) MethodHandles.publicLookup() - .findStatic(spanExporterProviderClass, "create", MethodType.methodType(spanExporterProviderClass)) - .asType(MethodType.methodType(SpanExporter.class)) - .invokeExact(); + String methodName = "create"; + boolean createMethodWithSettingsParamExists = true; + try { + // Attempt to get the method with the specified name and parameter types + spanExporterProviderClass.getMethod(methodName, Settings.class); + } catch (NoSuchMethodException e) { + createMethodWithSettingsParamExists = false; + } + if (createMethodWithSettingsParamExists) { + return (SpanExporter) MethodHandles.publicLookup() + .findStatic( + spanExporterProviderClass, + methodName, + MethodType.methodType(spanExporterProviderClass, Settings.class) + ) + .asType(MethodType.methodType(SpanExporter.class, Settings.class)) + .invokeExact(settings); + } else { + return (SpanExporter) MethodHandles.publicLookup() + .findStatic(spanExporterProviderClass, methodName, MethodType.methodType(spanExporterProviderClass)) + .asType(MethodType.methodType(SpanExporter.class)) + .invokeExact(); + } + } catch (Throwable e) { if (e.getCause() instanceof NoSuchMethodException) { throw new IllegalStateException("No create factory method exist in [" + spanExporterProviderClass.getName() + "]"); diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java index 3e0d3647e74a5..4942d74638ac5 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java @@ -8,6 +8,9 @@ package org.opensearch.telemetry.tracing.exporter; +import org.opensearch.common.settings.Settings; +import org.opensearch.telemetry.OTelTelemetrySettings; + import java.util.Collection; import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; @@ -18,7 +21,7 @@ /** * OtlpGrpcSpanExporterProvider class creates an instance of OtlpGrpcSpanExporter */ -public class OtlpGrpcSpanExporterProvider implements SpanExporter { +public final class OtlpGrpcSpanExporterProvider implements SpanExporter { private OtlpGrpcSpanExporter delegate; @@ -29,9 +32,17 @@ private OtlpGrpcSpanExporterProvider(OtlpGrpcSpanExporter exporter) { /** * create() is expected by OTelSpanExporterFactory. This creates an instance of * OtlpGrpcSpanExporter and sets https endpoint. + * @param settings settings + * @return OtlpGrpcSpanExporterProvider instance. */ - public static OtlpGrpcSpanExporterProvider create() { - OtlpGrpcSpanExporter exporter = OtlpGrpcSpanExporter.builder().setEndpoint("https://localhost:4317").build(); + public static OtlpGrpcSpanExporterProvider create(Settings settings) { + OtlpGrpcSpanExporter exporter; + String endpoint = OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT.get(settings); + if (endpoint.isEmpty()) { + exporter = OtlpGrpcSpanExporter.builder().build(); + } else { + exporter = OtlpGrpcSpanExporter.builder().setEndpoint(endpoint).build(); + } return new OtlpGrpcSpanExporterProvider(exporter); } diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java index d9a86ccd3180b..c63a076fe06c6 100644 --- a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java +++ b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java @@ -63,4 +63,15 @@ public void testSpanExporterNonSpanExporterClass() { } + public void testSettingsInjectableSpanExporterClass() { + Settings settings = Settings.builder() + .put( + OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING.getKey(), + "org.opensearch.telemetry.tracing.exporter.SettingsInjectableDummySpanExporter" + ) + .build(); + + assertTrue(OTelSpanExporterFactory.create(settings) instanceof SettingsInjectableDummySpanExporter); + } + } diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/SettingsInjectableDummySpanExporter.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/SettingsInjectableDummySpanExporter.java new file mode 100644 index 0000000000000..09897adbe014c --- /dev/null +++ b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/SettingsInjectableDummySpanExporter.java @@ -0,0 +1,45 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.telemetry.tracing.exporter; + +import org.opensearch.common.settings.Settings; + +import java.util.Collection; + +import io.opentelemetry.sdk.common.CompletableResultCode; +import io.opentelemetry.sdk.trace.data.SpanData; +import io.opentelemetry.sdk.trace.export.SpanExporter; + +public class SettingsInjectableDummySpanExporter implements SpanExporter { + + private SettingsInjectableDummySpanExporter() {} + + /** + * @param settings settings + * @return SettingsInjectableDummySpanExporter + */ + public static SettingsInjectableDummySpanExporter create(Settings settings) { + return new SettingsInjectableDummySpanExporter(); + } + + @Override + public CompletableResultCode export(Collection spans) { + return null; + } + + @Override + public CompletableResultCode flush() { + return null; + } + + @Override + public CompletableResultCode shutdown() { + return null; + } +} From dacafc5aa434d515da38ffec19ea1ffed90972c8 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Fri, 1 Sep 2023 22:05:15 +0530 Subject: [PATCH 03/14] Added comments Signed-off-by: Shephali Mittal --- .../tracing/exporter/OtlpGrpcSpanExporterProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java index 4942d74638ac5..c15e421798f9e 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java @@ -30,7 +30,7 @@ private OtlpGrpcSpanExporterProvider(OtlpGrpcSpanExporter exporter) { } /** - * create() is expected by OTelSpanExporterFactory. This creates an instance of + * create method is expected by OTelSpanExporterFactory. This creates an instance of * OtlpGrpcSpanExporter and sets https endpoint. * @param settings settings * @return OtlpGrpcSpanExporterProvider instance. @@ -38,6 +38,7 @@ private OtlpGrpcSpanExporterProvider(OtlpGrpcSpanExporter exporter) { public static OtlpGrpcSpanExporterProvider create(Settings settings) { OtlpGrpcSpanExporter exporter; String endpoint = OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT.get(settings); + //if endpoint is empty, do not set Endpoint if (endpoint.isEmpty()) { exporter = OtlpGrpcSpanExporter.builder().build(); } else { From 9b166d1aa17485e882027f3fb80885c74fefbb06 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Fri, 1 Sep 2023 22:25:50 +0530 Subject: [PATCH 04/14] precommit fix Signed-off-by: Shephali Mittal --- .../tracing/exporter/OtlpGrpcSpanExporterProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java index c15e421798f9e..f0944616de1ab 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java @@ -38,7 +38,7 @@ private OtlpGrpcSpanExporterProvider(OtlpGrpcSpanExporter exporter) { public static OtlpGrpcSpanExporterProvider create(Settings settings) { OtlpGrpcSpanExporter exporter; String endpoint = OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT.get(settings); - //if endpoint is empty, do not set Endpoint + // if endpoint is empty, do not set Endpoint if (endpoint.isEmpty()) { exporter = OtlpGrpcSpanExporter.builder().build(); } else { From 8bf6791acc8b539de03a243e0c93f2d06fdd1de6 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Fri, 1 Sep 2023 23:09:44 +0530 Subject: [PATCH 05/14] OTelTelemetryPluginTests test fix Signed-off-by: Shephali Mittal --- .../org/opensearch/telemetry/OTelTelemetryPluginTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java index 8c2b5d14733e2..948c15bf6d620 100644 --- a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java +++ b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java @@ -29,6 +29,7 @@ import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_EXPORTER_BATCH_SIZE_SETTING; import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_EXPORTER_DELAY_SETTING; import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_EXPORTER_MAX_QUEUE_SIZE_SETTING; +import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT; import static org.opensearch.telemetry.TelemetrySettings.TRACER_ENABLED_SETTING; import static org.opensearch.telemetry.TelemetrySettings.TRACER_SAMPLER_PROBABILITY; @@ -60,7 +61,8 @@ public void testGetTelemetry() { TRACER_EXPORTER_BATCH_SIZE_SETTING, TRACER_EXPORTER_DELAY_SETTING, TRACER_EXPORTER_MAX_QUEUE_SIZE_SETTING, - OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING + OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING, + TRACER_SPAN_EXPORTER_ENDPOINT ), oTelTracerModulePlugin.getSettings() ); From 8ac6b89d5c056464df791d7e1982a0fe4d757251 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Tue, 5 Sep 2023 10:22:21 +0530 Subject: [PATCH 06/14] Added test for OtlpGrpcSpanExporterProvider Signed-off-by: Shephali Mittal --- .../exporter/OTelSpanExporterFactory.java | 20 +++++++------- .../OtlpGrpcSpanExporterProviderTests.java | 26 +++++++++++++++++++ 2 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java index 7ba47b680452c..39b34578ebf63 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java @@ -16,6 +16,7 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; +import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; @@ -55,16 +56,16 @@ private static SpanExporter instantiateSpanExporter(Class spanExpo // Check we ourselves are not being called by unprivileged code. SpecialPermission.check(); return AccessController.doPrivileged((PrivilegedExceptionAction) () -> { - try { - String methodName = "create"; - boolean createMethodWithSettingsParamExists = true; - try { - // Attempt to get the method with the specified name and parameter types - spanExporterProviderClass.getMethod(methodName, Settings.class); - } catch (NoSuchMethodException e) { - createMethodWithSettingsParamExists = false; + String methodName = "create"; + boolean isCreateMethodContainsSettingsParam = false; + for (Method m : spanExporterProviderClass.getMethods()) { + if (m.getName().equals(methodName) && m.getParameterCount() == 1 && m.getParameterTypes()[0] == Settings.class) { + isCreateMethodContainsSettingsParam = true; + break; } - if (createMethodWithSettingsParamExists) { + } + try { + if (isCreateMethodContainsSettingsParam) { return (SpanExporter) MethodHandles.publicLookup() .findStatic( spanExporterProviderClass, @@ -79,7 +80,6 @@ private static SpanExporter instantiateSpanExporter(Class spanExpo .asType(MethodType.methodType(SpanExporter.class)) .invokeExact(); } - } catch (Throwable e) { if (e.getCause() instanceof NoSuchMethodException) { throw new IllegalStateException("No create factory method exist in [" + spanExporterProviderClass.getName() + "]"); diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java new file mode 100644 index 0000000000000..d274089316f29 --- /dev/null +++ b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.telemetry.tracing.exporter; + +import org.opensearch.common.settings.Settings; +import org.opensearch.telemetry.OTelTelemetrySettings; +import org.opensearch.test.OpenSearchTestCase; + +public class OtlpGrpcSpanExporterProviderTests extends OpenSearchTestCase { + public void testSpanExporterInstantiatedProperly() { + Settings settings = Settings.builder() + .put( + OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING.getKey(), + "org.opensearch.telemetry.tracing.exporter.OtlpGrpcSpanExporterProvider" + ) + .build(); + + assertTrue(OTelSpanExporterFactory.create(settings) instanceof OtlpGrpcSpanExporterProvider); + } +} From 0f34d983aa61cac0b4a4b70f424cc2e95c2a5a0c Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Tue, 5 Sep 2023 14:21:08 +0530 Subject: [PATCH 07/14] renamed var createMethodContainsSettingsParam Signed-off-by: Shephali Mittal --- .../telemetry/tracing/exporter/OTelSpanExporterFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java index 39b34578ebf63..8c2896123079e 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java @@ -57,15 +57,15 @@ private static SpanExporter instantiateSpanExporter(Class spanExpo SpecialPermission.check(); return AccessController.doPrivileged((PrivilegedExceptionAction) () -> { String methodName = "create"; - boolean isCreateMethodContainsSettingsParam = false; + boolean createMethodContainsSettingsParam = false; for (Method m : spanExporterProviderClass.getMethods()) { if (m.getName().equals(methodName) && m.getParameterCount() == 1 && m.getParameterTypes()[0] == Settings.class) { - isCreateMethodContainsSettingsParam = true; + createMethodContainsSettingsParam = true; break; } } try { - if (isCreateMethodContainsSettingsParam) { + if (createMethodContainsSettingsParam) { return (SpanExporter) MethodHandles.publicLookup() .findStatic( spanExporterProviderClass, From 21dfd48bf85039ed58793c92bf8567bd9ed7eb07 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Tue, 5 Sep 2023 14:49:05 +0530 Subject: [PATCH 08/14] modified endpoint comment Signed-off-by: Shephali Mittal --- .../tracing/exporter/OtlpGrpcSpanExporterProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java index f0944616de1ab..e67f8caae119b 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java @@ -38,7 +38,7 @@ private OtlpGrpcSpanExporterProvider(OtlpGrpcSpanExporter exporter) { public static OtlpGrpcSpanExporterProvider create(Settings settings) { OtlpGrpcSpanExporter exporter; String endpoint = OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT.get(settings); - // if endpoint is empty, do not set Endpoint + // if endpoint is empty, do not set Endpoint. The default endpoint is "http://localhost:4317" if (endpoint.isEmpty()) { exporter = OtlpGrpcSpanExporter.builder().build(); } else { From 6011c7e4180e840f77df8681927974744599542d Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Thu, 7 Sep 2023 13:15:14 +0530 Subject: [PATCH 09/14] Remove configurable settings and provided support for getDefault() Signed-off-by: Shephali Mittal --- .../telemetry/OTelTelemetryPlugin.java | 3 +- .../telemetry/OTelTelemetrySettings.java | 10 --- .../exporter/OTelSpanExporterFactory.java | 29 +++------ .../OtlpGrpcSpanExporterProvider.java | 64 ------------------- .../telemetry/OTelTelemetryPluginTests.java | 4 +- ...a => DummySpanExporterWithGetDefault.java} | 14 +--- .../OTelSpanExporterFactoryTests.java | 6 +- .../OtlpGrpcSpanExporterProviderTests.java | 26 -------- 8 files changed, 17 insertions(+), 139 deletions(-) delete mode 100644 plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java rename plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/{SettingsInjectableDummySpanExporter.java => DummySpanExporterWithGetDefault.java} (64%) delete mode 100644 plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java index 9d00a628e2c9a..1af88196e3727 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetryPlugin.java @@ -44,8 +44,7 @@ public List> getSettings() { OTelTelemetrySettings.TRACER_EXPORTER_BATCH_SIZE_SETTING, OTelTelemetrySettings.TRACER_EXPORTER_DELAY_SETTING, OTelTelemetrySettings.TRACER_EXPORTER_MAX_QUEUE_SIZE_SETTING, - OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING, - OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT + OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING ); } diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java index 959bb1eed2642..59c87cca22986 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/OTelTelemetrySettings.java @@ -60,16 +60,6 @@ private OTelTelemetrySettings() {} Setting.Property.Final ); - /** - * span exporter endpoint in string - */ - public static final Setting TRACER_SPAN_EXPORTER_ENDPOINT = Setting.simpleString( - "telemetry.otel.tracer.exporter.endpoint", - "", - Setting.Property.NodeScope, - Setting.Property.Final - ); - /** * Span Exporter type setting. */ diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java index 8c2896123079e..da7ce5c47d9ca 100644 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java +++ b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactory.java @@ -46,40 +46,29 @@ private OTelSpanExporterFactory() { */ public static SpanExporter create(Settings settings) { Class spanExporterProviderClass = OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING.get(settings); - SpanExporter spanExporter = instantiateSpanExporter(spanExporterProviderClass, settings); + SpanExporter spanExporter = instantiateSpanExporter(spanExporterProviderClass); logger.info("Successfully instantiated the SpanExporter class {}", spanExporterProviderClass); return spanExporter; } - private static SpanExporter instantiateSpanExporter(Class spanExporterProviderClass, Settings settings) { + private static SpanExporter instantiateSpanExporter(Class spanExporterProviderClass) { try { // Check we ourselves are not being called by unprivileged code. SpecialPermission.check(); return AccessController.doPrivileged((PrivilegedExceptionAction) () -> { String methodName = "create"; - boolean createMethodContainsSettingsParam = false; + String getDefaultMethod = "getDefault"; for (Method m : spanExporterProviderClass.getMethods()) { - if (m.getName().equals(methodName) && m.getParameterCount() == 1 && m.getParameterTypes()[0] == Settings.class) { - createMethodContainsSettingsParam = true; + if (m.getName().equals(getDefaultMethod)) { + methodName = getDefaultMethod; break; } } try { - if (createMethodContainsSettingsParam) { - return (SpanExporter) MethodHandles.publicLookup() - .findStatic( - spanExporterProviderClass, - methodName, - MethodType.methodType(spanExporterProviderClass, Settings.class) - ) - .asType(MethodType.methodType(SpanExporter.class, Settings.class)) - .invokeExact(settings); - } else { - return (SpanExporter) MethodHandles.publicLookup() - .findStatic(spanExporterProviderClass, methodName, MethodType.methodType(spanExporterProviderClass)) - .asType(MethodType.methodType(SpanExporter.class)) - .invokeExact(); - } + return (SpanExporter) MethodHandles.publicLookup() + .findStatic(spanExporterProviderClass, methodName, MethodType.methodType(spanExporterProviderClass)) + .asType(MethodType.methodType(SpanExporter.class)) + .invokeExact(); } catch (Throwable e) { if (e.getCause() instanceof NoSuchMethodException) { throw new IllegalStateException("No create factory method exist in [" + spanExporterProviderClass.getName() + "]"); diff --git a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java b/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java deleted file mode 100644 index e67f8caae119b..0000000000000 --- a/plugins/telemetry-otel/src/main/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -package org.opensearch.telemetry.tracing.exporter; - -import org.opensearch.common.settings.Settings; -import org.opensearch.telemetry.OTelTelemetrySettings; - -import java.util.Collection; - -import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; -import io.opentelemetry.sdk.common.CompletableResultCode; -import io.opentelemetry.sdk.trace.data.SpanData; -import io.opentelemetry.sdk.trace.export.SpanExporter; - -/** -* OtlpGrpcSpanExporterProvider class creates an instance of OtlpGrpcSpanExporter -*/ -public final class OtlpGrpcSpanExporterProvider implements SpanExporter { - - private OtlpGrpcSpanExporter delegate; - - private OtlpGrpcSpanExporterProvider(OtlpGrpcSpanExporter exporter) { - this.delegate = exporter; - } - - /** - * create method is expected by OTelSpanExporterFactory. This creates an instance of - * OtlpGrpcSpanExporter and sets https endpoint. - * @param settings settings - * @return OtlpGrpcSpanExporterProvider instance. - */ - public static OtlpGrpcSpanExporterProvider create(Settings settings) { - OtlpGrpcSpanExporter exporter; - String endpoint = OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT.get(settings); - // if endpoint is empty, do not set Endpoint. The default endpoint is "http://localhost:4317" - if (endpoint.isEmpty()) { - exporter = OtlpGrpcSpanExporter.builder().build(); - } else { - exporter = OtlpGrpcSpanExporter.builder().setEndpoint(endpoint).build(); - } - return new OtlpGrpcSpanExporterProvider(exporter); - } - - @Override - public CompletableResultCode export(Collection spans) { - return delegate.export(spans); - } - - @Override - public CompletableResultCode flush() { - return delegate.flush(); - } - - @Override - public CompletableResultCode shutdown() { - return delegate.shutdown(); - } -} diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java index 948c15bf6d620..8c2b5d14733e2 100644 --- a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java +++ b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/OTelTelemetryPluginTests.java @@ -29,7 +29,6 @@ import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_EXPORTER_BATCH_SIZE_SETTING; import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_EXPORTER_DELAY_SETTING; import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_EXPORTER_MAX_QUEUE_SIZE_SETTING; -import static org.opensearch.telemetry.OTelTelemetrySettings.TRACER_SPAN_EXPORTER_ENDPOINT; import static org.opensearch.telemetry.TelemetrySettings.TRACER_ENABLED_SETTING; import static org.opensearch.telemetry.TelemetrySettings.TRACER_SAMPLER_PROBABILITY; @@ -61,8 +60,7 @@ public void testGetTelemetry() { TRACER_EXPORTER_BATCH_SIZE_SETTING, TRACER_EXPORTER_DELAY_SETTING, TRACER_EXPORTER_MAX_QUEUE_SIZE_SETTING, - OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING, - TRACER_SPAN_EXPORTER_ENDPOINT + OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING ), oTelTracerModulePlugin.getSettings() ); diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/SettingsInjectableDummySpanExporter.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/DummySpanExporterWithGetDefault.java similarity index 64% rename from plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/SettingsInjectableDummySpanExporter.java rename to plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/DummySpanExporterWithGetDefault.java index 09897adbe014c..225cfa6ab2d1a 100644 --- a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/SettingsInjectableDummySpanExporter.java +++ b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/DummySpanExporterWithGetDefault.java @@ -8,24 +8,16 @@ package org.opensearch.telemetry.tracing.exporter; -import org.opensearch.common.settings.Settings; - import java.util.Collection; import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.data.SpanData; import io.opentelemetry.sdk.trace.export.SpanExporter; -public class SettingsInjectableDummySpanExporter implements SpanExporter { - - private SettingsInjectableDummySpanExporter() {} +public class DummySpanExporterWithGetDefault implements SpanExporter { - /** - * @param settings settings - * @return SettingsInjectableDummySpanExporter - */ - public static SettingsInjectableDummySpanExporter create(Settings settings) { - return new SettingsInjectableDummySpanExporter(); + public static DummySpanExporterWithGetDefault getDefault() { + return new DummySpanExporterWithGetDefault(); } @Override diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java index c63a076fe06c6..d71aef9366e21 100644 --- a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java +++ b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OTelSpanExporterFactoryTests.java @@ -63,15 +63,15 @@ public void testSpanExporterNonSpanExporterClass() { } - public void testSettingsInjectableSpanExporterClass() { + public void testSpanExporterGetDefaultMethod() { Settings settings = Settings.builder() .put( OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING.getKey(), - "org.opensearch.telemetry.tracing.exporter.SettingsInjectableDummySpanExporter" + "org.opensearch.telemetry.tracing.exporter.DummySpanExporterWithGetDefault" ) .build(); - assertTrue(OTelSpanExporterFactory.create(settings) instanceof SettingsInjectableDummySpanExporter); + assertTrue(OTelSpanExporterFactory.create(settings) instanceof DummySpanExporterWithGetDefault); } } diff --git a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java b/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java deleted file mode 100644 index d274089316f29..0000000000000 --- a/plugins/telemetry-otel/src/test/java/org/opensearch/telemetry/tracing/exporter/OtlpGrpcSpanExporterProviderTests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - */ - -package org.opensearch.telemetry.tracing.exporter; - -import org.opensearch.common.settings.Settings; -import org.opensearch.telemetry.OTelTelemetrySettings; -import org.opensearch.test.OpenSearchTestCase; - -public class OtlpGrpcSpanExporterProviderTests extends OpenSearchTestCase { - public void testSpanExporterInstantiatedProperly() { - Settings settings = Settings.builder() - .put( - OTelTelemetrySettings.OTEL_TRACER_SPAN_EXPORTER_CLASS_SETTING.getKey(), - "org.opensearch.telemetry.tracing.exporter.OtlpGrpcSpanExporterProvider" - ) - .build(); - - assertTrue(OTelSpanExporterFactory.create(settings) instanceof OtlpGrpcSpanExporterProvider); - } -} From 17d8c8dd05ae804fe1ab289bb7b672682c918879 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Wed, 20 Sep 2023 18:00:08 +0000 Subject: [PATCH 10/14] Updated dependencies Signed-off-by: Shephali Mittal --- plugins/telemetry-otel/build.gradle | 13 ------------- .../opentelemetry-exporter-common-1.26.0.jar.sha1 | 1 - .../opentelemetry-exporter-common-1.30.1.jar.sha1 | 1 + .../opentelemetry-exporter-otlp-1.26.0.jar.sha1 | 1 - .../opentelemetry-exporter-otlp-1.30.1.jar.sha1 | 1 + ...entelemetry-exporter-otlp-common-1.26.0.jar.sha1 | 1 - ...entelemetry-exporter-otlp-common-1.30.1.jar.sha1 | 1 + 7 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.30.1.jar.sha1 delete mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.30.1.jar.sha1 delete mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.30.1.jar.sha1 diff --git a/plugins/telemetry-otel/build.gradle b/plugins/telemetry-otel/build.gradle index 5c7dfcd2a3da7..26bcc1a747c59 100644 --- a/plugins/telemetry-otel/build.gradle +++ b/plugins/telemetry-otel/build.gradle @@ -30,7 +30,6 @@ dependencies { api "io.opentelemetry:opentelemetry-exporter-logging:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-semconv:${versions.opentelemetry}-alpha" api "io.opentelemetry:opentelemetry-sdk-logs:${versions.opentelemetry}" - api "io.opentelemetry:opentelemetry-api-logs:${versions.opentelemetry}-alpha" api "io.opentelemetry:opentelemetry-exporter-otlp:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-common:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-otlp-common:${versions.opentelemetry}" @@ -57,31 +56,19 @@ thirdPartyAudit { 'android.security.NetworkSecurityPolicy', 'android.util.Log', 'com.google.common.io.ByteStreams', - 'com.google.common.util.concurrent.FutureCallback', - 'com.google.common.util.concurrent.Futures', 'com.google.common.util.concurrent.ListenableFuture', - 'com.google.common.util.concurrent.MoreExecutors', 'io.grpc.CallOptions', 'io.grpc.Channel', - 'io.grpc.ClientInterceptor', - 'io.grpc.ClientInterceptors', - 'io.grpc.Codec', - 'io.grpc.Codec$Identity', 'io.grpc.Drainable', 'io.grpc.KnownLength', 'io.grpc.ManagedChannel', - 'io.grpc.Metadata', - 'io.grpc.Metadata$Key', 'io.grpc.MethodDescriptor', 'io.grpc.MethodDescriptor$Builder', 'io.grpc.MethodDescriptor$Marshaller', 'io.grpc.MethodDescriptor$MethodType', - 'io.grpc.Status', - 'io.grpc.Status$Code', 'io.grpc.stub.AbstractFutureStub', 'io.grpc.stub.AbstractStub', 'io.grpc.stub.ClientCalls', - 'io.grpc.stub.MetadataUtils', 'org.bouncycastle.jsse.BCSSLParameters', 'org.bouncycastle.jsse.BCSSLSocket', 'org.conscrypt.Conscrypt', diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 deleted file mode 100644 index 588736667f4ad..0000000000000 --- a/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.26.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f003bf36d89e59b6fa488f9a2428a2dbd48adca2 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.30.1.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.30.1.jar.sha1 new file mode 100644 index 0000000000000..eccb15f7b7c8e --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-common-1.30.1.jar.sha1 @@ -0,0 +1 @@ +f299d336dba1039478497f37b273dfa764c6faef \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 deleted file mode 100644 index 818338e8ab214..0000000000000 --- a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.26.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -b2ef104f9529d531e658e83f074dd1b51a497ba8 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.30.1.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.30.1.jar.sha1 new file mode 100644 index 0000000000000..e88b7514ee54d --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-1.30.1.jar.sha1 @@ -0,0 +1 @@ +15692246539571c41180aff2b55abe527b939a7b \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 deleted file mode 100644 index 792ba72f57e53..0000000000000 --- a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.26.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -7b72ec795f710bbd5392fe8dc268eeb5ed8be5f9 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.30.1.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.30.1.jar.sha1 new file mode 100644 index 0000000000000..86937743208c6 --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-otlp-common-1.30.1.jar.sha1 @@ -0,0 +1 @@ +947cf43a6411c4a323e14594431040a476ad43e8 \ No newline at end of file From 634930ee12422350c24123471a5c050ca885d627 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Thu, 21 Sep 2023 01:00:47 +0530 Subject: [PATCH 11/14] Added opentelemetry-exporter-sender-okhttp dependency Signed-off-by: Shephali Mittal --- plugins/telemetry-otel/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/telemetry-otel/build.gradle b/plugins/telemetry-otel/build.gradle index 26bcc1a747c59..dec7bb46bf227 100644 --- a/plugins/telemetry-otel/build.gradle +++ b/plugins/telemetry-otel/build.gradle @@ -33,6 +33,7 @@ dependencies { api "io.opentelemetry:opentelemetry-exporter-otlp:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-common:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-otlp-common:${versions.opentelemetry}" + api "io.opentelemetry:opentelemetry-exporter-sender-okhttp:${versions.opentelemetry}" api "com.squareup.okhttp3:okhttp:4.10.0" api "org.jetbrains.kotlin:kotlin-stdlib:1.6.20" api "com.squareup.okio:okio-jvm:3.0.0" From b0604daffaecb8ed0889fa514d133131ddf1924b Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Thu, 21 Sep 2023 11:57:52 +0530 Subject: [PATCH 12/14] Made opentelemetry-exporter-sender-okhttp dependency runtimeonly Signed-off-by: Shephali Mittal --- plugins/telemetry-otel/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/telemetry-otel/build.gradle b/plugins/telemetry-otel/build.gradle index dec7bb46bf227..ec755ceeb5d0c 100644 --- a/plugins/telemetry-otel/build.gradle +++ b/plugins/telemetry-otel/build.gradle @@ -33,10 +33,10 @@ dependencies { api "io.opentelemetry:opentelemetry-exporter-otlp:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-common:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-otlp-common:${versions.opentelemetry}" - api "io.opentelemetry:opentelemetry-exporter-sender-okhttp:${versions.opentelemetry}" api "com.squareup.okhttp3:okhttp:4.10.0" api "org.jetbrains.kotlin:kotlin-stdlib:1.6.20" api "com.squareup.okio:okio-jvm:3.0.0" + runtimeOnly "io.opentelemetry:opentelemetry-exporter-sender-okhttp:${versions.opentelemetry}" testImplementation "io.opentelemetry:opentelemetry-sdk-testing:${versions.opentelemetry}" } From c404b2002ca6a7366a6d83659b168ec4da9ebd5a Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Thu, 21 Sep 2023 06:46:09 +0000 Subject: [PATCH 13/14] Added license files for opentelemetry-exporter-sender-okhttp Signed-off-by: Shephali Mittal --- ...try-exporter-sender-okhttp-1.30.1.jar.sha1 | 1 + ...lemetry-exporter-sender-okhttp-LICENSE.txt | 203 ++++++++++++++++++ ...elemetry-exporter-sender-okhttp-NOTICE.txt | 0 3 files changed, 204 insertions(+) create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-1.30.1.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-LICENSE.txt create mode 100644 plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-NOTICE.txt diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-1.30.1.jar.sha1 b/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-1.30.1.jar.sha1 new file mode 100644 index 0000000000000..068926277253c --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-1.30.1.jar.sha1 @@ -0,0 +1 @@ +9f3a14515500e4df260ce7b10a668237a95ac791 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-LICENSE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-LICENSE.txt new file mode 100644 index 0000000000000..6b0b1270ff0ca --- /dev/null +++ b/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-NOTICE.txt b/plugins/telemetry-otel/licenses/opentelemetry-exporter-sender-okhttp-NOTICE.txt new file mode 100644 index 0000000000000..e69de29bb2d1d From afdb9b27203543e753a5f7f39cd0e70942d21117 Mon Sep 17 00:00:00 2001 From: Shephali Mittal Date: Thu, 21 Sep 2023 13:04:26 +0000 Subject: [PATCH 14/14] Updated okhttp dependencies to runtime only Signed-off-by: Shephali Mittal --- plugins/telemetry-otel/build.gradle | 9 +++++---- .../licenses/kotlin-stdlib-1.6.20.jar.sha1 | 1 - .../licenses/kotlin-stdlib-1.7.10.jar.sha1 | 1 + plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 | 1 - plugins/telemetry-otel/licenses/okhttp-4.11.0.jar.sha1 | 1 + plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 | 1 - plugins/telemetry-otel/licenses/okio-jvm-3.5.0.jar.sha1 | 1 + 7 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/kotlin-stdlib-1.7.10.jar.sha1 delete mode 100644 plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/okhttp-4.11.0.jar.sha1 delete mode 100644 plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 create mode 100644 plugins/telemetry-otel/licenses/okio-jvm-3.5.0.jar.sha1 diff --git a/plugins/telemetry-otel/build.gradle b/plugins/telemetry-otel/build.gradle index ec755ceeb5d0c..45c9f522c09d8 100644 --- a/plugins/telemetry-otel/build.gradle +++ b/plugins/telemetry-otel/build.gradle @@ -33,9 +33,9 @@ dependencies { api "io.opentelemetry:opentelemetry-exporter-otlp:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-common:${versions.opentelemetry}" api "io.opentelemetry:opentelemetry-exporter-otlp-common:${versions.opentelemetry}" - api "com.squareup.okhttp3:okhttp:4.10.0" - api "org.jetbrains.kotlin:kotlin-stdlib:1.6.20" - api "com.squareup.okio:okio-jvm:3.0.0" + runtimeOnly "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}" + runtimeOnly "com.squareup.okhttp3:okhttp:4.11.0" + runtimeOnly "com.squareup.okio:okio-jvm:3.5.0" runtimeOnly "io.opentelemetry:opentelemetry-exporter-sender-okhttp:${versions.opentelemetry}" testImplementation "io.opentelemetry:opentelemetry-sdk-testing:${versions.opentelemetry}" } @@ -101,7 +101,8 @@ thirdPartyAudit { 'io.opentelemetry.extension.incubator.metrics.LongGauge', 'io.opentelemetry.extension.incubator.metrics.LongGaugeAdviceConfigurer', 'io.opentelemetry.extension.incubator.metrics.LongHistogramAdviceConfigurer', - 'io.opentelemetry.extension.incubator.metrics.LongUpDownCounterAdviceConfigurer' + 'io.opentelemetry.extension.incubator.metrics.LongUpDownCounterAdviceConfigurer', + 'kotlin.io.path.PathsKt' ) } diff --git a/plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 b/plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 deleted file mode 100644 index a26a3b6591dcf..0000000000000 --- a/plugins/telemetry-otel/licenses/kotlin-stdlib-1.6.20.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -6cedc143badbb4f1c6b7f5a340b04edff1743208 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/kotlin-stdlib-1.7.10.jar.sha1 b/plugins/telemetry-otel/licenses/kotlin-stdlib-1.7.10.jar.sha1 new file mode 100644 index 0000000000000..4d119fbf4df70 --- /dev/null +++ b/plugins/telemetry-otel/licenses/kotlin-stdlib-1.7.10.jar.sha1 @@ -0,0 +1 @@ +d2abf9e77736acc4450dc4a3f707fa2c10f5099d \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 b/plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 deleted file mode 100644 index 7cd464ff3effb..0000000000000 --- a/plugins/telemetry-otel/licenses/okhttp-4.10.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -cd63657ac15770ed1420647154c9f44645533bef \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/okhttp-4.11.0.jar.sha1 b/plugins/telemetry-otel/licenses/okhttp-4.11.0.jar.sha1 new file mode 100644 index 0000000000000..1fc0db6615cb5 --- /dev/null +++ b/plugins/telemetry-otel/licenses/okhttp-4.11.0.jar.sha1 @@ -0,0 +1 @@ +436932d695b2c43f2c86b8111c596179cd133d56 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 b/plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 deleted file mode 100644 index b75b63ec015bd..0000000000000 --- a/plugins/telemetry-otel/licenses/okio-jvm-3.0.0.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -0ab5a73fa2ccb4a36b0b5c69fe10b16d0255bcf8 \ No newline at end of file diff --git a/plugins/telemetry-otel/licenses/okio-jvm-3.5.0.jar.sha1 b/plugins/telemetry-otel/licenses/okio-jvm-3.5.0.jar.sha1 new file mode 100644 index 0000000000000..7b19d32d872fa --- /dev/null +++ b/plugins/telemetry-otel/licenses/okio-jvm-3.5.0.jar.sha1 @@ -0,0 +1 @@ +d6a0bc7343210eff7dd5cfdd6eb9b5f0036638ce \ No newline at end of file