diff --git a/package.json b/package.json index 603ca105b8956..e9687d0f3e412 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "@emotion/css": "^11.9.0", "@emotion/react": "^11.9.0", "@emotion/serialize": "^1.0.3", - "@grpc/grpc-js": "^1.5.9", + "@grpc/grpc-js": "^1.6.7", "@hapi/accept": "^5.0.2", "@hapi/boom": "^9.1.4", "@hapi/cookie": "^11.0.2", @@ -275,12 +275,12 @@ "@mapbox/mapbox-gl-draw": "1.3.0", "@mapbox/mapbox-gl-rtl-text": "0.2.3", "@mapbox/vector-tile": "1.3.1", - "@opentelemetry/api-metrics": "0.30.0", + "@opentelemetry/api-metrics": "^0.30.0", "@opentelemetry/exporter-metrics-otlp-grpc": "^0.30.0", "@opentelemetry/exporter-prometheus": "^0.30.0", - "@opentelemetry/resources": "^1.3.1", + "@opentelemetry/resources": "^1.4.0", "@opentelemetry/sdk-metrics-base": "^0.30.0", - "@opentelemetry/semantic-conventions": "^1.3.1", + "@opentelemetry/semantic-conventions": "^1.4.0", "@reduxjs/toolkit": "^1.6.1", "@slack/webhook": "^5.0.4", "@turf/along": "6.0.1", diff --git a/x-pack/plugins/monitoring_collection/README.md b/x-pack/plugins/monitoring_collection/README.md index 04408532e5e91..13b8396f01b3e 100644 --- a/x-pack/plugins/monitoring_collection/README.md +++ b/x-pack/plugins/monitoring_collection/README.md @@ -24,7 +24,7 @@ This plugin allows for other plugins to add data to Kibana stack monitoring docu prometheus.enabled: true ``` -### Enable OpenTelemetry Metrics API exported as OpenTelemetry Protocol +### Enable OpenTelemetry Metrics API exported as OpenTelemetry Protocol over GRPC 1. Start [local setup with fleet](../fleet/README.md#running-fleet-server-locally-in-a-container) or a cloud cluster 2. Start Kibana @@ -38,6 +38,26 @@ This plugin allows for other plugins to add data to Kibana stack monitoring docu otlp.url: "http://127.0.0.1:8200" ``` +You can also provide headers for OTLP endpoints that require authentication: + +```yml +# Enable the OTLP exporter to an authenticated APM endpoint +monitoring_collection.opentelemetry.metrics: + otlp: + url: "https://DEPLOYMENT.apm.REGION.PROVIDER.elastic-cloud.com" + headers: + Authorization: "Bearer SECRET_TOKEN" +``` + +For connection-level debug information you can set these variables: + +```bash +export GRPC_NODE_TRACE="xds_client,xds_resolver,cds_balancer,eds_balancer,priority,weighted_target,round_robin,resolving_load_balancer,subchannel,keepalive,dns_resolver,fault_injection,http_filter,csds" +export GRPC_NODE_VERBOSITY=DEBUG +``` + +See the [grpc-node docs](https://github.com/grpc/grpc-node/blob/master/doc/environment_variables.md) for details and other settings. + ### Example of how to instrument the code * First, we need to define what metrics we want to instrument with OpenTelemetry diff --git a/x-pack/plugins/monitoring_collection/server/plugin.ts b/x-pack/plugins/monitoring_collection/server/plugin.ts index 433b5a3d22e63..e0a0fc76a23ac 100644 --- a/x-pack/plugins/monitoring_collection/server/plugin.ts +++ b/x-pack/plugins/monitoring_collection/server/plugin.ts @@ -128,12 +128,8 @@ export class MonitoringCollectionPlugin implements Plugin=12.12.47" -"@grpc/proto-loader@^0.6.4": - version "0.6.12" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.12.tgz#459b619b8b9b67794bf0d1cb819653a38c63e164" - integrity sha512-filTVbETFnxb9CyRX98zN18ilChTuf/C5scZ2xyaOTp0EHGq0/ufX8rjqXUcSb1Gpv7eZq4M2jDvbh9BogKnrg== - dependencies: - "@types/long" "^4.0.1" - lodash.camelcase "^4.3.0" - long "^4.0.0" - protobufjs "^6.10.0" - yargs "^16.2.0" - -"@grpc/proto-loader@^0.6.9": +"@grpc/proto-loader@^0.6.4", "@grpc/proto-loader@^0.6.9": version "0.6.13" resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.13.tgz#008f989b72a40c60c96cd4088522f09b05ac66bc" integrity sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g== @@ -4421,7 +4410,7 @@ "@mattiasbuelens/web-streams-adapter" "~0.1.0" web-streams-polyfill "~3.0.3" -"@opentelemetry/api-metrics@0.30.0": +"@opentelemetry/api-metrics@0.30.0", "@opentelemetry/api-metrics@^0.30.0": version "0.30.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api-metrics/-/api-metrics-0.30.0.tgz#b5defd10756e81d1c7ce8669ff8a8d2465ba0be8" integrity sha512-jSb7iiYPY+DSUKIyzfGt0a5K1QGzWY5fSWtUB8Alfi27NhQGHBeuYYC5n9MaBP/HNWw5GpEIhXGEYCF9Pf8IEg== @@ -4433,13 +4422,6 @@ resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.1.0.tgz#563539048255bbe1a5f4f586a4a10a1bb737f44a" integrity sha512-hf+3bwuBwtXsugA2ULBc95qxrOqP2pOekLz34BJhcAKawt94vfeNyUKpYc0lZQ/3sCP6LqRa7UAdHA7i5UODzQ== -"@opentelemetry/core@1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.3.1.tgz#6eef5c5efca9a4cd7daa0cd4c7ff28ca2317c8d7" - integrity sha512-k7lOC86N7WIyUZsUuSKZfFIrUtINtlauMGQsC1r7jNmcr0vVJGqK1ROBvt7WWMxLbpMnt1q2pXJO8tKu0b9auA== - dependencies: - "@opentelemetry/semantic-conventions" "1.3.1" - "@opentelemetry/core@1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.4.0.tgz#26839ab9e36583a174273a1e1c5b33336c163725" @@ -4510,7 +4492,7 @@ "@opentelemetry/sdk-metrics-base" "0.30.0" "@opentelemetry/sdk-trace-base" "1.4.0" -"@opentelemetry/resources@1.4.0": +"@opentelemetry/resources@1.4.0", "@opentelemetry/resources@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.4.0.tgz#5e23b0d7976158861059dec17e0ee36a35a5ab85" integrity sha512-Q3pI5+pCM+Ur7YwK9GbG89UBipwJbfmuzSPAXTw964ZHFzSrz+JAgrETC9rqsUOYdUlj/V7LbRMG5bo72xE0Xw== @@ -4518,14 +4500,6 @@ "@opentelemetry/core" "1.4.0" "@opentelemetry/semantic-conventions" "1.4.0" -"@opentelemetry/resources@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.3.1.tgz#9fd85ac4ffeefc35441404b384d5c1db8b243121" - integrity sha512-X8bl3X0YjlsHWy0Iv0KUETtZuRUznX4yr1iScKCtfy8AoRfZFc2xxWKMDJ0TrqYwSapgeg4YwpmRzUKmmnrbeA== - dependencies: - "@opentelemetry/core" "1.3.1" - "@opentelemetry/semantic-conventions" "1.3.1" - "@opentelemetry/sdk-metrics-base@0.30.0", "@opentelemetry/sdk-metrics-base@^0.30.0": version "0.30.0" resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-metrics-base/-/sdk-metrics-base-0.30.0.tgz#242d9260a89a1ac2bf1e167b3fda758f3883c769" @@ -4545,12 +4519,7 @@ "@opentelemetry/resources" "1.4.0" "@opentelemetry/semantic-conventions" "1.4.0" -"@opentelemetry/semantic-conventions@1.3.1", "@opentelemetry/semantic-conventions@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.3.1.tgz#ba07b864a3c955f061aa30ea3ef7f4ae4449794a" - integrity sha512-wU5J8rUoo32oSef/rFpOT1HIjLjAv3qIDHkw1QIhODV3OpAVHi5oVzlouozg9obUmZKtbZ0qUe/m7FP0y0yBzA== - -"@opentelemetry/semantic-conventions@1.4.0": +"@opentelemetry/semantic-conventions@1.4.0", "@opentelemetry/semantic-conventions@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.4.0.tgz#facf2c67d6063b9918d5a5e3fdf25f3a30d547b6" integrity sha512-Hzl8soGpmyzja9w3kiFFcYJ7n5HNETpplY6cb67KR4QPlxp4FTTresO06qXHgHDhyIInmbLJXuwARjjpsKYGuQ== @@ -6930,10 +6899,6 @@ version "0.0.0" uid "" -"@types/kbn__core-http-server@link:bazel-bin/packages/core/http/core-http-server/npm_module_types": - version "0.0.0" - uid "" - "@types/kbn__core-http-browser-internal@link:bazel-bin/packages/core/http/core-http-browser-internal/npm_module_types": version "0.0.0" uid "" @@ -6950,6 +6915,10 @@ version "0.0.0" uid "" +"@types/kbn__core-http-server@link:bazel-bin/packages/core/http/core-http-server/npm_module_types": + version "0.0.0" + uid "" + "@types/kbn__core-i18n-browser-internal@link:bazel-bin/packages/core/i18n/core-i18n-browser-internal/npm_module_types": version "0.0.0" uid "" @@ -24037,7 +24006,7 @@ protobufjs@6.8.8: "@types/node" "^10.1.0" long "^4.0.0" -protobufjs@^6.10.0, protobufjs@^6.11.3: +protobufjs@^6.11.3: version "6.11.3" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== @@ -31008,7 +30977,7 @@ yargs-unparser@2.0.0: yargs@16.2.0, yargs@^16.2.0: version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2"