@opentelemetry/otlp-grpc-exporter-base 0.40.0 → 0.41.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.
@@ -14,19 +14,10 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
17
  Object.defineProperty(exports, "__esModule", { value: true });
28
18
  exports.GrpcCompressionAlgorithm = exports.validateAndNormalizeUrl = exports.DEFAULT_COLLECTOR_URL = exports.ServiceClientType = void 0;
29
- __exportStar(require("./OTLPGRPCExporterNodeBase"), exports);
19
+ const tslib_1 = require("tslib");
20
+ (0, tslib_1.__exportStar)(require("./OTLPGRPCExporterNodeBase"), exports);
30
21
  var types_1 = require("./types");
31
22
  Object.defineProperty(exports, "ServiceClientType", { enumerable: true, get: function () { return types_1.ServiceClientType; } });
32
23
  var util_1 = require("./util");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;AAEH,6DAA2C;AAC3C,iCAAwE;AAA/D,0GAAA,iBAAiB,OAAA;AAC1B,+BAIgB;AAHd,6GAAA,qBAAqB,OAAA;AACrB,+GAAA,uBAAuB,OAAA;AACvB,gHAAA,wBAAwB,OAAA","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 * from './OTLPGRPCExporterNodeBase';\nexport { ServiceClientType, OTLPGRPCExporterConfigNode } from './types';\nexport {\n DEFAULT_COLLECTOR_URL,\n validateAndNormalizeUrl,\n GrpcCompressionAlgorithm,\n} from './util';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;AAEH,0EAA2C;AAC3C,iCAAwE;AAA/D,0GAAA,iBAAiB,OAAA;AAC1B,+BAIgB;AAHd,6GAAA,qBAAqB,OAAA;AACrB,+GAAA,uBAAuB,OAAA;AACvB,gHAAA,wBAAwB,OAAA","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 * from './OTLPGRPCExporterNodeBase';\nexport { ServiceClientType, OTLPGRPCExporterConfigNode } from './types';\nexport {\n DEFAULT_COLLECTOR_URL,\n validateAndNormalizeUrl,\n GrpcCompressionAlgorithm,\n} from './util';\n"]}
package/build/src/util.js CHANGED
@@ -99,6 +99,9 @@ function validateAndNormalizeUrl(url) {
99
99
  url = `https://${url}`;
100
100
  }
101
101
  const target = new url_1.URL(url);
102
+ if (target.protocol === 'unix:') {
103
+ return url;
104
+ }
102
105
  if (target.pathname && target.pathname !== '/') {
103
106
  api_1.diag.warn('URL path should not be set when using grpc, the path part of the URL will be ignored.');
104
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sCAAsC;AACtC,4CAA0C;AAC1C,8CAAiE;AACjE,6BAA6B;AAE7B,6BAA0B;AAC1B,yBAAyB;AACzB,mCAIiB;AACjB,0EAI2C;AAE3C,6EAAyE;AACzE,yEAAsE;AACtE,uEAAoE;AAEvD,QAAA,qBAAqB,GAAG,uBAAuB,CAAC;AAE7D,SAAgB,MAAM,CACpB,SAA+D,EAC/D,MAAkC;IAElC,SAAS,CAAC,SAAS,GAAG,EAAE,CAAC;IAEzB,MAAM,WAAW,GAA4B,iBAAiB,CAC5D,MAAM,CAAC,WAAW,EAClB,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CACnC,CAAC;IAEF,IAAI;QACF,IAAI,SAAS,CAAC,oBAAoB,EAAE,KAAK,yBAAiB,CAAC,KAAK,EAAE;YAChE,MAAM,MAAM,GAAG,IAAI,mDAAwB,CAAC,SAAS,CAAC,GAAG,EAAE,WAAW,EAAE;gBACtE,oCAAoC,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE;aACtE,CAAC,CAAC;YAEH,6DAA6D;YAC7D,aAAa;YACb,SAAS,CAAC,aAAa,GAAG,MAAM,CAAC;SAClC;aAAM,IAAI,SAAS,CAAC,oBAAoB,EAAE,KAAK,yBAAiB,CAAC,OAAO,EAAE;YACzE,MAAM,MAAM,GAAG,IAAI,sDAAyB,CAAC,SAAS,CAAC,GAAG,EAAE,WAAW,EAAE;gBACvE,oCAAoC,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE;aACtE,CAAC,CAAC;YAEH,6DAA6D;YAC7D,aAAa;YACb,SAAS,CAAC,aAAa,GAAG,MAAM,CAAC;SAClC;aAAM,IAAI,SAAS,CAAC,oBAAoB,EAAE,K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O,iBAAiB,CAAC,WAAW,CAAC,CAAC;KACvC;SAAM;QACL,MAAM,kBAAkB,GACtB,IAAA,aAAM,GAAE,CAAC,qCAAqC;YAC9C,IAAA,aAAM,GAAE,CAAC,8BAA8B,CAAC;QAE1C,OAAO,kBAAkB,KAAK,MAAM;YAClC,CAAC,CAAC,wBAAwB,CAAC,IAAI;YAC/B,CAAC,CAAC,wBAAwB,CAAC,IAAI,CAAC;KACnC;AACH,CAAC;AAdD,oDAcC","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 * as grpc from '@grpc/grpc-js';\nimport { diag } from '@opentelemetry/api';\nimport { getEnv, globalErrorHandler } from '@opentelemetry/core';\nimport * as path from 'path';\nimport { OTLPGRPCExporterNodeBase } from './OTLPGRPCExporterNodeBase';\nimport { URL } from 'url';\nimport * as fs from 'fs';\nimport {\n GRPCQueueItem,\n OTLPGRPCExporterConfigNode,\n ServiceClientType,\n} from './types';\nimport {\n ExportServiceError,\n OTLPExporterError,\n CompressionAlgorithm,\n} from '@opentelemetry/otlp-exporter-base';\n\nimport { MetricExportServiceClient } from './MetricsExportServiceClient';\nimport { TraceExportServiceClient } from './TraceExportServiceClient';\nimport { LogsExportServiceClient } from './LogsExportServiceClient';\n\nexport const DEFAULT_COLLECTOR_URL = 'http://localhost:4317';\n\nexport function onInit<ExportItem, ServiceRequest>(\n collector: OTLPGRPCExporterNodeBase<ExportItem, ServiceRequest>,\n config: OTLPGRPCExporterConfigNode\n): void {\n collector.grpcQueue = [];\n\n const credentials: grpc.ChannelCredentials = configureSecurity(\n config.credentials,\n collector.getUrlFromConfig(config)\n );\n\n try {\n if (collector.getServiceClientType() === ServiceClientType.SPANS) {\n const client = new TraceExportServiceClient(collector.url, credentials, {\n 'grpc.default_compression_algorithm': collector.compression.valueOf(),\n });\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n collector.serviceClient = client;\n } else if (collector.getServiceClientType() === ServiceClientType.METRICS) {\n const client = new MetricExportServiceClient(collector.url, credentials, {\n 'grpc.default_compression_algorithm': collector.compression.valueOf(),\n });\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n collector.serviceClient = client;\n } else if (collector.getServiceClientType() === ServiceClientType.LOGS) {\n const client = new LogsExportServiceClient(collector.url, credentials, {\n 'grpc.default_compression_algorithm': collector.compression.valueOf(),\n });\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n collector.serviceClient = client;\n }\n } catch (err) {\n globalErrorHandler(err);\n }\n if (collector.grpcQueue.length > 0) {\n const queue = collector.grpcQueue.splice(0);\n queue.forEach((item: GRPCQueueItem<ExportItem>) => {\n collector.send(item.objects, item.onSuccess, item.onError);\n });\n }\n}\n\nexport function send<ExportItem, ServiceRequest>(\n collector: OTLPGRPCExporterNodeBase<ExportItem, ServiceRequest>,\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n): void {\n if (collector.serviceClient) {\n const serviceRequest = collector.convert(objects);\n const deadline = Date.now() + collector.timeoutMillis;\n\n collector.serviceClient.export(\n serviceRequest,\n collector.metadata || new grpc.Metadata(),\n { deadline: deadline },\n (err: ExportServiceError) => {\n if (err) {\n diag.error('Service request', serviceRequest);\n onError(err);\n } else {\n diag.debug('Objects sent');\n onSuccess();\n }\n }\n );\n } else {\n collector.grpcQueue.push({\n objects,\n onSuccess,\n onError,\n });\n }\n}\n\nexport function validateAndNormalizeUrl(url: string): string {\n const hasProtocol = url.match(/^([\\w]{1,8}):\\/\\//);\n if (!hasProtocol) {\n url = `https://${url}`;\n }\n const target = new URL(url);\n if (target.pathname && target.pathname !== '/') {\n diag.warn(\n 'URL path should not be set when using grpc, the path part of the URL will be ignored.'\n );\n }\n if (target.protocol !== '' && !target.protocol?.match(/^(http)s?:$/)) {\n diag.warn('URL protocol should be http(s)://. Using http://.');\n }\n return target.host;\n}\n\nexport function configureSecurity(\n credentials: grpc.ChannelCredentials | undefined,\n endpoint: string\n): grpc.ChannelCredentials {\n let insecure: boolean;\n\n if (credentials) {\n return credentials;\n } else if (endpoint.startsWith('https://')) {\n insecure = false;\n } else if (\n endpoint.startsWith('http://') ||\n endpoint === DEFAULT_COLLECTOR_URL\n ) {\n insecure = true;\n } else {\n insecure = getSecurityFromEnv();\n }\n\n if (insecure) {\n return grpc.credentials.createInsecure();\n } else {\n return useSecureConnection();\n }\n}\n\nfunction getSecurityFromEnv(): boolean {\n const definedInsecure =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_INSECURE ||\n getEnv().OTEL_EXPORTER_OTLP_INSECURE;\n\n if (definedInsecure) {\n return definedInsecure.toLowerCase() === 'true';\n } else {\n return false;\n }\n}\n\nexport function useSecureConnection(): grpc.ChannelCredentials {\n const rootCertPath = retrieveRootCert();\n const privateKeyPath = retrievePrivateKey();\n const certChainPath = retrieveCertChain();\n\n return grpc.credentials.createSsl(\n rootCertPath,\n privateKeyPath,\n certChainPath\n );\n}\n\nfunction retrieveRootCert(): Buffer | undefined {\n const rootCertificate =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE ||\n getEnv().OTEL_EXPORTER_OTLP_CERTIFICATE;\n\n if (rootCertificate) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), rootCertificate));\n } catch {\n diag.warn('Failed to read root certificate file');\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction retrievePrivateKey(): Buffer | undefined {\n const clientKey =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY ||\n getEnv().OTEL_EXPORTER_OTLP_CLIENT_KEY;\n\n if (clientKey) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), clientKey));\n } catch {\n diag.warn('Failed to read client certificate private key file');\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction retrieveCertChain(): Buffer | undefined {\n const clientChain =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE ||\n getEnv().OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE;\n\n if (clientChain) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), clientChain));\n } catch {\n diag.warn('Failed to read client certificate chain file');\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction toGrpcCompression(\n compression: CompressionAlgorithm\n): GrpcCompressionAlgorithm {\n if (compression === CompressionAlgorithm.NONE)\n return GrpcCompressionAlgorithm.NONE;\n else if (compression === CompressionAlgorithm.GZIP)\n return GrpcCompressionAlgorithm.GZIP;\n return GrpcCompressionAlgorithm.NONE;\n}\n\n/**\n * These values are defined by grpc client\n */\nexport enum GrpcCompressionAlgorithm {\n NONE = 0,\n GZIP = 2,\n}\n\nexport function configureCompression(\n compression: CompressionAlgorithm | undefined\n): GrpcCompressionAlgorithm {\n if (compression) {\n return toGrpcCompression(compression);\n } else {\n const definedCompression =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||\n getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;\n\n return definedCompression === 'gzip'\n ? GrpcCompressionAlgorithm.GZIP\n : GrpcCompressionAlgorithm.NONE;\n }\n}\n"]}
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,sCAAsC;AACtC,4CAA0C;AAC1C,8CAAiE;AACjE,6BAA6B;AAE7B,6BAA0B;AAC1B,yBAAyB;AACzB,mCAIiB;AACjB,0EAI2C;AAE3C,6EAAyE;AACzE,yEAAsE;AACtE,uEAAoE;AAEvD,QAAA,qBAAqB,GAAG,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AACH,CAAC;AAdD,oDAcC","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 * as grpc from '@grpc/grpc-js';\nimport { diag } from '@opentelemetry/api';\nimport { getEnv, globalErrorHandler } from '@opentelemetry/core';\nimport * as path from 'path';\nimport { OTLPGRPCExporterNodeBase } from './OTLPGRPCExporterNodeBase';\nimport { URL } from 'url';\nimport * as fs from 'fs';\nimport {\n GRPCQueueItem,\n OTLPGRPCExporterConfigNode,\n ServiceClientType,\n} from './types';\nimport {\n ExportServiceError,\n OTLPExporterError,\n CompressionAlgorithm,\n} from '@opentelemetry/otlp-exporter-base';\n\nimport { MetricExportServiceClient } from './MetricsExportServiceClient';\nimport { TraceExportServiceClient } from './TraceExportServiceClient';\nimport { LogsExportServiceClient } from './LogsExportServiceClient';\n\nexport const DEFAULT_COLLECTOR_URL = 'http://localhost:4317';\n\nexport function onInit<ExportItem, ServiceRequest>(\n collector: OTLPGRPCExporterNodeBase<ExportItem, ServiceRequest>,\n config: OTLPGRPCExporterConfigNode\n): void {\n collector.grpcQueue = [];\n\n const credentials: grpc.ChannelCredentials = configureSecurity(\n config.credentials,\n collector.getUrlFromConfig(config)\n );\n\n try {\n if (collector.getServiceClientType() === ServiceClientType.SPANS) {\n const client = new TraceExportServiceClient(collector.url, credentials, {\n 'grpc.default_compression_algorithm': collector.compression.valueOf(),\n });\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n collector.serviceClient = client;\n } else if (collector.getServiceClientType() === ServiceClientType.METRICS) {\n const client = new MetricExportServiceClient(collector.url, credentials, {\n 'grpc.default_compression_algorithm': collector.compression.valueOf(),\n });\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n collector.serviceClient = client;\n } else if (collector.getServiceClientType() === ServiceClientType.LOGS) {\n const client = new LogsExportServiceClient(collector.url, credentials, {\n 'grpc.default_compression_algorithm': collector.compression.valueOf(),\n });\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n collector.serviceClient = client;\n }\n } catch (err) {\n globalErrorHandler(err);\n }\n if (collector.grpcQueue.length > 0) {\n const queue = collector.grpcQueue.splice(0);\n queue.forEach((item: GRPCQueueItem<ExportItem>) => {\n collector.send(item.objects, item.onSuccess, item.onError);\n });\n }\n}\n\nexport function send<ExportItem, ServiceRequest>(\n collector: OTLPGRPCExporterNodeBase<ExportItem, ServiceRequest>,\n objects: ExportItem[],\n onSuccess: () => void,\n onError: (error: OTLPExporterError) => void\n): void {\n if (collector.serviceClient) {\n const serviceRequest = collector.convert(objects);\n const deadline = Date.now() + collector.timeoutMillis;\n\n collector.serviceClient.export(\n serviceRequest,\n collector.metadata || new grpc.Metadata(),\n { deadline: deadline },\n (err: ExportServiceError) => {\n if (err) {\n diag.error('Service request', serviceRequest);\n onError(err);\n } else {\n diag.debug('Objects sent');\n onSuccess();\n }\n }\n );\n } else {\n collector.grpcQueue.push({\n objects,\n onSuccess,\n onError,\n });\n }\n}\n\nexport function validateAndNormalizeUrl(url: string): string {\n const hasProtocol = url.match(/^([\\w]{1,8}):\\/\\//);\n if (!hasProtocol) {\n url = `https://${url}`;\n }\n const target = new URL(url);\n if (target.protocol === 'unix:') {\n return url;\n }\n if (target.pathname && target.pathname !== '/') {\n diag.warn(\n 'URL path should not be set when using grpc, the path part of the URL will be ignored.'\n );\n }\n if (target.protocol !== '' && !target.protocol?.match(/^(http)s?:$/)) {\n diag.warn('URL protocol should be http(s)://. Using http://.');\n }\n return target.host;\n}\n\nexport function configureSecurity(\n credentials: grpc.ChannelCredentials | undefined,\n endpoint: string\n): grpc.ChannelCredentials {\n let insecure: boolean;\n\n if (credentials) {\n return credentials;\n } else if (endpoint.startsWith('https://')) {\n insecure = false;\n } else if (\n endpoint.startsWith('http://') ||\n endpoint === DEFAULT_COLLECTOR_URL\n ) {\n insecure = true;\n } else {\n insecure = getSecurityFromEnv();\n }\n\n if (insecure) {\n return grpc.credentials.createInsecure();\n } else {\n return useSecureConnection();\n }\n}\n\nfunction getSecurityFromEnv(): boolean {\n const definedInsecure =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_INSECURE ||\n getEnv().OTEL_EXPORTER_OTLP_INSECURE;\n\n if (definedInsecure) {\n return definedInsecure.toLowerCase() === 'true';\n } else {\n return false;\n }\n}\n\nexport function useSecureConnection(): grpc.ChannelCredentials {\n const rootCertPath = retrieveRootCert();\n const privateKeyPath = retrievePrivateKey();\n const certChainPath = retrieveCertChain();\n\n return grpc.credentials.createSsl(\n rootCertPath,\n privateKeyPath,\n certChainPath\n );\n}\n\nfunction retrieveRootCert(): Buffer | undefined {\n const rootCertificate =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE ||\n getEnv().OTEL_EXPORTER_OTLP_CERTIFICATE;\n\n if (rootCertificate) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), rootCertificate));\n } catch {\n diag.warn('Failed to read root certificate file');\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction retrievePrivateKey(): Buffer | undefined {\n const clientKey =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY ||\n getEnv().OTEL_EXPORTER_OTLP_CLIENT_KEY;\n\n if (clientKey) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), clientKey));\n } catch {\n diag.warn('Failed to read client certificate private key file');\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction retrieveCertChain(): Buffer | undefined {\n const clientChain =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE ||\n getEnv().OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE;\n\n if (clientChain) {\n try {\n return fs.readFileSync(path.resolve(process.cwd(), clientChain));\n } catch {\n diag.warn('Failed to read client certificate chain file');\n return undefined;\n }\n } else {\n return undefined;\n }\n}\n\nfunction toGrpcCompression(\n compression: CompressionAlgorithm\n): GrpcCompressionAlgorithm {\n if (compression === CompressionAlgorithm.NONE)\n return GrpcCompressionAlgorithm.NONE;\n else if (compression === CompressionAlgorithm.GZIP)\n return GrpcCompressionAlgorithm.GZIP;\n return GrpcCompressionAlgorithm.NONE;\n}\n\n/**\n * These values are defined by grpc client\n */\nexport enum GrpcCompressionAlgorithm {\n NONE = 0,\n GZIP = 2,\n}\n\nexport function configureCompression(\n compression: CompressionAlgorithm | undefined\n): GrpcCompressionAlgorithm {\n if (compression) {\n return toGrpcCompression(compression);\n } else {\n const definedCompression =\n getEnv().OTEL_EXPORTER_OTLP_TRACES_COMPRESSION ||\n getEnv().OTEL_EXPORTER_OTLP_COMPRESSION;\n\n return definedCompression === 'gzip'\n ? GrpcCompressionAlgorithm.GZIP\n : GrpcCompressionAlgorithm.NONE;\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.40.0";
1
+ export declare const VERSION = "0.41.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.40.0';
20
+ exports.VERSION = '0.41.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.40.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.41.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/otlp-grpc-exporter-base",
3
- "version": "0.40.0",
3
+ "version": "0.41.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",
@@ -19,7 +19,7 @@
19
19
  "test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
20
20
  "version": "node ../../../scripts/version-update.js",
21
21
  "watch": "npm run protos && tsc -w",
22
- "precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies",
22
+ "precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
23
23
  "prewatch": "npm run precompile"
24
24
  },
25
25
  "keywords": [
@@ -48,20 +48,22 @@
48
48
  "access": "public"
49
49
  },
50
50
  "devDependencies": {
51
- "@babel/core": "7.16.0",
51
+ "@babel/core": "7.22.6",
52
52
  "@opentelemetry/api": "1.4.1",
53
- "@opentelemetry/otlp-transformer": "0.40.0",
54
- "@opentelemetry/resources": "1.14.0",
55
- "@opentelemetry/sdk-trace-base": "1.14.0",
56
- "@types/mocha": "10.0.0",
53
+ "@opentelemetry/otlp-transformer": "0.41.0",
54
+ "@opentelemetry/resources": "1.15.0",
55
+ "@opentelemetry/sdk-trace-base": "1.15.0",
56
+ "@types/mocha": "10.0.1",
57
57
  "@types/node": "18.6.5",
58
- "@types/sinon": "10.0.13",
58
+ "@types/sinon": "10.0.15",
59
59
  "codecov": "3.8.3",
60
60
  "cpx": "1.5.0",
61
- "mocha": "10.0.0",
61
+ "cross-var": "1.1.0",
62
+ "lerna": "7.1.1",
63
+ "mocha": "10.2.0",
62
64
  "nyc": "15.1.0",
63
- "protobufjs-cli": "1.0.2",
64
- "sinon": "15.0.0",
65
+ "protobufjs-cli": "1.1.1",
66
+ "sinon": "15.1.2",
65
67
  "ts-loader": "8.4.0",
66
68
  "ts-mocha": "10.0.0",
67
69
  "typescript": "4.4.4"
@@ -71,11 +73,12 @@
71
73
  },
72
74
  "dependencies": {
73
75
  "@grpc/grpc-js": "^1.7.1",
74
- "@opentelemetry/core": "1.14.0",
75
- "@opentelemetry/otlp-exporter-base": "0.40.0",
76
- "protobufjs": "^7.2.2"
76
+ "@opentelemetry/core": "1.15.0",
77
+ "@opentelemetry/otlp-exporter-base": "0.41.0",
78
+ "protobufjs": "^7.2.3",
79
+ "tslib": "^2.3.1"
77
80
  },
78
81
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-grpc-exporter-base",
79
82
  "sideEffects": false,
80
- "gitHead": "edebbcc757535bc88f01340409dbbecc0bb6ccf8"
83
+ "gitHead": "06e919d6c909e8cc8e28b6624d9843f401d9b059"
81
84
  }