@opentelemetry/exporter-metrics-otlp-grpc 0.49.1 → 0.50.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.
@@ -1,11 +1,9 @@
1
1
  import { OTLPMetricExporterBase, OTLPMetricExporterOptions } from '@opentelemetry/exporter-metrics-otlp-http';
2
2
  import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
3
- import { OTLPGRPCExporterConfigNode, OTLPGRPCExporterNodeBase, ServiceClientType } from '@opentelemetry/otlp-grpc-exporter-base';
4
- import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
5
- declare class OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<ResourceMetrics, IExportMetricsServiceRequest> {
3
+ import { OTLPGRPCExporterConfigNode, OTLPGRPCExporterNodeBase } from '@opentelemetry/otlp-grpc-exporter-base';
4
+ import { IExportMetricsServiceRequest, IExportMetricsServiceResponse } from '@opentelemetry/otlp-transformer';
5
+ declare class OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<ResourceMetrics, IExportMetricsServiceRequest, IExportMetricsServiceResponse> {
6
6
  constructor(config?: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions);
7
- getServiceProtoPath(): string;
8
- getServiceClientType(): ServiceClientType;
9
7
  getDefaultUrl(config: OTLPGRPCExporterConfigNode): string;
10
8
  convert(metrics: ResourceMetrics[]): IExportMetricsServiceRequest;
11
9
  getUrlFromConfig(config: OTLPGRPCExporterConfigNode): string;
@@ -19,26 +19,16 @@ exports.OTLPMetricExporter = void 0;
19
19
  const exporter_metrics_otlp_http_1 = require("@opentelemetry/exporter-metrics-otlp-http");
20
20
  const otlp_grpc_exporter_base_1 = require("@opentelemetry/otlp-grpc-exporter-base");
21
21
  const core_1 = require("@opentelemetry/core");
22
- const grpc_js_1 = require("@grpc/grpc-js");
23
22
  const otlp_transformer_1 = require("@opentelemetry/otlp-transformer");
24
23
  const version_1 = require("./version");
24
+ const otlp_exporter_base_1 = require("@opentelemetry/otlp-exporter-base");
25
25
  const USER_AGENT = {
26
26
  'User-Agent': `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`,
27
27
  };
28
28
  class OTLPMetricExporterProxy extends otlp_grpc_exporter_base_1.OTLPGRPCExporterNodeBase {
29
29
  constructor(config) {
30
- super(config);
31
- const headers = Object.assign(Object.assign(Object.assign({}, USER_AGENT), core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_METRICS_HEADERS)), config === null || config === void 0 ? void 0 : config.headers);
32
- this.metadata || (this.metadata = new grpc_js_1.Metadata());
33
- for (const [k, v] of Object.entries(headers)) {
34
- this.metadata.set(k, v);
35
- }
36
- }
37
- getServiceProtoPath() {
38
- return 'opentelemetry/proto/collector/metrics/v1/metrics_service.proto';
39
- }
40
- getServiceClientType() {
41
- return otlp_grpc_exporter_base_1.ServiceClientType.METRICS;
30
+ const signalSpecificMetadata = Object.assign(Object.assign(Object.assign({}, USER_AGENT), core_1.baggageUtils.parseKeyPairsIntoRecord((0, core_1.getEnv)().OTEL_EXPORTER_OTLP_METRICS_HEADERS)), (0, otlp_exporter_base_1.parseHeaders)(config === null || config === void 0 ? void 0 : config.headers));
31
+ super(config, signalSpecificMetadata, 'MetricsExportService', '/opentelemetry.proto.collector.metrics.v1.MetricsService/Export', otlp_grpc_exporter_base_1.MetricsSerializer);
42
32
  }
43
33
  getDefaultUrl(config) {
44
34
  return (0, otlp_grpc_exporter_base_1.validateAndNormalizeUrl)(this.getUrlFromConfig(config));
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../src/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,0FAGmD;AAEnD,oFAMgD;AAChD,8CAA2D;AAC3D,2CAAyC;AACzC,sEAGyC;AACzC,uCAAoC;AAEpC,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCA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AC,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 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 {\n createExportMetricsServiceRequest,\n IExportMetricsServiceRequest,\n} from '@opentelemetry/otlp-transformer';\nimport { VERSION } from './version';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\nclass OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<\n ResourceMetrics,\n IExportMetricsServiceRequest\n> {\n constructor(config?: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions) {\n super(config);\n const headers = {\n ...USER_AGENT,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS\n ),\n ...config?.headers,\n };\n\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 (\n getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT ||\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT ||\n DEFAULT_COLLECTOR_URL\n );\n }\n}\n\n/**\n * OTLP-gRPC metric exporter\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPMetricExporterProxy> {\n constructor(config?: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions) {\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,0FAGmD;AAEnD,oFAMgD;AAChD,8CAA2D;AAC3D,sEAIyC;AACzC,uCAAoC;AACpC,0EAAiE;AAEjE,MAAM,UAAU,GAAG;IACjB,YAAY,EAAE,iCAAiC,iBAAO,EAAE;CACzD,CAAC;AAEF,MAAM,uBAAwB,SAAQ,kDAIrC;IACC,YAAY,MAA+D;QACzE,MAAM,sBAAsB,iDACvB,UAAU,GACV,mBAAY,CAAC,uBAAuB,CACrC,IAAA,aAAM,GAAE,CAAC,kCAAkC,CAC5C,GACE,IAAA,iCAAY,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,CACjC,CAAC;QACF,KAAK,CACH,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,iEAAiE,EACjE,2CAAiB,CAClB,CAAC;IACJ,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,CACL,IAAA,aAAM,GAAE,CAAC,mCAAmC;YAC5C,IAAA,aAAM,GAAE,CAAC,2BAA2B;YACpC,+CAAqB,CACtB,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAa,kBAAmB,SAAQ,mDAA+C;IACrF,YAAY,MAA+D;QACzE,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 OTLPMetricExporterBase,\n OTLPMetricExporterOptions,\n} from '@opentelemetry/exporter-metrics-otlp-http';\nimport { ResourceMetrics } from '@opentelemetry/sdk-metrics';\nimport {\n OTLPGRPCExporterConfigNode,\n OTLPGRPCExporterNodeBase,\n validateAndNormalizeUrl,\n DEFAULT_COLLECTOR_URL,\n MetricsSerializer,\n} from '@opentelemetry/otlp-grpc-exporter-base';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport {\n createExportMetricsServiceRequest,\n IExportMetricsServiceRequest,\n IExportMetricsServiceResponse,\n} from '@opentelemetry/otlp-transformer';\nimport { VERSION } from './version';\nimport { parseHeaders } from '@opentelemetry/otlp-exporter-base';\n\nconst USER_AGENT = {\n 'User-Agent': `OTel-OTLP-Exporter-JavaScript/${VERSION}`,\n};\n\nclass OTLPMetricExporterProxy extends OTLPGRPCExporterNodeBase<\n ResourceMetrics,\n IExportMetricsServiceRequest,\n IExportMetricsServiceResponse\n> {\n constructor(config?: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions) {\n const signalSpecificMetadata = {\n ...USER_AGENT,\n ...baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_METRICS_HEADERS\n ),\n ...parseHeaders(config?.headers),\n };\n super(\n config,\n signalSpecificMetadata,\n 'MetricsExportService',\n '/opentelemetry.proto.collector.metrics.v1.MetricsService/Export',\n MetricsSerializer\n );\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 (\n getEnv().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT ||\n getEnv().OTEL_EXPORTER_OTLP_ENDPOINT ||\n DEFAULT_COLLECTOR_URL\n );\n }\n}\n\n/**\n * OTLP-gRPC metric exporter\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase<OTLPMetricExporterProxy> {\n constructor(config?: OTLPGRPCExporterConfigNode & OTLPMetricExporterOptions) {\n super(new OTLPMetricExporterProxy(config), config);\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.49.1";
1
+ export declare const VERSION = "0.50.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.49.1';
20
+ exports.VERSION = '0.50.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.49.1';\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.50.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/exporter-metrics-otlp-grpc",
3
- "version": "0.49.1",
3
+ "version": "0.50.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",
@@ -68,14 +68,14 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@grpc/grpc-js": "^1.7.1",
71
- "@opentelemetry/core": "1.22.0",
72
- "@opentelemetry/exporter-metrics-otlp-http": "0.49.1",
73
- "@opentelemetry/otlp-grpc-exporter-base": "0.49.1",
74
- "@opentelemetry/otlp-transformer": "0.49.1",
75
- "@opentelemetry/resources": "1.22.0",
76
- "@opentelemetry/sdk-metrics": "1.22.0"
71
+ "@opentelemetry/core": "1.23.0",
72
+ "@opentelemetry/exporter-metrics-otlp-http": "0.50.0",
73
+ "@opentelemetry/otlp-grpc-exporter-base": "0.50.0",
74
+ "@opentelemetry/otlp-transformer": "0.50.0",
75
+ "@opentelemetry/resources": "1.23.0",
76
+ "@opentelemetry/sdk-metrics": "1.23.0"
77
77
  },
78
78
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc",
79
79
  "sideEffects": false,
80
- "gitHead": "3920b158d08daa776280bde68a79e44bafa4e8ea"
80
+ "gitHead": "5231aa255047fbc6ee3d6a299f4423ab2f8a5fbc"
81
81
  }