{"name":"@opentelemetry/exporter-logs-otlp-proto","version":"0.200.0-dev.0","keywords":["opentelemetry","nodejs","protobuf","tracing","profiling","metrics","stats","logs"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/exporter-logs-otlp-proto@0.200.0-dev.0","maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-logs-otlp-proto","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"ec563bd680091e5f6d9cad117b918b0b58212158","tarball":"http://registry-npm.ywwl.com/@opentelemetry/exporter-logs-otlp-proto/download/@opentelemetry/exporter-logs-otlp-proto-0.200.0-dev.0.tgz","fileCount":66,"integrity":"sha512-AjHXy6La8/V8zFAJrAWLsc8S4Sb6IBqfz0w47+CL2kFgITGDj5x20p7yxwADa4C7r0ptzteTWaDs4R7WhePQEQ==","signatures":[{"sig":"MEUCIAOW9LOS3KbFdjitahcVwRoGeeMTyexeGlr7p9/F9GWhAiEAz6svd925Y2MSsOd/ihR3DAC/SQY2eLuwZAKvqoCTnuY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fexporter-logs-otlp-proto@0.200.0-dev.0","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":69053,"size":10940,"noattachment":false,"key":"/@opentelemetry/exporter-logs-otlp-proto/-/@opentelemetry/exporter-logs-otlp-proto-0.200.0-dev.0.tgz"},"main":"build/src/index.js","types":"build/src/index.d.ts","esnext":"build/esnext/index.js","module":"build/esm/index.js","browser":{"./src/platform/index.ts":"./src/platform/browser/index.ts","./build/esm/platform/index.js":"./build/esm/platform/browser/index.js","./build/src/platform/index.js":"./build/src/platform/browser/index.js","./build/esnext/platform/index.js":"./build/esnext/platform/browser/index.js"},"engines":{"node":"^18.19.0 || >=20.6.0"},"gitHead":"544c40984797dd2e2cccb92cce0e88b30f235b02","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","lint":"eslint . --ext .ts","test":"nyc mocha 'test/**/*.test.ts' --exclude 'test/browser/**/*.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json","compile":"tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json","version":"node ../../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","prewatch":"npm run precompile","precompile":"cross-var lerna run version --scope $npm_package_name --include-dependencies","test:browser":"karma start --single-run","align-api-deps":"node ../../../scripts/align-api-deps.js","peer-api-check":"node ../../../scripts/peer-api-check.js","prepublishOnly":"npm run compile"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/6.6.2/node@v18.20.6+x64 (linux)","description":"An OTLP exporter to send logs using protobuf over HTTP","directories":{},"sideEffects":false,"_nodeVersion":"18.20.6","dependencies":{"@opentelemetry/core":"2.0.0-dev.0","@opentelemetry/api-logs":"0.200.0-dev.0","@opentelemetry/sdk-logs":"0.200.0-dev.0","@opentelemetry/resources":"2.0.0-dev.0","@opentelemetry/sdk-trace-base":"2.0.0-dev.0","@opentelemetry/otlp-transformer":"0.200.0-dev.0","@opentelemetry/otlp-exporter-base":"0.200.0-dev.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"17.1.0","karma":"6.4.4","lerna":"6.6.2","mocha":"11.1.0","sinon":"15.1.2","webpack":"5.96.1","cross-var":"1.1.0","ts-loader":"9.5.2","typescript":"5.0.4","@babel/core":"7.26.9","@types/node":"18.6.5","karma-mocha":"2.0.1","webpack-cli":"6.0.1","@types/mocha":"10.0.10","@types/sinon":"17.0.4","karma-webpack":"5.0.1","karma-coverage":"2.2.1","@babel/preset-env":"7.26.9","@opentelemetry/api":"1.9.0","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"7.0.0","karma-chrome-launcher":"3.1.0"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/exporter-logs-otlp-proto_0.200.0-dev.0_1740420203608_0.10970556204824944","host":"s3://npm-registry-packages-npm-production"},"readme":"# An OTLP exporter to send logs using protobuf over HTTP\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\n**Note: This is an experimental package under active development. New releases may include breaking changes.**\n\nThis module provides a logs-exporter for OTLP (http/protobuf) using protocol version `v1.7.0`.\n\n## Installation\n\n```bash\nnpm install --save @opentelemetry/exporter-logs-otlp-proto\n```\n\n## Shared HTTP exporter options\n\nThis exporter uses the shared HTTP options documented in [`@opentelemetry/otlp-exporter-base`][otlp-exporter-base-config].\nThat includes `url`, `headers`, `timeoutMillis`, `concurrencyLimit`, and Node.js options such as `compression`, `keepAlive`, `httpAgentOptions`, and `userAgent`.\n\n## Further Documentation\n\nTo see documentation and sample code for the traces exporter, as well as instructions for using TLS, see the [exporter-trace-otlp-proto package][trace-exporter-url].\nTo see documentation and sample code for the metric exporter, see the [opentelemetry-exporter-metrics-otlp-proto package][metrics-exporter-url].\n\n## Example Setup\n\n```js\nconst { LoggerProvider, SimpleLogRecordProcessor } = require('@opentelemetry/sdk-logs');\nconst { OTLPLogExporter } =  require('@opentelemetry/exporter-logs-otlp-proto');\n\nconst collectorOptions = {\n  url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is http://localhost:4318/v1/logs\n  headers: {\n    foo: 'bar'\n  }, //an optional object containing custom headers to be sent with each request will only work with http\n};\n\nconst logExporter = new OTLPLogExporter(collectorOptions);\nconst logProvider = new LoggerProvider({\n  resource: resourceFromAttributes({'service.name': 'testApp'}),\n  processors: [new SimpleLogRecordProcessor({ exporter: logExporter })]\n  });\n\nconst logger = logProvider.getLogger('test_log_instrumentation');\n\nlogger.emit({\n  //log data to emit\n})\n```\n\n## Exporter Timeout Configuration\n\nThe OTLPLogExporter has a timeout configuration option which is the maximum time, in milliseconds, the OTLP exporter will wait for each batch export. The default value is 10000ms.\n\nTo override the default timeout duration, use the following options:\n\n- Set with environment variables:\n\n  | Environment variable              | Description                                                                                                    |\n  | --------------------------------- | -------------------------------------------------------------------------------------------------------------- |\n  | `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` | The maximum waiting time, in milliseconds, allowed to send each OTLP trace batch. Default is 10000.            |\n  | `OTEL_EXPORTER_OTLP_TIMEOUT`      | The maximum waiting time, in milliseconds, allowed to send each OTLP trace and metric batch. Default is 10000. |\n\n  > `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` takes precedence and overrides `OTEL_EXPORTER_OTLP_TIMEOUT`.\n\n- Provide `timeoutMillis` to OTLPLogExporter with `collectorOptions`:\n\n  ```js\n  const collectorOptions = {\n    timeoutMillis: 15000,\n    url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is http://localhost:4318/v1/logs\n    headers: {\n      foo: 'bar'\n    }, //an optional object containing custom headers to be sent with each request will only work with http\n  };\n\n  const exporter = new OTLPLogExporter(collectorOptions);\n  ```\n\n  > Providing `timeoutMillis` with `collectorOptions` takes precedence and overrides timeout set with environment variables.\n\n## OTLP Exporter Retry\n\nOTLP requires that transient errors be handled with a [retry strategy](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#retry).\n\nThis retry policy has the following configuration, which there is currently no way to customize.\n\n- `DEFAULT_EXPORT_MAX_ATTEMPTS`: The maximum number of attempts, including the original request. Defaults to 5.\n- `DEFAULT_EXPORT_INITIAL_BACKOFF`: The initial backoff duration. Defaults to 1 second.\n- `DEFAULT_EXPORT_MAX_BACKOFF`: The maximum backoff duration. Defaults to 5 seconds.\n- `DEFAULT_EXPORT_BACKOFF_MULTIPLIER`: The backoff multiplier. Defaults to 1.5.\n\nThis retry policy first checks if the response has a `'Retry-After'` header. If there is a `'Retry-After'` header, the exporter will wait the amount specified in the `'Retry-After'` header before retrying. If there is no `'Retry-After'` header, the exporter will use an exponential backoff with jitter retry strategy.\n\n  > The exporter will retry exporting within the [exporter timeout configuration](#exporter-timeout-configuration) time.\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/exporter-logs-otlp-proto\n[otlp-exporter-base-config]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-exporter-base#http-exporter-configuration\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fexporter-logs-otlp-proto.svg\n[trace-exporter-url]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-proto\n[metrics-exporter-url]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-proto\n","publish_time":1740420203764,"_cnpm_publish_time":1740420203764,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0"}}