@opentelemetry/exporter-metrics-otlp-grpc 0.31.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  [![NPM Published Version][npm-img]][npm-url]
4
4
  [![Apache License][license-image]][license-image]
5
5
 
6
+ **Note: This is an experimental package under active development. New releases may include breaking changes.**
7
+
6
8
  This module provides exporter for node to be used with OTLP (`grpc`) compatible receivers.
7
9
  Compatible with [opentelemetry-collector][opentelemetry-collector-url] versions `>=0.16 <=0.53`.
8
10
 
@@ -23,7 +25,7 @@ To see sample code and documentation for the traces exporter, as well as instruc
23
25
  The OTLPMetricsExporter in Node expects the URL to only be the hostname. It will not work with `/v1/metrics`. All options that work with trace also work with metrics.
24
26
 
25
27
  ```js
26
- const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics-base');
28
+ const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');
27
29
  const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-grpc');
28
30
  const collectorOptions = {
29
31
  // url is optional and can be omitted - default is http://localhost:4317
@@ -1,5 +1,5 @@
1
1
  import { OTLPMetricExporterBase, OTLPMetricExporterOptions } from '@opentelemetry/exporter-metrics-otlp-http';
2
- import { ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
2
+ import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
3
3
  import { OTLPGRPCExporterConfigNode, OTLPGRPCExporterNodeBase, ServiceClientType } from '@opentelemetry/otlp-grpc-exporter-base';
4
4
  import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
5
5
  declare class OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<ResourceMetrics, IExportMetricsServiceRequest> {
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../src/OTLPMetricExporter.ts"],"names":[],"mappings":";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I,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACF;AAJD,gDAIC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n defaultOptions,\n OTLPMetricExporterBase,\n OTLPMetricExporterOptions\n} from '@opentelemetry/exporter-metrics-otlp-http';\nimport { ResourceMetrics } from '@opentelemetry/sdk-metrics-base';\nimport {\n OTLPGRPCExporterConfigNode,\n OTLPGRPCExporterNodeBase,\n ServiceClientType,\n validateAndNormalizeUrl,\n DEFAULT_COLLECTOR_URL\n} from '@opentelemetry/otlp-grpc-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { Metadata } from '@grpc/grpc-js';\nimport { createExportMetricsServiceRequest, IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';\n\nclass OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<ResourceMetrics, IExportMetricsServiceRequest> {\n\n constructor(config: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions= defaultOptions) {\n super(config);\n const headers = baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS);\n this.metadata ||= new Metadata();\n for (const [k, v] of Object.entries(headers)) {\n this.metadata.set(k, v);\n }\n }\n\n getServiceProtoPath(): string {\n return 'opentelemetry/proto/collector/metrics/v1/metrics_service.proto';\n }\n\n getServiceClientType(): ServiceClientType {\n return ServiceClientType.METRICS;\n }\n\n getDefaultUrl(config: OTLPGRPCExporterConfigNode): string {\n return validateAndNormalizeUrl(this.getUrlFromConfig(config));\n }\n\n convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest {\n return createExportMetricsServiceRequest(metrics);\n }\n\n getUrlFromConfig(config: OTLPGRPCExporterConfigNode): string {\n if (typeof config.url === 'string') {\n return config.url;\n }\n\n return getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT ||\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT ||\n DEFAULT_COLLECTOR_URL;\n }\n}\n\n/**\n * OTLP-gRPC metric exporter\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPMetricExporterProxy>{\n constructor(config: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions = defaultOptions) {\n super(new OTLPMetricExporterProxy(config), config);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../src/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,0FAImD;AAEnD,oFAMgD;AAChD,8CAA2D;AAC3D,2CAAyC;AACzC,sEAAkH;AAElH,MAAM,uBAAwB,SAAQ,kDAAuE;IAE3G,YAAY,SAAgE,2CAAc;QACxF,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,MAAM,OAAO,GAAG,mBAAY,CAAC,uBAAuB,CAAC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAAC,CAAC;QAClG,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,kBAAQ,EAAE,EAAC;QACjC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YAC5C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACzB;IACH,CAAC;IAED,mBAAmB;QACjB,OAAO,gEAAgE,CAAC;IAC1E,CAAC;IAED,oBAAoB;QAClB,OAAO,2CAAiB,CAAC,OAAO,CAAC;IACnC,CAAC;IAED,aAAa,CAAC,MAAkC;QAC9C,OAAO,IAAA,iDAAuB,EAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,CAAC,OAA0B;QAChC,OAAO,IAAA,oDAAiC,EAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAED,gBAAgB,CAAC,MAAkC;QACjD,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,EAAE;YAClC,OAAO,MAAM,CAAC,GAAG,CAAC;SACnB;QAED,OAAO,IAAA,aAAM,GAAE,CAAC,mCAAmC;YACjD,IAAA,aAAM,GAAE,CAAC,2BAA2B;YACpC,+CAAqB,CAAC;IAC1B,CAAC;CACF;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,mDAA+C;IACrF,YAAY,SAAiE,2CAAc;QACzF,KAAK,CAAC,IAAI,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;CACF;AAJD,gDAIC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n defaultOptions,\n OTLPMetricExporterBase,\n OTLPMetricExporterOptions\n} from '@opentelemetry/exporter-metrics-otlp-http';\nimport { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport {\n OTLPGRPCExporterConfigNode,\n OTLPGRPCExporterNodeBase,\n ServiceClientType,\n validateAndNormalizeUrl,\n DEFAULT_COLLECTOR_URL\n} from '@opentelemetry/otlp-grpc-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport { Metadata } from '@grpc/grpc-js';\nimport { createExportMetricsServiceRequest, IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';\n\nclass OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<ResourceMetrics, IExportMetricsServiceRequest> {\n\n constructor(config: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions= defaultOptions) {\n super(config);\n const headers = baggageUtils.parseKeyPairsIntoRecord(getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS);\n this.metadata ||= new Metadata();\n for (const [k, v] of Object.entries(headers)) {\n this.metadata.set(k, v);\n }\n }\n\n getServiceProtoPath(): string {\n return 'opentelemetry/proto/collector/metrics/v1/metrics_service.proto';\n }\n\n getServiceClientType(): ServiceClientType {\n return ServiceClientType.METRICS;\n }\n\n getDefaultUrl(config: OTLPGRPCExporterConfigNode): string {\n return validateAndNormalizeUrl(this.getUrlFromConfig(config));\n }\n\n convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest {\n return createExportMetricsServiceRequest(metrics);\n }\n\n getUrlFromConfig(config: OTLPGRPCExporterConfigNode): string {\n if (typeof config.url === 'string') {\n return config.url;\n }\n\n return getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT ||\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT ||\n DEFAULT_COLLECTOR_URL;\n }\n}\n\n/**\n * OTLP-gRPC metric exporter\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPMetricExporterProxy>{\n constructor(config: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions = defaultOptions) {\n super(new OTLPMetricExporterProxy(config), config);\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.31.0";
1
+ export declare const VERSION = "0.33.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -17,5 +17,5 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.VERSION = '0.31.0';
20
+ exports.VERSION = '0.33.0';
21
21
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.31.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.33.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/exporter-metrics-otlp-grpc",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -49,18 +49,18 @@
49
49
  "devDependencies": {
50
50
  "@babel/core": "7.16.0",
51
51
  "@opentelemetry/api": "^1.0.0",
52
- "@opentelemetry/api-metrics": "0.31.0",
53
- "@types/mocha": "8.2.3",
54
- "@types/node": "14.17.33",
55
- "@types/sinon": "10.0.6",
52
+ "@opentelemetry/api-metrics": "0.33.0",
53
+ "@types/mocha": "9.1.1",
54
+ "@types/node": "18.6.5",
55
+ "@types/sinon": "10.0.13",
56
56
  "codecov": "3.8.3",
57
57
  "cpx": "1.5.0",
58
- "mocha": "7.2.0",
58
+ "mocha": "10.0.0",
59
59
  "nyc": "15.1.0",
60
60
  "rimraf": "3.0.2",
61
- "sinon": "12.0.1",
62
- "ts-loader": "8.3.0",
63
- "ts-mocha": "9.0.2",
61
+ "sinon": "14.0.0",
62
+ "ts-loader": "8.4.0",
63
+ "ts-mocha": "10.0.0",
64
64
  "typescript": "4.4.4"
65
65
  },
66
66
  "peerDependencies": {
@@ -69,13 +69,13 @@
69
69
  "dependencies": {
70
70
  "@grpc/grpc-js": "^1.5.9",
71
71
  "@grpc/proto-loader": "^0.6.9",
72
- "@opentelemetry/core": "1.5.0",
73
- "@opentelemetry/exporter-metrics-otlp-http": "0.31.0",
74
- "@opentelemetry/otlp-grpc-exporter-base": "0.31.0",
75
- "@opentelemetry/otlp-transformer": "0.31.0",
76
- "@opentelemetry/resources": "1.5.0",
77
- "@opentelemetry/sdk-metrics-base": "0.31.0"
72
+ "@opentelemetry/core": "1.7.0",
73
+ "@opentelemetry/exporter-metrics-otlp-http": "0.33.0",
74
+ "@opentelemetry/otlp-grpc-exporter-base": "0.33.0",
75
+ "@opentelemetry/otlp-transformer": "0.33.0",
76
+ "@opentelemetry/resources": "1.7.0",
77
+ "@opentelemetry/sdk-metrics": "0.33.0"
78
78
  },
79
79
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc",
80
- "gitHead": "776656b6e0cd0fc49a52b734702bc77110e483f1"
80
+ "gitHead": "ad88c3d9aa0100fe259b93f4b660e84417b757ac"
81
81
  }