diff --git a/NOTICE-fips.txt b/NOTICE-fips.txt index b040e09955c..2139ed4982c 100644 --- a/NOTICE-fips.txt +++ b/NOTICE-fips.txt @@ -18569,6 +18569,218 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/rece limitations under the License. +-------------------------------------------------------------------------------- +Dependency : go.opentelemetry.io/collector/service +Version: v0.132.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.132.0/LICENSE: + + + 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. + + -------------------------------------------------------------------------------- Dependency : go.uber.org/zap Version: v1.27.0 @@ -79599,218 +79811,6 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semc limitations under the License. --------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/service -Version: v0.132.0 -Licence type (autodetected): Apache-2.0 --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.132.0/LICENSE: - - - 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. - - -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/service/hostcapabilities Version: v0.132.0 diff --git a/NOTICE.txt b/NOTICE.txt index 7bf9f5ee2ec..e29a8917eb9 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -19202,6 +19202,218 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/rece limitations under the License. +-------------------------------------------------------------------------------- +Dependency : go.opentelemetry.io/collector/service +Version: v0.132.0 +Licence type (autodetected): Apache-2.0 +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.132.0/LICENSE: + + + 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. + + -------------------------------------------------------------------------------- Dependency : go.uber.org/zap Version: v1.27.0 @@ -89824,218 +90036,6 @@ Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/semc limitations under the License. --------------------------------------------------------------------------------- -Dependency : go.opentelemetry.io/collector/service -Version: v0.132.0 -Licence type (autodetected): Apache-2.0 --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/go.opentelemetry.io/collector/service@v0.132.0/LICENSE: - - - 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. - - -------------------------------------------------------------------------------- Dependency : go.opentelemetry.io/collector/service/hostcapabilities Version: v0.132.0 diff --git a/changelog/fragments/1759257958-collector-telemetry-monitoring.yaml b/changelog/fragments/1759257958-collector-telemetry-monitoring.yaml new file mode 100644 index 00000000000..efb7ad8bc0a --- /dev/null +++ b/changelog/fragments/1759257958-collector-telemetry-monitoring.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: enhancement + +# Change summary; a 80ish characters long description of the change. +summary: Include OTel Collector internal telemetry in Agent monitoring + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: elastic-agent + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +#pr: https://github.com/owner/repo/1234 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/go.mod b/go.mod index d74c3934376..c9dd3016494 100644 --- a/go.mod +++ b/go.mod @@ -84,6 +84,7 @@ require ( go.opentelemetry.io/collector/pipeline v1.38.0 go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.132.0 go.opentelemetry.io/collector/receiver/nopreceiver v0.132.0 + go.opentelemetry.io/collector/service v0.132.0 go.uber.org/zap v1.27.0 golang.org/x/crypto v0.41.0 golang.org/x/exp v0.0.0-20250215185904-eff6e970281f @@ -686,7 +687,6 @@ require ( go.opentelemetry.io/collector/scraper v0.132.0 // indirect go.opentelemetry.io/collector/scraper/scraperhelper v0.132.0 // indirect go.opentelemetry.io/collector/semconv v0.128.1-0.20250610090210-188191247685 // indirect - go.opentelemetry.io/collector/service v0.132.0 // indirect go.opentelemetry.io/collector/service/hostcapabilities v0.132.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.12.0 // indirect go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect diff --git a/internal/pkg/agent/application/application.go b/internal/pkg/agent/application/application.go index 9a2275aef0a..9e54566b675 100644 --- a/internal/pkg/agent/application/application.go +++ b/internal/pkg/agent/application/application.go @@ -128,7 +128,7 @@ func New( if err != nil { return nil, nil, nil, fmt.Errorf("failed to create upgrader: %w", err) } - monitor := monitoring.New(isMonitoringSupported, cfg.Settings.DownloadConfig.OS(), cfg.Settings.MonitoringConfig, agentInfo) + monitor := monitoring.New(isMonitoringSupported, cfg.Settings.DownloadConfig.OS(), cfg.Settings.MonitoringConfig, rawConfig.OTel, agentInfo) runtime, err := runtime.NewManager( log, diff --git a/internal/pkg/agent/application/coordinator/coordinator.go b/internal/pkg/agent/application/coordinator/coordinator.go index fa93dae3879..c8ec393e004 100644 --- a/internal/pkg/agent/application/coordinator/coordinator.go +++ b/internal/pkg/agent/application/coordinator/coordinator.go @@ -88,7 +88,7 @@ type MonitorManager interface { // Enabled when configured to collect metrics/logs. Enabled() bool - // Reload reloads the configuration for the upgrade manager. + // Reload reloads the configuration for the monitoring manager. Reload(rawConfig *config.Config) error // MonitoringConfig injects monitoring configuration into resolved ast tree. diff --git a/internal/pkg/agent/application/monitoring/otel_remap.js b/internal/pkg/agent/application/monitoring/otel_remap.js new file mode 100644 index 00000000000..cdb6586dfd2 --- /dev/null +++ b/internal/pkg/agent/application/monitoring/otel_remap.js @@ -0,0 +1,139 @@ +// A script for use in the Beats script processor, to remap raw OTel telemetry +// from its prometheus endpoint to backwards-compatible Beats metrics fields +// that can be viewed in Agent dashboards. + +function process(event) { + // This hard-coded exporter name will not work for the general + // (non-monitoring) use case. + var elastic_exporter = event.Get("prometheus.labels.exporter") == "elasticsearch/_agent-component/monitoring"; + var elastic_scope = event.Get("prometheus.labels.otel_scope_name") == "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter"; + + // We accept general collector fields that are scoped to the elasticsearch + // exporter (queue metrics, sent / error stats), or fields specifically + // scoped to the elasticsearch exporter (custom elastic metrics). + if (!elastic_exporter && !elastic_scope) { + event.Cancel(); + return; + } + + // Hack: if the scope is elastic-custom fields, deterministically mangle the + // agent.id. Since the label set is different, these are passed through in + // different events, and if we don't do this one of the events will be + // rejected as a duplicate since they have the same component id, agent id, + // and metricset. + var id = event.Get("agent.id"); + if (id != null && id.length > 0) { + // Increment / wrap the last hex character of the uuid + var prefix = id.substring(0, id.length - 1); + var last = id.substring(id.length - 1); + var rotated = "0"; + if (last < "f") { + rotated = String.fromCharCode(last.charCodeAt(0) + 1); + } + id = prefix + rotated; + event.Put("agent.id", id); + } + + // The event will be discarded unless we find some valid metric to convert. + var keep_event = false; + + var queue_size = event.Get("prometheus.metrics.otelcol_exporter_queue_size"); + var queue_capacity = event.Get("prometheus.metrics.otelcol_exporter_queue_capacity"); + if (queue_size != null) { + keep_event = true; + event.Put("beat.stats.libbeat.pipeline.queue.filled.events", queue_size); + } + if (queue_capacity != null) { + keep_event = true; + event.Put("beat.stats.libbeat.pipeline.queue.max_events", queue_capacity); + } + if (queue_size != null && queue_capacity != null) { + var queue_pct = queue_size / queue_capacity; + if (!isNaN(queue_pct)) { + event.Put("beat.stats.libbeat.pipeline.queue.filled.pct", queue_pct); + } + } + + var total_sent = 0; + var total_sent_valid = false; + // Add send statistics from all source types + var sent_logs = event.Get("prometheus.metrics.otelcol_exporter_sent_log_records_total"); + if (sent_logs != null) { + total_sent += sent_logs; + total_sent_valid = true; + } + var sent_spans = event.Get("prometheus.metrics.otelcol_exporter_sent_spans_total"); + if (sent_spans != null) { + total_sent += sent_spans; + total_sent_valid = true; + } + var sent_metrics = event.Get("prometheus.metrics.otelcol_exporter_sent_metric_points_total"); + if (sent_metrics != null) { + total_sent += sent_metrics; + total_sent_valid = true; + } + if (total_sent_valid) { + event.Put("beat.stats.libbeat.output.events.acked", total_sent); + keep_event = true; + } + + var total_failed = 0; + var total_failed_valid = false; + // Add failed statistics from all source types + var failed_logs = event.Get("prometheus.metrics.otelcol_exporter_send_failed_log_records_total"); + if (failed_logs != null) { + total_failed += failed_logs; + total_failed_valid = true; + } + var failed_spans = event.Get("prometheus.metrics.otelcol_exporter_send_failed_spans_total"); + if (failed_spans != null) { + total_failed += failed_spans; + total_failed_valid = true; + } + var failed_metrics = event.Get("prometheus.metrics.otelcol_exporter_send_failed_metric_points_total"); + if (failed_metrics != null) { + total_failed += failed_metrics; + total_failed_valid = true; + } + if (total_failed_valid) { + event.Put("beat.stats.libbeat.output.events.dropped", total_failed); + keep_event = true; + } + + var flushed_bytes = event.Get("prometheus.metrics.otelcol_elasticsearch_flushed_bytes_total"); + if (flushed_bytes != null) { + event.Put("beat.stats.libbeat.output.write.bytes", flushed_bytes); + keep_event = true; + } + + var retried_docs = event.Get("prometheus.metrics.otelcol_elasticsearch_docs_retried_ratio_total"); + if (retried_docs != null) { + // "failed" in the beats metric means an event failed to ingest but was + // not dropped, and will be retried. + event.Put("beat.stats.libbeat.output.events.failed", retried_docs); + keep_event = true; + } + + var request_count = event.Get("prometheus.metrics.otelcol_elasticsearch_bulk_requests_count_ratio_total"); + if (request_count != null) { + // This is not an exact semantic match for how Beats measures batch count, + // but it's close. + event.Put("beat.stats.libbeat.output.events.batches", request_count); + keep_event = true; + } + + var processed_docs_count = event.Get("prometheus.metrics.otelcol_elasticsearch_docs_processed_ratio_total"); + if (processed_docs_count != null) { + // Approximate semantic match: the otel metric counts all document + // ingestion attempts, including success, failure, and retries, + // which is a better match for the Beats definition of total events + // than otelcol_elasticsearch_docs_received_ratio_total which + // includes only unique events seen (regardless of retries etc). + event.Put("beat.stats.libbeat.output.events.total", processed_docs_count); + keep_event = true; + } + + if (!keep_event) { + event.Cancel(); + } +} diff --git a/internal/pkg/agent/application/monitoring/testdata/monitoring_config_full.yaml b/internal/pkg/agent/application/monitoring/testdata/monitoring_config_full.yaml index 7ee1db80671..c662b011273 100644 --- a/internal/pkg/agent/application/monitoring/testdata/monitoring_config_full.yaml +++ b/internal/pkg/agent/application/monitoring/testdata/monitoring_config_full.yaml @@ -308,6 +308,45 @@ inputs: binary: metricbeat id: http/metrics-monitoring target: component + - data_stream: + dataset: elastic_agent.metricbeat + namespace: default + type: metrics + failure_threshold: 5 + hosts: + - placeholder + id: metrics-monitoring-metricbeat + index: metrics-elastic_agent.metricbeat-default + metricsets: + - stats + period: 1m0s + processors: + - add_fields: + fields: + dataset: elastic_agent.metricbeat + namespace: default + type: metrics + target: data_stream + - add_fields: + fields: + dataset: elastic_agent.metricbeat + target: event + - add_fields: + fields: + id: "" + process: metricbeat + snapshot: false + version: placeholder + target: elastic_agent + - add_fields: + fields: + id: "" + target: agent + - add_fields: + fields: + binary: metricbeat + id: prometheus/metrics-monitoring + target: component type: beat/metrics use_output: monitoring - data_stream: @@ -765,8 +804,183 @@ inputs: binary: metricbeat id: http/metrics-monitoring target: component + - data_stream: + dataset: elastic_agent.elastic_agent + namespace: default + type: metrics + failure_threshold: 5 + hosts: + - placeholder + id: metrics-monitoring-metricbeat-1 + index: metrics-elastic_agent.elastic_agent-default + metricsets: + - json + namespace: agent + path: /stats + period: 1m0s + processors: + - add_fields: + fields: + dataset: elastic_agent.elastic_agent + target: event + - add_fields: + fields: + id: "" + process: metricbeat + snapshot: false + version: placeholder + target: elastic_agent + - add_fields: + fields: + id: "" + target: agent + - copy_fields: + fail_on_error: false + fields: + - from: http.agent.beat.cpu + to: system.process.cpu + - from: http.agent.beat.memstats.memory_sys + to: system.process.memory.size + - from: http.agent.beat.handles + to: system.process.fd + - from: http.agent.beat.cgroup + to: system.process.cgroup + - from: http.agent.apm-server + to: apm-server + - from: http.filebeat_input + to: filebeat_input + ignore_missing: true + - drop_fields: + fields: + - http + ignore_missing: true + - add_fields: + fields: + binary: metricbeat + id: prometheus/metrics-monitoring + target: component type: http/metrics use_output: monitoring +- data_stream: + namespace: default + id: metrics-monitoring-collector + name: metrics-monitoring-collector + streams: + - data_stream: + dataset: elastic_agent.collector + namespace: default + type: metrics + failure_threshold: 5 + hosts: + - placeholder + id: metrics-monitoring-collector + index: metrics-elastic_agent.collector-default + metrics_path: /metrics + metricsets: + - collector + namespace: default + period: 1m0s + processors: + - add_fields: + fields: + dataset: elastic_agent.collector + namespace: default + type: metrics + target: data_stream + - add_fields: + fields: + dataset: elastic_agent.collector + target: event + - add_fields: + fields: + id: "" + process: elastic-agent + snapshot: false + version: placeholder + target: elastic_agent + - add_fields: + fields: + id: "" + target: agent + - add_fields: + fields: + binary: elastic-agent + id: elastic-agent/collector + target: component + - add_fields: + fields: + name: stats + target: metricset + - script: + lang: javascript + source: "// A script for use in the Beats script processor, to remap raw OTel + telemetry\n// from its prometheus endpoint to backwards-compatible Beats + metrics fields\n// that can be viewed in Agent dashboards.\n\nfunction process(event) + {\n // This hard-coded exporter name will not work for the general\n // + (non-monitoring) use case.\n var elastic_exporter = event.Get(\"prometheus.labels.exporter\") + == \"elasticsearch/_agent-component/monitoring\";\n var elastic_scope = + event.Get(\"prometheus.labels.otel_scope_name\") == \"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/elasticsearchexporter\";\n\n + \ // We accept general collector fields that are scoped to the elasticsearch\n + \ // exporter (queue metrics, sent / error stats), or fields specifically\n + \ // scoped to the elasticsearch exporter (custom elastic metrics).\n if + (!elastic_exporter && !elastic_scope) {\n event.Cancel();\n return;\n + \ }\n\n // Hack: if the scope is elastic-custom fields, deterministically + mangle the\n // agent.id. Since the label set is different, these are passed + through in\n // different events, and if we don't do this one of the events + will be\n // rejected as a duplicate since they have the same component + id, agent id,\n // and metricset.\n var id = event.Get(\"agent.id\");\n + \ if (id != null && id.length > 0) {\n // Increment / wrap the last hex + character of the uuid\n var prefix = id.substring(0, id.length - 1);\n + \ var last = id.substring(id.length - 1);\n var rotated = \"0\";\n + \ if (last < \"f\") {\n rotated = String.fromCharCode(last.charCodeAt(0) + + 1);\n }\n id = prefix + rotated;\n event.Put(\"agent.id\", id);\n + \ }\n\n // The event will be discarded unless we find some valid metric + to convert.\n\tvar keep_event = false;\n\n\tvar queue_size = event.Get(\"prometheus.metrics.otelcol_exporter_queue_size\");\n\tvar + queue_capacity = event.Get(\"prometheus.metrics.otelcol_exporter_queue_capacity\");\n + \ if (queue_size != null) {\n \tkeep_event = true;\n event.Put(\"beat.stats.libbeat.pipeline.queue.filled.events\", + queue_size);\n }\n if (queue_capacity != null) {\n \tkeep_event = true;\n + \ event.Put(\"beat.stats.libbeat.pipeline.queue.max_events\", queue_capacity);\n + \ }\n\tif (queue_size != null && queue_capacity != null) {\n\t\tvar queue_pct + = queue_size / queue_capacity;\n\t\tif (!isNaN(queue_pct)) {\n\t\t\tevent.Put(\"beat.stats.libbeat.pipeline.queue.filled.pct\", + queue_pct);\n\t\t}\n\t}\n \n var total_sent = 0;\n var total_sent_valid + = false;\n // Add send statistics from all source types\n var sent_logs + = event.Get(\"prometheus.metrics.otelcol_exporter_sent_log_records_total\");\n + \ if (sent_logs != null) {\n total_sent += sent_logs;\n total_sent_valid + = true;\n }\n var sent_spans = event.Get(\"prometheus.metrics.otelcol_exporter_sent_spans_total\");\n + \ if (sent_spans != null) {\n total_sent += sent_spans;\n total_sent_valid + = true;\n }\n var sent_metrics = event.Get(\"prometheus.metrics.otelcol_exporter_sent_metric_points_total\");\n + \ if (sent_metrics != null) {\n total_sent += sent_metrics;\n total_sent_valid + = true;\n }\n if (total_sent_valid) {\n event.Put(\"beat.stats.libbeat.output.events.acked\", + total_sent);\n \tkeep_event = true;\n }\n\n var total_failed = 0;\n var + total_failed_valid = false;\n // Add failed statistics from all source + types\n var failed_logs = event.Get(\"prometheus.metrics.otelcol_exporter_send_failed_log_records_total\");\n + \ if (failed_logs != null) {\n total_failed += failed_logs;\n total_failed_valid + = true;\n }\n var failed_spans = event.Get(\"prometheus.metrics.otelcol_exporter_send_failed_spans_total\");\n + \ if (failed_spans != null) {\n total_failed += failed_spans;\n total_failed_valid + = true;\n }\n var failed_metrics = event.Get(\"prometheus.metrics.otelcol_exporter_send_failed_metric_points_total\");\n + \ if (failed_metrics != null) {\n total_failed += failed_metrics;\n total_failed_valid + = true;\n }\n if (total_failed_valid) {\n event.Put(\"beat.stats.libbeat.output.events.dropped\", + total_failed);\n \tkeep_event = true;\n }\n\n var flushed_bytes = event.Get(\"prometheus.metrics.otelcol_elasticsearch_flushed_bytes_total\");\n + \ if (flushed_bytes != null) {\n event.Put(\"beat.stats.libbeat.output.write.bytes\", + flushed_bytes);\n \tkeep_event = true;\n }\n\n var retried_docs = event.Get(\"prometheus.metrics.otelcol_elasticsearch_docs_retried_ratio_total\");\n + \ if (retried_docs != null) {\n // \"failed\" in the beats metric means + an event failed to ingest but was\n // not dropped, and will be retried.\n + \ event.Put(\"beat.stats.libbeat.output.events.failed\", retried_docs);\n + \ \tkeep_event = true;\n }\n\n var request_count = event.Get(\"prometheus.metrics.otelcol_elasticsearch_bulk_requests_count_ratio_total\");\n + \ if (request_count != null) {\n // This is not an exact semantic match + for how Beats measures batch count,\n // but it's close.\n event.Put(\"beat.stats.libbeat.output.events.batches\", + request_count);\n \tkeep_event = true;\n }\n\n var processed_docs_count + = event.Get(\"prometheus.metrics.otelcol_elasticsearch_docs_processed_ratio_total\");\n + \ if (processed_docs_count != null) {\n // Approximate semantic match: + the otel metric counts all document\n // ingestion attempts, including + success, failure, and retries,\n // which is a better match for the Beats + definition of total events\n // than otelcol_elasticsearch_docs_received_ratio_total + which\n // includes only unique events seen (regardless of retries etc).\n + \ event.Put(\"beat.stats.libbeat.output.events.total\", processed_docs_count);\n + \ \tkeep_event = true;\n }\n\n if (!keep_event) {\n event.Cancel();\n + \ }\n}\n" + type: prometheus/metrics + use_output: monitoring - data_stream: namespace: default id: metrics-monitoring-endpoint_security diff --git a/internal/pkg/agent/application/monitoring/v1_monitor.go b/internal/pkg/agent/application/monitoring/v1_monitor.go index 8fccd9805b2..099804efa8c 100644 --- a/internal/pkg/agent/application/monitoring/v1_monitor.go +++ b/internal/pkg/agent/application/monitoring/v1_monitor.go @@ -6,6 +6,7 @@ package monitoring import ( "crypto/sha256" + _ "embed" "fmt" "maps" "math" @@ -20,6 +21,9 @@ import ( "time" "unicode" + "go.opentelemetry.io/collector/confmap" + "go.opentelemetry.io/collector/service" + "github.com/elastic/elastic-agent/pkg/component" "github.com/elastic/elastic-agent/pkg/utils" @@ -52,6 +56,7 @@ const ( idKey = "id" agentKey = "agent" monitoringKey = "monitoring" + serviceKey = "service" useOutputKey = "use_output" monitoringMetricsPeriodKey = "metrics_period" failureThresholdKey = "failure_threshold" @@ -60,6 +65,7 @@ const ( agentName = "elastic-agent" metricBeatName = "metricbeat" fileBeatName = "filebeat" + collectorName = "collector" monitoringMetricsUnitID = "metrics-monitoring" monitoringFilesUnitsID = "filestream-monitoring" @@ -86,6 +92,7 @@ var ( type BeatsMonitor struct { enabled bool // feature flag disabling whole v1 monitoring story config *monitoringConfig + otelConfig *confmap.Conf operatingSystem string agentInfo info.Agent } @@ -106,12 +113,13 @@ type monitoringConfig struct { } // New creates a new BeatsMonitor instance. -func New(enabled bool, operatingSystem string, cfg *monitoringCfg.MonitoringConfig, agentInfo info.Agent) *BeatsMonitor { +func New(enabled bool, operatingSystem string, cfg *monitoringCfg.MonitoringConfig, otelCfg *confmap.Conf, agentInfo info.Agent) *BeatsMonitor { return &BeatsMonitor{ enabled: enabled, config: &monitoringConfig{ C: cfg, }, + otelConfig: otelCfg, operatingSystem: operatingSystem, agentInfo: agentInfo, } @@ -138,6 +146,7 @@ func (b *BeatsMonitor) Reload(rawConfig *config.Config) error { } b.config = &newConfig + b.otelConfig = rawConfig.OTel return nil } @@ -349,6 +358,15 @@ func (b *BeatsMonitor) Prepare(unit string) error { return nil } +func usingOtelRuntime(componentInfos []componentInfo) bool { + for _, ci := range componentInfos { + if ci.RuntimeManager == component.OtelRuntimeManager { + return true + } + } + return false +} + // Cleanup removes files that were created for monitoring. func (b *BeatsMonitor) Cleanup(unit string) error { if !b.Enabled() { @@ -435,6 +453,16 @@ func (b *BeatsMonitor) getComponentInfos(components []component.Component, compo RuntimeManager: component.RuntimeManager(b.config.C.RuntimeManager), }) } + // If any other component uses the Otel runtime, also add a component to monitor + // its telemetry. + if b.config.C.MonitorMetrics && usingOtelRuntime(componentInfos) { + componentInfos = append(componentInfos, + componentInfo{ + ID: fmt.Sprintf("prometheus/%s", monitoringMetricsUnitID), + BinaryName: metricBeatName, + RuntimeManager: component.RuntimeManager(b.config.C.RuntimeManager), + }) + } // sort the components to ensure a consistent order of inputs in the configuration slices.SortFunc(componentInfos, func(a, b componentInfo) int { return strings.Compare(a.ID, b.ID) @@ -486,6 +514,37 @@ func (b *BeatsMonitor) monitoringNamespace() string { return defaultMonitoringNamespace } +func (b *BeatsMonitor) getCollectorTelemetryEndpoint() string { + if b.otelConfig != nil { + if serviceConfig, err := b.otelConfig.Sub("service"); err == nil { + var service service.Config + if serviceConfig.Unmarshal(&service, confmap.WithIgnoreUnused()) == nil { + for _, reader := range service.Telemetry.Metrics.Readers { + if reader.Pull == nil || reader.Pull.Exporter.Prometheus == nil { + continue + } + prometheus := *reader.Pull.Exporter.Prometheus + host := "localhost" + port := 8888 + + if prometheus.Host != nil { + host = *prometheus.Host + } + if prometheus.Port != nil { + port = *prometheus.Port + } + if prometheus.Host != nil || prometheus.Port != nil { + return host + ":" + strconv.Itoa(port) + } + } + } + } + } + + // If there is no explicit configuration, the collector publishes its telemetry on port 8888. + return "localhost:8888" +} + // injectMetricsInput injects monitoring config for agent monitoring to the `cfg` object. func (b *BeatsMonitor) injectMetricsInput( cfg map[string]interface{}, @@ -529,6 +588,20 @@ func (b *BeatsMonitor) injectMetricsInput( }, } + if usingOtelRuntime(componentInfos) { + prometheusStream := b.getPrometheusStream(failureThreshold, metricsCollectionIntervalString) + inputs = append(inputs, map[string]interface{}{ + idKey: fmt.Sprintf("%s-collector", monitoringMetricsUnitID), + "name": fmt.Sprintf("%s-collector", monitoringMetricsUnitID), + "type": "prometheus/metrics", + useOutputKey: monitoringOutput, + "data_stream": map[string]interface{}{ + "namespace": monitoringNamespace, + }, + "streams": []any{prometheusStream}, + }) + } + // Make sure we don't set anything until the configuration is stable if the otel manager isn't enabled if b.config.C.RuntimeManager != monitoringCfg.DefaultRuntimeManager { for _, input := range inputs { @@ -730,6 +803,45 @@ func (b *BeatsMonitor) getHttpStreams( return httpStreams } +// getPrometheusStream returns the stream definition for prometheus/metrics input. +// Note: The return type must be []any due to protobuf serialization quirks. +func (b *BeatsMonitor) getPrometheusStream( + failureThreshold *uint, + metricsCollectionIntervalString string, +) any { + monitoringNamespace := b.monitoringNamespace() + + // Send these metrics through the metricbeat monitoring datastream, since + // the processors will convert any usable metrics into ECS equivalents + // so they're visible in Agent dashboards. + dataset := fmt.Sprintf("elastic_agent.%s", collectorName) + indexName := fmt.Sprintf("metrics-%s-%s", dataset, monitoringNamespace) + + prometheusHost := b.getCollectorTelemetryEndpoint() + + otelStream := map[string]any{ + idKey: fmt.Sprintf("%s-collector", monitoringMetricsUnitID), + "data_stream": map[string]interface{}{ + "type": "metrics", + "dataset": dataset, + "namespace": monitoringNamespace, + }, + // "collector" here is the coincidental name of the Prometheus metricset + // in metricbeat, nothing to do with the OTel collector. + "metricsets": []interface{}{"collector"}, + "metrics_path": "/metrics", + "hosts": []interface{}{prometheusHost}, + "namespace": monitoringNamespace, + "period": metricsCollectionIntervalString, + "index": indexName, + "processors": processorsForCollectorPrometheusStream(monitoringNamespace, dataset, b.agentInfo), + } + if failureThreshold != nil { + otelStream[failureThresholdKey] = *failureThreshold + } + return otelStream +} + // getBeatsStreams returns stream definitions for beats inputs. // Note: The return type must be []any due to protobuf serialization quirks. func (b *BeatsMonitor) getBeatsStreams( @@ -943,6 +1055,45 @@ func processorsForAgentHttpStream(namespace, dataset string, agentInfo info.Agen } } +// processorsForCollectorPrometheusStream returns the processors used for the OTel +// collector prometheus metrics +func processorsForCollectorPrometheusStream(namespace, dataset string, agentInfo info.Agent) []any { + return []interface{}{ + addDataStreamFieldsProcessor(dataset, namespace), + addEventFieldsProcessor(dataset), + addElasticAgentFieldsProcessor(agentName, agentInfo), + addAgentFieldsProcessor(agentInfo.AgentID()), + addComponentFieldsProcessor(agentName, agentName+"/"+collectorName), + // Set the metricset name to "stats" since we're remapping the OTel + // telemetry to look like the Beats stats metricset. + addMetricsetOverrideProcessor("stats"), + addPrometheusMetricsRemapProcessor(), + } +} + +func addMetricsetOverrideProcessor(metricset string) map[string]any { + return map[string]any{ + "add_fields": map[string]any{ + "target": "metricset", + "fields": map[string]any{ + "name": metricset, + }, + }, + } +} + +//go:embed otel_remap.js +var prometheusRemapJS string + +func addPrometheusMetricsRemapProcessor() map[string]any { + return map[string]any{ + "script": map[string]any{ + "lang": "javascript", + "source": prometheusRemapJS, + }, + } +} + // addElasticAgentFieldsProcessor returns a processor definition that adds agent information in an `elastic_agent` field. func addElasticAgentFieldsProcessor(binaryName string, agentInfo info.Agent) map[string]any { return map[string]any{ diff --git a/internal/pkg/agent/application/monitoring/v1_monitor_test.go b/internal/pkg/agent/application/monitoring/v1_monitor_test.go index 8ab48f0d9e3..677b9b57022 100644 --- a/internal/pkg/agent/application/monitoring/v1_monitor_test.go +++ b/internal/pkg/agent/application/monitoring/v1_monitor_test.go @@ -1066,7 +1066,7 @@ func TestMonitorReload(t *testing.T) { monitorcfg.MonitorLogs = false monitorcfg.MonitorMetrics = false - beatsMonitor := New(true, "", monitorcfg, nil) + beatsMonitor := New(true, "", monitorcfg, nil, nil) assert.Equal(t, beatsMonitor.config.C.MonitorLogs, false) assert.Equal(t, beatsMonitor.config.C.MonitorLogs, false) diff --git a/internal/pkg/agent/cmd/inspect.go b/internal/pkg/agent/cmd/inspect.go index b71096626f1..b0ffcbf15b4 100644 --- a/internal/pkg/agent/cmd/inspect.go +++ b/internal/pkg/agent/cmd/inspect.go @@ -12,6 +12,7 @@ import ( "time" "github.com/spf13/cobra" + "go.opentelemetry.io/collector/confmap" "gopkg.in/yaml.v2" "github.com/elastic/elastic-agent-libs/logp" @@ -157,7 +158,7 @@ func inspectConfig(ctx context.Context, cfgPath string, opts inspectConfigOpts, return nil } - cfg, lvl, err := getConfigWithVariables(ctx, l, cfgPath, opts.variablesWait, !isAdmin) + cfg, otel, lvl, err := getConfigWithVariables(ctx, l, cfgPath, opts.variablesWait, !isAdmin) if err != nil { return fmt.Errorf("error fetching config with variables: %w", err) } @@ -179,7 +180,7 @@ func inspectConfig(ctx context.Context, cfgPath string, opts inspectConfigOpts, return fmt.Errorf("failed to detect inputs and outputs: %w", err) } - monitorFn, err := getMonitoringFn(ctx, cfg) + monitorFn, err := getMonitoringFn(ctx, cfg, otel) if err != nil { return fmt.Errorf("failed to get monitoring: %w", err) } @@ -369,12 +370,12 @@ func getComponentsFromPolicy(ctx context.Context, l *logger.Logger, cfgPath stri return nil, fmt.Errorf("error checking for root/Administrator privileges: %w", err) } - m, lvl, err := getConfigWithVariables(ctx, l, cfgPath, variablesWait, !isAdmin) + m, otel, lvl, err := getConfigWithVariables(ctx, l, cfgPath, variablesWait, !isAdmin) if err != nil { return nil, err } - monitorFn, err := getMonitoringFn(ctx, m) + monitorFn, err := getMonitoringFn(ctx, m, otel) if err != nil { return nil, fmt.Errorf("failed to get monitoring: %w", err) } @@ -393,7 +394,7 @@ func getComponentsFromPolicy(ctx context.Context, l *logger.Logger, cfgPath stri return comps, nil } -func getMonitoringFn(ctx context.Context, cfg map[string]interface{}) (component.GenerateMonitoringCfgFn, error) { +func getMonitoringFn(ctx context.Context, cfg map[string]interface{}, otelCfg *confmap.Conf) (component.GenerateMonitoringCfgFn, error) { config, err := config.NewConfigFrom(cfg) if err != nil { return nil, err @@ -409,33 +410,33 @@ func getMonitoringFn(ctx context.Context, cfg map[string]interface{}) (component return nil, fmt.Errorf("could not load agent info: %w", err) } - monitor := monitoring.New(agentCfg.Settings.V1MonitoringEnabled, agentCfg.Settings.DownloadConfig.OS(), agentCfg.Settings.MonitoringConfig, agentInfo) + monitor := monitoring.New(agentCfg.Settings.V1MonitoringEnabled, agentCfg.Settings.DownloadConfig.OS(), agentCfg.Settings.MonitoringConfig, otelCfg, agentInfo) return monitor.MonitoringConfig, nil } -func getConfigWithVariables(ctx context.Context, l *logger.Logger, cfgPath string, timeout time.Duration, unprivileged bool) (map[string]interface{}, logp.Level, error) { +func getConfigWithVariables(ctx context.Context, l *logger.Logger, cfgPath string, timeout time.Duration, unprivileged bool) (map[string]interface{}, *confmap.Conf, logp.Level, error) { cfg, err := operations.LoadFullAgentConfig(ctx, l, cfgPath, true, unprivileged) if err != nil { - return nil, logp.InfoLevel, err + return nil, nil, logp.InfoLevel, err } lvl, err := getLogLevel(cfg, cfgPath) if err != nil { - return nil, logp.InfoLevel, err + return nil, nil, logp.InfoLevel, err } m, err := cfg.ToMapStr() if err != nil { - return nil, lvl, err + return nil, nil, lvl, err } ast, err := transpiler.NewAST(m) if err != nil { - return nil, lvl, fmt.Errorf("could not create the AST from the configuration: %w", err) + return nil, nil, lvl, fmt.Errorf("could not create the AST from the configuration: %w", err) } // Wait for the variables based on the timeout. vars, err := vars.WaitForVariables(ctx, l, cfg, timeout) if err != nil { - return nil, lvl, fmt.Errorf("failed to gather variables: %w", err) + return nil, nil, lvl, fmt.Errorf("failed to gather variables: %w", err) } // Render the inputs using the discovered inputs. @@ -443,18 +444,18 @@ func getConfigWithVariables(ctx context.Context, l *logger.Logger, cfgPath strin if ok { renderedInputs, err := transpiler.RenderInputs(inputs, vars) if err != nil { - return nil, lvl, fmt.Errorf("rendering inputs failed: %w", err) + return nil, nil, lvl, fmt.Errorf("rendering inputs failed: %w", err) } err = transpiler.Insert(ast, renderedInputs, "inputs") if err != nil { - return nil, lvl, fmt.Errorf("inserting rendered inputs failed: %w", err) + return nil, nil, lvl, fmt.Errorf("inserting rendered inputs failed: %w", err) } } m, err = ast.Map() if err != nil { - return nil, lvl, fmt.Errorf("failed to convert ast to map[string]interface{}: %w", err) + return nil, nil, lvl, fmt.Errorf("failed to convert ast to map[string]interface{}: %w", err) } - return m, lvl, nil + return m, cfg.OTel, lvl, nil } func getLogLevel(rawCfg *config.Config, cfgPath string) (logp.Level, error) { diff --git a/internal/pkg/otel/translate/otelconfig.go b/internal/pkg/otel/translate/otelconfig.go index 29b5004b8dc..aab26d52942 100644 --- a/internal/pkg/otel/translate/otelconfig.go +++ b/internal/pkg/otel/translate/otelconfig.go @@ -41,7 +41,7 @@ type exporterConfigTranslationFunc func(*config.C, *logp.Logger) (map[string]any var ( OtelSupportedOutputTypes = []string{"elasticsearch"} - OtelSupportedInputTypes = []string{"filestream", "http/metrics", "beat/metrics", "system/metrics"} + OtelSupportedInputTypes = []string{"filestream", "http/metrics", "beat/metrics", "system/metrics", "prometheus/metrics"} configTranslationFuncForExporter = map[otelcomponent.Type]exporterConfigTranslationFunc{ otelcomponent.MustNewType("elasticsearch"): translateEsOutputToExporter, } diff --git a/testing/integration/ess/beat_receivers_test.go b/testing/integration/ess/beat_receivers_test.go index 5ac1cc83a7e..1a8d63bc74f 100644 --- a/testing/integration/ess/beat_receivers_test.go +++ b/testing/integration/ess/beat_receivers_test.go @@ -331,8 +331,8 @@ func TestClassicAndReceiverAgentMonitoring(t *testing.T) { assert.NoError(collect, statusErr) // agent should be healthy assert.Equal(collect, int(cproto.State_HEALTHY), otelStatus.State) - // we should have 3 components running: filestream-monitoring, http/metrics-monitoring and beats/metrics-monitoring - assert.Equal(collect, 3, len(otelStatus.Components)) + // we should have 4 components running: filestream-monitoring, http/metrics-monitoring, beats/metrics-monitoring, and prometheus/metrics-monitoring + assert.Equal(collect, 4, len(otelStatus.Components)) // all the components should be healthy, their units should be healthy, and should identify themselves // as beats receivers via their version info