@opentelemetry/otlp-grpc-exporter-base 0.52.1 → 0.53.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.
@@ -65,7 +65,6 @@ class OTLPGRPCExporterNodeBase extends otlp_exporter_base_1.OTLPExporterBase {
65
65
  grpcName: grpcName,
66
66
  grpcPath: grpcPath,
67
67
  metadata: metadataProvider,
68
- timeoutMillis: this.timeoutMillis,
69
68
  });
70
69
  }
71
70
  onInit() {
@@ -84,15 +83,21 @@ class OTLPGRPCExporterNodeBase extends otlp_exporter_base_1.OTLPExporterBase {
84
83
  onError(new Error('Could not serialize message'));
85
84
  return;
86
85
  }
87
- const promise = this._transport.send(data).then(response => {
86
+ const promise = this._transport
87
+ .send(data, this.timeoutMillis)
88
+ .then(response => {
88
89
  if (response.status === 'success') {
89
90
  onSuccess();
90
- return;
91
91
  }
92
- if (response.status === 'failure' && response.error) {
92
+ else if (response.status === 'failure' && response.error) {
93
93
  onError(response.error);
94
94
  }
95
- onError(new otlp_exporter_base_1.OTLPExporterError('Export failed with unknown error'));
95
+ else if (response.status === 'retryable') {
96
+ onError(new otlp_exporter_base_1.OTLPExporterError('Export failed with retryable status'));
97
+ }
98
+ else {
99
+ onError(new otlp_exporter_base_1.OTLPExporterError('Export failed with unknown error'));
100
+ }
96
101
  }, onError);
97
102
  this._sendingPromises.push(promise);
98
103
  const popPromise = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPGRPCExporterNodeBase.js","sourceRoot":"","sources":["../../src/OTLPGRPCExporterNodeBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAE1C,8CAA2D;AAC3D,0EAI2C;AAC3C,uEAGmC;AACnC,iCAAoE;AAIpE;;GAEG;AACH,MAAsB,wBAGpB,SAAQ,qCAAwD;IAMhE,YACE,SAAqC,EAAE,EACvC,sBAA8C,EAC9C,QAAgB,EAChB,QAAgB,EAChB,UAAsD;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,CAAC,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,sCAAiB,CAAC,kCAAkC,CAAC,CAAC,CAAC;QACrE,CAAC,EAAE,OAAO,CAAC,CAAC;QAEZ,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,GAAG,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACzC,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;CAGF;AAjHD,4DAiHC","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 { diag } from '@opentelemetry/api';\nimport { GRPCQueueItem, OTLPGRPCExporterConfigNode } from './types';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport {\n CompressionAlgorithm,\n OTLPExporterBase,\n OTLPExporterError,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n createEmptyMetadata,\n GrpcExporterTransport,\n} from './grpc-exporter-transport';\nimport { configureCompression, configureCredentials } from './util';\nimport { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { IExporterTransport } from './exporter-transport';\n\n/**\n * OTLP Exporter abstract base class\n */\nexport abstract class OTLPGRPCExporterNodeBase<\n ExportItem,\n ServiceResponse,\n> extends OTLPExporterBase<OTLPGRPCExporterConfigNode, ExportItem> {\n grpcQueue: GRPCQueueItem<ExportItem>[] = [];\n compression: CompressionAlgorithm;\n private _transport: IExporterTransport;\n private _serializer: ISerializer<ExportItem[], ServiceResponse>;\n\n constructor(\n config: OTLPGRPCExporterConfigNode = {},\n signalSpecificMetadata: Record<string, string>,\n grpcName: string,\n grpcPath: string,\n serializer: ISerializer<ExportItem[], ServiceResponse>\n ) {\n super(config);\n this._serializer = serializer;\n if (config.headers) {\n diag.warn('Headers cannot be set when using grpc');\n }\n const nonSignalSpecificMetadata = baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_HEADERS\n );\n const rawMetadata = Object.assign(\n {},\n nonSignalSpecificMetadata,\n signalSpecificMetadata\n );\n\n let credentialProvider = () => {\n return configureCredentials(undefined, this.getUrlFromConfig(config));\n };\n\n if (config.credentials != null) {\n const credentials = config.credentials;\n credentialProvider = () => {\n return credentials;\n };\n }\n\n // Ensure we don't modify the original.\n const configMetadata = config.metadata?.clone();\n const metadataProvider = () => {\n const metadata = configMetadata ?? createEmptyMetadata();\n for (const [key, value] of Object.entries(rawMetadata)) {\n // only override with env var data if the key has no values.\n // not using Metadata.merge() as it will keep both values.\n if (metadata.get(key).length < 1) {\n metadata.set(key, value);\n }\n }\n\n return metadata;\n };\n\n this.compression = configureCompression(config.compression);\n this._transport = new GrpcExporterTransport({\n address: this.getDefaultUrl(config),\n compression: this.compression,\n credentials: credentialProvider,\n grpcName: grpcName,\n grpcPath: grpcPath,\n metadata: metadataProvider,\n timeoutMillis: this.timeoutMillis,\n });\n }\n\n onInit() {\n // Intentionally left empty; nothing to do.\n }\n\n override onShutdown() {\n this._transport.shutdown();\n }\n\n send(\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n ): void {\n if (this._shutdownOnce.isCalled) {\n diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n\n const data = this._serializer.serializeRequest(objects);\n\n if (data == null) {\n onError(new Error('Could not serialize message'));\n return;\n }\n\n const promise = this._transport.send(data).then(response => {\n if (response.status === 'success') {\n onSuccess();\n return;\n }\n if (response.status === 'failure' && response.error) {\n onError(response.error);\n }\n onError(new OTLPExporterError('Export failed with unknown error'));\n }, onError);\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n abstract getUrlFromConfig(config: OTLPGRPCExporterConfigNode): string;\n}\n"]}
1
+ {"version":3,"file":"OTLPGRPCExporterNodeBase.js","sourceRoot":"","sources":["../../src/OTLPGRPCExporterNodeBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4CAA0C;AAE1C,8CAA2D;AAC3D,0EAI2C;AAC3C,uEAGmC;AACnC,iCAAoE;AAIpE;;GAEG;AACH,MAAsB,wBAGpB,SAAQ,qCAAwD;IAMhE,YACE,SAAqC,EAAE,EACvC,sBAA8C,EAC9C,QAAgB,EAChB,QAAgB,EAChB,UAAsD;;QAEtD,KAAK,CAAC,MAAM,CAAC,CAAC;QAZhB,cAAS,GAAgC,EAAE,CAAC;QAa1C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,UAAI,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;SACpD;QACD,MAAM,yBAAyB,GAAG,mBAAY,CAAC,uBAAuB,CACpE,IAAA,aAAM,GAAE,CAAC,0BAA0B,CACpC,CAAC;QACF,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAC/B,EAAE,EACF,yBAAyB,EACzB,sBAAsB,CACvB,CAAC;QAEF,IAAI,kBAAkB,GAAG,GAAG,EAAE;YAC5B,OAAO,IAAA,2BAAoB,EAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;QACxE,CAAC,CAAC;QAEF,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EA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HC","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 { diag } from '@opentelemetry/api';\nimport { GRPCQueueItem, OTLPGRPCExporterConfigNode } from './types';\nimport { baggageUtils, getEnv } from '@opentelemetry/core';\nimport {\n CompressionAlgorithm,\n OTLPExporterBase,\n OTLPExporterError,\n} from '@opentelemetry/otlp-exporter-base';\nimport {\n createEmptyMetadata,\n GrpcExporterTransport,\n} from './grpc-exporter-transport';\nimport { configureCompression, configureCredentials } from './util';\nimport { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { IExporterTransport } from '@opentelemetry/otlp-exporter-base';\n\n/**\n * OTLP Exporter abstract base class\n */\nexport abstract class OTLPGRPCExporterNodeBase<\n ExportItem,\n ServiceResponse,\n> extends OTLPExporterBase<OTLPGRPCExporterConfigNode, ExportItem> {\n grpcQueue: GRPCQueueItem<ExportItem>[] = [];\n compression: CompressionAlgorithm;\n private _transport: IExporterTransport;\n private _serializer: ISerializer<ExportItem[], ServiceResponse>;\n\n constructor(\n config: OTLPGRPCExporterConfigNode = {},\n signalSpecificMetadata: Record<string, string>,\n grpcName: string,\n grpcPath: string,\n serializer: ISerializer<ExportItem[], ServiceResponse>\n ) {\n super(config);\n this._serializer = serializer;\n if (config.headers) {\n diag.warn('Headers cannot be set when using grpc');\n }\n const nonSignalSpecificMetadata = baggageUtils.parseKeyPairsIntoRecord(\n getEnv().OTEL_EXPORTER_OTLP_HEADERS\n );\n const rawMetadata = Object.assign(\n {},\n nonSignalSpecificMetadata,\n signalSpecificMetadata\n );\n\n let credentialProvider = () => {\n return configureCredentials(undefined, this.getUrlFromConfig(config));\n };\n\n if (config.credentials != null) {\n const credentials = config.credentials;\n credentialProvider = () => {\n return credentials;\n };\n }\n\n // Ensure we don't modify the original.\n const configMetadata = config.metadata?.clone();\n const metadataProvider = () => {\n const metadata = configMetadata ?? createEmptyMetadata();\n for (const [key, value] of Object.entries(rawMetadata)) {\n // only override with env var data if the key has no values.\n // not using Metadata.merge() as it will keep both values.\n if (metadata.get(key).length < 1) {\n metadata.set(key, value);\n }\n }\n\n return metadata;\n };\n\n this.compression = configureCompression(config.compression);\n this._transport = new GrpcExporterTransport({\n address: this.getDefaultUrl(config),\n compression: this.compression,\n credentials: credentialProvider,\n grpcName: grpcName,\n grpcPath: grpcPath,\n metadata: metadataProvider,\n });\n }\n\n onInit() {\n // Intentionally left empty; nothing to do.\n }\n\n override onShutdown() {\n this._transport.shutdown();\n }\n\n send(\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n ): void {\n if (this._shutdownOnce.isCalled) {\n diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n\n const data = this._serializer.serializeRequest(objects);\n\n if (data == null) {\n onError(new Error('Could not serialize message'));\n return;\n }\n\n const promise = this._transport\n .send(data, this.timeoutMillis)\n .then(response => {\n if (response.status === 'success') {\n onSuccess();\n } else if (response.status === 'failure' && response.error) {\n onError(response.error);\n } else if (response.status === 'retryable') {\n onError(new OTLPExporterError('Export failed with retryable status'));\n } else {\n onError(new OTLPExporterError('Export failed with unknown error'));\n }\n }, onError);\n\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n\n abstract getUrlFromConfig(config: OTLPGRPCExporterConfigNode): string;\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { Metadata, ChannelCredentials } from '@grpc/grpc-js';
3
- import { ExportResponse } from './export-response';
4
- import { IExporterTransport } from './exporter-transport';
3
+ import { ExportResponse, IExporterTransport } from '@opentelemetry/otlp-exporter-base';
5
4
  export declare function createInsecureCredentials(): ChannelCredentials;
6
5
  export declare function createSslCredentials(rootCert?: Buffer, privateKey?: Buffer, certChain?: Buffer): ChannelCredentials;
7
6
  export declare function createEmptyMetadata(): Metadata;
@@ -27,7 +26,6 @@ export interface GrpcExporterTransportParameters {
27
26
  */
28
27
  metadata: () => Metadata;
29
28
  compression: 'gzip' | 'none';
30
- timeoutMillis: number;
31
29
  }
32
30
  export declare class GrpcExporterTransport implements IExporterTransport {
33
31
  private _parameters;
@@ -35,6 +33,6 @@ export declare class GrpcExporterTransport implements IExporterTransport {
35
33
  private _metadata?;
36
34
  constructor(_parameters: GrpcExporterTransportParameters);
37
35
  shutdown(): void;
38
- send(data: Uint8Array): Promise<ExportResponse>;
36
+ send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse>;
39
37
  }
40
38
  //# sourceMappingURL=grpc-exporter-transport.d.ts.map
@@ -54,7 +54,7 @@ class GrpcExporterTransport {
54
54
  var _a;
55
55
  (_a = this._client) === null || _a === void 0 ? void 0 : _a.close();
56
56
  }
57
- send(data) {
57
+ send(data, timeoutMillis) {
58
58
  // We need to make a for gRPC
59
59
  const buffer = Buffer.from(data);
60
60
  if (this._client == null) {
@@ -85,9 +85,7 @@ class GrpcExporterTransport {
85
85
  }
86
86
  }
87
87
  return new Promise(resolve => {
88
- // this will always be defined
89
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
90
- const deadline = Date.now() + this._parameters.timeoutMillis;
88
+ const deadline = Date.now() + timeoutMillis;
91
89
  // this should never happen
92
90
  if (this._metadata == null) {
93
91
  return resolve({
@@ -1 +1 @@
1
- {"version":3,"file":"grpc-exporter-transport.js","sourceRoot":"","sources":["../../src/grpc-exporter-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAaH,gFAAgF;AAChF,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MA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,EAAE,QAAgB,EAAE,EAAE;gBACtC,IAAI,GAAG,EAAE;oBACP,OAAO,CAAC;wBACN,MAAM,EAAE,SAAS;wBACjB,KAAK,EAAE,GAAG;qBACX,CAAC,CAAC;iBACJ;qBAAM;oBACL,OAAO,CAAC;wBACN,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,SAAS;qBAClB,CAAC,CAAC;iBACJ;YACH,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxFD,sDAwFC","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// NOTE: do not change these type imports to actual imports. Doing so WILL break `@opentelemetry/instrumentation-http`,\n// as they'd be imported before the http/https modules can be wrapped.\nimport type {\n Metadata,\n ServiceError,\n ChannelCredentials,\n Client,\n} from '@grpc/grpc-js';\nimport { ExportResponse } from './export-response';\nimport { IExporterTransport } from './exporter-transport';\n\n// values taken from '@grpc/grpc-js` so that we don't need to require/import it.\nconst GRPC_COMPRESSION_NONE = 0;\nconst GRPC_COMPRESSION_GZIP = 2;\n\nfunction toGrpcCompression(compression: 'gzip' | 'none'): number {\n return compression === 'gzip' ? GRPC_COMPRESSION_GZIP : GRPC_COMPRESSION_NONE;\n}\n\nexport function createInsecureCredentials(): ChannelCredentials {\n // Lazy-load so that we don't need to require/import '@grpc/grpc-js' before it can be wrapped by instrumentation.\n const {\n credentials,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('@grpc/grpc-js');\n return credentials.createInsecure();\n}\n\nexport function createSslCredentials(\n rootCert?: Buffer,\n privateKey?: Buffer,\n certChain?: Buffer\n): ChannelCredentials {\n // Lazy-load so that we don't need to require/import '@grpc/grpc-js' before it can be wrapped by instrumentation.\n const {\n credentials,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('@grpc/grpc-js');\n return credentials.createSsl(rootCert, privateKey, certChain);\n}\n\nexport function createEmptyMetadata(): Metadata {\n // Lazy-load so that we don't need to require/import '@grpc/grpc-js' before it can be wrapped by instrumentation.\n const {\n Metadata,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('@grpc/grpc-js');\n return new Metadata();\n}\n\nexport interface GrpcExporterTransportParameters {\n grpcPath: string;\n grpcName: string;\n address: string;\n /**\n * NOTE: Ensure that you're only importing/requiring gRPC inside the function providing the channel credentials,\n * otherwise, gRPC and http/https instrumentations may break.\n *\n * For common cases, you can avoid to import/require gRPC your function by using\n * - {@link createSslCredentials}\n * - {@link createInsecureCredentials}\n */\n credentials: () => ChannelCredentials;\n /**\n * NOTE: Ensure that you're only importing/requiring gRPC inside the function providing the metadata,\n * otherwise, gRPC and http/https instrumentations may break.\n *\n * To avoid having to import/require gRPC from your function to create a new Metadata object,\n * use {@link createEmptyMetadata}\n */\n metadata: () => Metadata;\n compression: 'gzip' | 'none';\n timeoutMillis: number;\n}\n\nexport class GrpcExporterTransport implements IExporterTransport {\n private _client?: Client;\n private _metadata?: Metadata;\n\n constructor(private _parameters: GrpcExporterTransportParameters) {}\n\n shutdown() {\n this._client?.close();\n }\n\n send(data: Uint8Array): Promise<ExportResponse> {\n // We need to make a for gRPC\n const buffer = Buffer.from(data);\n\n if (this._client == null) {\n // Lazy require to ensure that grpc is not loaded before instrumentations can wrap it\n const {\n createServiceClientConstructor,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('./create-service-client-constructor');\n\n try {\n this._metadata = this._parameters.metadata();\n } catch (error) {\n return Promise.resolve({\n status: 'failure',\n error: error,\n });\n }\n\n const clientConstructor = createServiceClientConstructor(\n this._parameters.grpcPath,\n this._parameters.grpcName\n );\n\n try {\n this._client = new clientConstructor(\n this._parameters.address,\n this._parameters.credentials(),\n {\n 'grpc.default_compression_algorithm': toGrpcCompression(\n this._parameters.compression\n ),\n }\n );\n } catch (error) {\n return Promise.resolve({\n status: 'failure',\n error: error,\n });\n }\n }\n\n return new Promise<ExportResponse>(resolve => {\n // this will always be defined\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const deadline = Date.now() + this._parameters.timeoutMillis;\n\n // this should never happen\n if (this._metadata == null) {\n return resolve({\n error: new Error('metadata was null'),\n status: 'failure',\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore The gRPC client constructor is created on runtime, so we don't have any types for the resulting client.\n this._client.export(\n buffer,\n this._metadata,\n { deadline: deadline },\n (err: ServiceError, response: Buffer) => {\n if (err) {\n resolve({\n status: 'failure',\n error: err,\n });\n } else {\n resolve({\n data: response,\n status: 'success',\n });\n }\n }\n );\n });\n }\n}\n"]}
1
+ {"version":3,"file":"grpc-exporter-transport.js","sourceRoot":"","sources":["../../src/grpc-exporter-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAeH,gFAAgF;AAChF,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEhC,SAAS,iBAAiB,CAAC,WAA4B;IACrD,OAAO,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,CAAC;AAChF,CAAC;AAED,SAAgB,yBAAyB;IACvC,iHAAiH;IACjH,MAAM,EACJ,WAAW;IACX,8DAA8D;MAC/D,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC7B,OAAO,WAAW,CAAC,cAAc,EAAE,CAAC;AACtC,CAAC;AAPD,8DAOC;AAED,SAAgB,oBAAoB,CAClC,QAAiB,EACjB,UAAmB,EACnB,SAAkB;IAElB,iHAAiH;IACjH,MAAM,EACJ,WAAW;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B,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,EAC9B;oBACE,oCAAoC,EAAE,iBAAiB,CACrD,IAAI,CAAC,WAAW,CAAC,WAAW,CAC7B;iBACF,CACF,CAAC;aACH;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,OAAO,CAAC,OAAO,CAAC;oBACrB,MAAM,EAAE,SAAS;oBACjB,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;aACJ;SACF;QAED,OAAO,IAAI,OAAO,CAAiB,OAAO,CAAC,EAAE;YAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC;YAE5C,2BAA2B;YAC3B,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;gBAC1B,OAAO,OAAO,CAAC;oBACb,KAAK,EAAE,IAAI,KAAK,CAAC,mBAAmB,CAAC;oBACrC,MAAM,EAAE,SAAS;iBAClB,CAAC,CAAC;aACJ;YAED,6DAA6D;YAC7D,qHAAqH;YACrH,IAAI,CAAC,OAAO,CAAC,MAAM,CACjB,MAAM,EACN,IAAI,CAAC,SAAS,EACd,EAAE,QAAQ,EAAE,QAAQ,EAAE,EACtB,CAAC,GAAiB,EAAE,QAAgB,EAAE,EAAE;gBACtC,IAAI,GAAG,EAAE;oBACP,OAAO,CAAC;wBACN,MAAM,EAAE,SAAS;wBACjB,KAAK,EAAE,GAAG;qBACX,CAAC,CAAC;iBACJ;qBAAM;oBACL,OAAO,CAAC;wBACN,IAAI,EAAE,QAAQ;wBACd,MAAM,EAAE,SAAS;qBAClB,CAAC,CAAC;iBACJ;YACH,CAAC,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtFD,sDAsFC","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// NOTE: do not change these type imports to actual imports. Doing so WILL break `@opentelemetry/instrumentation-http`,\n// as they'd be imported before the http/https modules can be wrapped.\nimport type {\n Metadata,\n ServiceError,\n ChannelCredentials,\n Client,\n} from '@grpc/grpc-js';\nimport {\n ExportResponse,\n IExporterTransport,\n} from '@opentelemetry/otlp-exporter-base';\n\n// values taken from '@grpc/grpc-js` so that we don't need to require/import it.\nconst GRPC_COMPRESSION_NONE = 0;\nconst GRPC_COMPRESSION_GZIP = 2;\n\nfunction toGrpcCompression(compression: 'gzip' | 'none'): number {\n return compression === 'gzip' ? GRPC_COMPRESSION_GZIP : GRPC_COMPRESSION_NONE;\n}\n\nexport function createInsecureCredentials(): ChannelCredentials {\n // Lazy-load so that we don't need to require/import '@grpc/grpc-js' before it can be wrapped by instrumentation.\n const {\n credentials,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('@grpc/grpc-js');\n return credentials.createInsecure();\n}\n\nexport function createSslCredentials(\n rootCert?: Buffer,\n privateKey?: Buffer,\n certChain?: Buffer\n): ChannelCredentials {\n // Lazy-load so that we don't need to require/import '@grpc/grpc-js' before it can be wrapped by instrumentation.\n const {\n credentials,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('@grpc/grpc-js');\n return credentials.createSsl(rootCert, privateKey, certChain);\n}\n\nexport function createEmptyMetadata(): Metadata {\n // Lazy-load so that we don't need to require/import '@grpc/grpc-js' before it can be wrapped by instrumentation.\n const {\n Metadata,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('@grpc/grpc-js');\n return new Metadata();\n}\n\nexport interface GrpcExporterTransportParameters {\n grpcPath: string;\n grpcName: string;\n address: string;\n /**\n * NOTE: Ensure that you're only importing/requiring gRPC inside the function providing the channel credentials,\n * otherwise, gRPC and http/https instrumentations may break.\n *\n * For common cases, you can avoid to import/require gRPC your function by using\n * - {@link createSslCredentials}\n * - {@link createInsecureCredentials}\n */\n credentials: () => ChannelCredentials;\n /**\n * NOTE: Ensure that you're only importing/requiring gRPC inside the function providing the metadata,\n * otherwise, gRPC and http/https instrumentations may break.\n *\n * To avoid having to import/require gRPC from your function to create a new Metadata object,\n * use {@link createEmptyMetadata}\n */\n metadata: () => Metadata;\n compression: 'gzip' | 'none';\n}\n\nexport class GrpcExporterTransport implements IExporterTransport {\n private _client?: Client;\n private _metadata?: Metadata;\n\n constructor(private _parameters: GrpcExporterTransportParameters) {}\n\n shutdown() {\n this._client?.close();\n }\n\n send(data: Uint8Array, timeoutMillis: number): Promise<ExportResponse> {\n // We need to make a for gRPC\n const buffer = Buffer.from(data);\n\n if (this._client == null) {\n // Lazy require to ensure that grpc is not loaded before instrumentations can wrap it\n const {\n createServiceClientConstructor,\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n } = require('./create-service-client-constructor');\n\n try {\n this._metadata = this._parameters.metadata();\n } catch (error) {\n return Promise.resolve({\n status: 'failure',\n error: error,\n });\n }\n\n const clientConstructor = createServiceClientConstructor(\n this._parameters.grpcPath,\n this._parameters.grpcName\n );\n\n try {\n this._client = new clientConstructor(\n this._parameters.address,\n this._parameters.credentials(),\n {\n 'grpc.default_compression_algorithm': toGrpcCompression(\n this._parameters.compression\n ),\n }\n );\n } catch (error) {\n return Promise.resolve({\n status: 'failure',\n error: error,\n });\n }\n }\n\n return new Promise<ExportResponse>(resolve => {\n const deadline = Date.now() + timeoutMillis;\n\n // this should never happen\n if (this._metadata == null) {\n return resolve({\n error: new Error('metadata was null'),\n status: 'failure',\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore The gRPC client constructor is created on runtime, so we don't have any types for the resulting client.\n this._client.export(\n buffer,\n this._metadata,\n { deadline: deadline },\n (err: ServiceError, response: Buffer) => {\n if (err) {\n resolve({\n status: 'failure',\n error: err,\n });\n } else {\n resolve({\n data: response,\n status: 'success',\n });\n }\n }\n );\n });\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.52.1";
1
+ export declare const VERSION = "0.53.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.52.1';
20
+ exports.VERSION = '0.53.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.52.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.53.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/otlp-grpc-exporter-base",
3
- "version": "0.52.1",
3
+ "version": "0.53.0",
4
4
  "description": "OpenTelemetry OTLP-gRPC Exporter base (for internal use only)",
5
5
  "main": "build/src/index.js",
6
6
  "types": "build/src/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "lint": "eslint . --ext .ts",
14
14
  "lint:fix": "eslint . --ext .ts --fix",
15
15
  "tdd": "npm run test -- --watch-extensions ts --watch",
16
- "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
16
+ "test": "nyc mocha 'test/**/*.test.ts'",
17
17
  "version": "node ../../../scripts/version-update.js",
18
18
  "watch": "tsc -w",
19
19
  "precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
@@ -48,19 +48,18 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@opentelemetry/api": "1.9.0",
51
- "@opentelemetry/resources": "1.25.1",
52
- "@opentelemetry/sdk-trace-base": "1.25.1",
53
- "@types/mocha": "10.0.6",
51
+ "@opentelemetry/resources": "1.26.0",
52
+ "@opentelemetry/sdk-trace-base": "1.26.0",
53
+ "@types/mocha": "10.0.7",
54
54
  "@types/node": "18.6.5",
55
55
  "@types/sinon": "17.0.3",
56
56
  "codecov": "3.8.3",
57
57
  "cross-var": "1.1.0",
58
58
  "lerna": "6.6.2",
59
- "mocha": "10.2.0",
59
+ "mocha": "10.7.3",
60
60
  "nyc": "15.1.0",
61
61
  "sinon": "15.1.2",
62
62
  "ts-loader": "9.5.1",
63
- "ts-mocha": "10.0.0",
64
63
  "typescript": "4.4.4"
65
64
  },
66
65
  "peerDependencies": {
@@ -68,11 +67,11 @@
68
67
  },
69
68
  "dependencies": {
70
69
  "@grpc/grpc-js": "^1.7.1",
71
- "@opentelemetry/core": "1.25.1",
72
- "@opentelemetry/otlp-exporter-base": "0.52.1",
73
- "@opentelemetry/otlp-transformer": "0.52.1"
70
+ "@opentelemetry/core": "1.26.0",
71
+ "@opentelemetry/otlp-exporter-base": "0.53.0",
72
+ "@opentelemetry/otlp-transformer": "0.53.0"
74
73
  },
75
74
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-grpc-exporter-base",
76
75
  "sideEffects": false,
77
- "gitHead": "0608f405573901e54db01e44c533009cf28be262"
76
+ "gitHead": "720bc8c70d47029cb6b41a34ffdc3d25cbaa2f80"
78
77
  }
@@ -1,10 +0,0 @@
1
- export interface ExportResponseSuccess {
2
- status: 'success';
3
- data?: Uint8Array;
4
- }
5
- export interface ExportResponseFailure {
6
- status: 'failure';
7
- error: Error;
8
- }
9
- export declare type ExportResponse = ExportResponseSuccess | ExportResponseFailure;
10
- //# sourceMappingURL=export-response.d.ts.map
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- //# sourceMappingURL=export-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"export-response.js","sourceRoot":"","sources":["../../src/export-response.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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\nexport interface ExportResponseSuccess {\n status: 'success';\n data?: Uint8Array;\n}\n\nexport interface ExportResponseFailure {\n status: 'failure';\n error: Error;\n}\n\nexport type ExportResponse = ExportResponseSuccess | ExportResponseFailure;\n"]}
@@ -1,6 +0,0 @@
1
- import { ExportResponse } from './export-response';
2
- export interface IExporterTransport {
3
- send(data: Uint8Array): Promise<ExportResponse>;
4
- shutdown(): void;
5
- }
6
- //# sourceMappingURL=exporter-transport.d.ts.map
@@ -1,18 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- //# sourceMappingURL=exporter-transport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exporter-transport.js","sourceRoot":"","sources":["../../src/exporter-transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG","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 { ExportResponse } from './export-response';\n\nexport interface IExporterTransport {\n send(data: Uint8Array): Promise<ExportResponse>;\n shutdown(): void;\n}\n"]}