{"name":"@opentelemetry/exporter-logs-otlp-http","version":"0.214.0","keywords":["opentelemetry","nodejs","browser","tracing","profiling","logs","stats"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/exporter-logs-otlp-http@0.214.0","maintainers":[{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"npmjs-account","email":"npmjs-account@opentelemetry.io"},{"name":"trentm","email":"trentm@gmail.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-logs-otlp-http","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"6241fca77ef1c0220fc0b61d820b57baa8f54030","tarball":"http://registry-npm.ywwl.com/@opentelemetry/exporter-logs-otlp-http/download/@opentelemetry/exporter-logs-otlp-http-0.214.0.tgz","fileCount":66,"integrity":"sha512-9qv2Tl/Hq6qc5pJCbzFJnzA0uvlb9DgM70yGJPYf3bA5LlLkRCpcn81i4JbcIH4grlQIWY6A+W7YG0LLvS1BAw==","signatures":[{"sig":"MEQCIELZybYbDnzvfFMTDrP3f/IxlLopffXxFabErCz5bV9cAiAsViLd6P8KqV0825RLTPXDcqLtLDh00aEuuTBQgVW18w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fexporter-logs-otlp-http@0.214.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46880,"size":10074,"noattachment":false,"key":"/@opentelemetry/exporter-logs-otlp-http/-/@opentelemetry/exporter-logs-otlp-http-0.214.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":"7e74509a4d848e94b2970bb5262dd3e8efeed0a2","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","tdd:browser":"karma start","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":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48686890-34eb-4727-ac92-31a287036448"}},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/9.0.5/node@v24.14.0+x64 (linux)","description":"OpenTelemetry Collector Logs Exporter allows user to send collected logs to the OpenTelemetry Collector","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","dependencies":{"@opentelemetry/core":"2.6.1","@opentelemetry/api-logs":"0.214.0","@opentelemetry/sdk-logs":"0.214.0","@opentelemetry/otlp-transformer":"0.214.0","@opentelemetry/otlp-exporter-base":"0.214.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"17.1.0","karma":"6.4.4","mocha":"11.7.5","sinon":"18.0.1","webpack":"5.104.1","ts-loader":"9.5.4","typescript":"5.0.4","@babel/core":"7.27.1","@types/node":"18.19.130","karma-mocha":"2.0.1","webpack-cli":"7.0.2","@types/mocha":"10.0.10","@types/sinon":"17.0.4","babel-loader":"10.0.0","karma-webpack":"5.0.1","karma-coverage":"2.2.1","@babel/preset-env":"7.27.2","@opentelemetry/api":"1.9.1","@types/webpack-env":"1.16.3","karma-spec-reporter":"0.0.36","babel-plugin-istanbul":"7.0.1","karma-chrome-launcher":"3.1.0","@opentelemetry/resources":"2.6.1"},"peerDependencies":{"@opentelemetry/api":"^1.3.0"},"_npmOperationalInternal":{"tmp":"tmp/exporter-logs-otlp-http_0.214.0_1774454119490_0.8941751751684088","host":"s3://npm-registry-packages-npm-production"},"readme":"# OpenTelemetry Collector Logs Exporter for web and node with 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/json) using protocol version `v1.7.0`.\n\n## Installation\n\n```bash\nnpm install --save @opentelemetry/exporter-logs-otlp-http\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, visit the [Collector Trace Exporter for web and node][trace-exporter-url].\nTo see documentation and sample code for the metric exporter, see the [exporter-metrics-otlp-grpc package][metrics-exporter-url]\n\n## Logs in Web\n\nThe OTLPLogExporter in Web expects the endpoint to end in `/v1/logs`.\n\n```js\nimport { SeverityNumber } from '@opentelemetry/api-logs';\nimport {\n  LoggerProvider,\n  BatchLogRecordProcessor,\n} from '@opentelemetry/sdk-logs';\nimport { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';\n\n// exporter options. see all options in OTLPExporterConfigBase\nconst collectorOptions = {\n  url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is http://localhost:4318/v1/logs\n  headers: {}, // an optional object containing custom headers to be sent with each request\n  concurrencyLimit: 1, // an optional limit on pending requests\n};\nconst logExporter = new OTLPLogExporter(collectorOptions);\nconst loggerProvider = new LoggerProvider({\n  processors: [new BatchLogRecordProcessor({ exporter: logExporter })]\n});\n\nconst logger = loggerProvider.getLogger('default', '1.0.0');\n// Emit a log\nlogger.emit({\n  severityNumber: SeverityNumber.INFO,\n  severityText: 'info',\n  body: 'this is a log body',\n  attributes: { 'log.type': 'custom' },\n});\n```\n\n## Logs in Node\n\n```js\nimport {\n  LoggerProvider,\n  BatchLogRecordProcessor,\n} from '@opentelemetry/sdk-logs';\nimport { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';\n\n// exporter options. see all options in OTLPExporterNodeConfigBase\nconst collectorOptions = {\n  url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is http://localhost:4318/v1/logs\n  concurrencyLimit: 1, // an optional limit on pending requests\n};\nconst logExporter = new OTLPLogExporter(collectorOptions);\nconst loggerProvider = new LoggerProvider({\n  processors: [new BatchLogRecordProcessor({ exporter: logExporter })]\n});\n\nconst logger = loggerProvider.getLogger('default', '1.0.0');\n// Emit a log\nlogger.emit({\n  severityNumber: SeverityNumber.INFO,\n  severityText: 'info',\n  body: 'this is a log body',\n  attributes: { 'log.type': 'custom' },\n});\n```\n\n## Environment Variable Configuration\n\nIn addition to settings passed to the constructor, the exporter also supports configuration via environment variables:\n\n| Environment variable             | Description                                                                                                                                                                                                                                              |\n| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| OTEL_EXPORTER_OTLP_ENDPOINT      | The endpoint to send logs to. This will also be used for the traces exporter if `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` is not configured. By default `http://localhost:4318` will be used. `/v1/logs` will be automatically appended to configured values. |\n| OTEL_EXPORTER_OTLP_LOGS_ENDPOINT | The endpoint to send logs to. By default `http://localhost:4318/v1/logs` will be used. `v1/logs` will not be appended automatically and has to be added explicitly.                                                                                      |\n| OTEL_EXPORTER_OTLP_LOGS_TIMEOUT  | The maximum waiting time, in milliseconds, allowed to send each OTLP log batch. Default is 10000.                                                                                                                                                        |\n| OTEL_EXPORTER_OTLP_TIMEOUT       | The maximum waiting time, in milliseconds, allowed to send each OTLP trace/metric/log batch. Default is 10000.                                                                                                                                           |\n\n> Settings configured programmatically take precedence over environment variables. Per-signal environment variables take precedence over non-per-signal environment variables.\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-http\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-http.svg\n[trace-exporter-url]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/exporter-trace-otlp-http\n[metrics-exporter-url]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http\n","publish_time":1774454119646,"_cnpm_publish_time":1774454119646,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0"}}