{"name":"@opentelemetry/configuration","version":"0.300.0-development.1","keywords":["opentelemetry","configuration"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/configuration@0.300.0-development.1","maintainers":[{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"overbalance","email":"overbalancedev@proton.me"},{"name":"npmjs-account","email":"npmjs-account@opentelemetry.io"},{"name":"trentm","email":"trentm@gmail.com"},{"name":"martinkuba","email":"martin@martinkuba.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/configuration","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"1d4ace0cf3d4c41a92bf649cfdc6bd9c45e0beb2","tarball":"http://registry-npm.ywwl.com/@opentelemetry/configuration/download/@opentelemetry/configuration-0.300.0-development.1.tgz","fileCount":53,"integrity":"sha512-s7wjj8GxZ4NaSWM97ZWY0fgsagvtDd0W4rcPLUqZmoAecbR1T0q1utQHQPTTZKjvDgIdxNjT1jdkcvlV/ISSVA==","signatures":[{"sig":"MEUCIBgoXkF2v568QNnsrBcMkKk+VadB24gWAY46scz9ZpZeAiEA++m/D5Qm5RVjt0LcE41FZ7/Kpn/m49wDZVK479HCxRM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIHWyi8mJVrWmPkyE16DFptLZPRSmDu8V4VLuJ4NuBr2+AiB42you5AxUAKmaF1NY/yRPc3gxMTAgf/xS4imRVfEqAg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fconfiguration@0.300.0-development.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2901359,"size":328556,"noattachment":false,"key":"/@opentelemetry/configuration/-/@opentelemetry/configuration-0.300.0-development.1.tgz"},"main":"./dist/index.cjs","types":"./dist/index.d.cts","engines":{"node":">=22.15.0"},"exports":{".":{"default":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"83d76963961161511591d5585407d23b5f035a37","scripts":{"lint":"eslint .","test":"nyc mocha test/**/*.test.ts","clean":"rimraf dist build","watch":"tsdown --watch --no-clean","compile":"tsdown","version":"node ../../../scripts/version-update.js","lint:fix":"eslint . --fix","align-api-deps":"node ../../../scripts/align-api-deps.mjs","peer-api-check":"node ../../../scripts/peer-api-check.mjs","prepublishOnly":"npm run compile","generate:config":"node ./scripts/generate-config.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"2d094cca-73e2-442c-94ea-74a30988c6a0"}},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/10.0.1/node@v24.21.0+x64 (linux)","description":"OpenTelemetry Configuration","directories":{},"sideEffects":false,"_nodeVersion":"24.21.0","dependencies":{"yaml":"^2.8.3","@opentelemetry/core":"3.0.0-development.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"^8.0.0","nyc":"18.0.0","mocha":"11.8.0","sinon":"18.0.1","ts-loader":"9.5.7","typescript":"5.2.2","@types/node":"18.19.130","@types/mocha":"10.0.10","@types/sinon":"17.0.4","@opentelemetry/api":"^1.9.0 || 1.10.0-development.1","json-schema-to-typescript":"^15.0.0"},"peerDependencies":{"@opentelemetry/api":"^1.9.0 || 1.10.0-development.1"},"_npmOperationalInternal":{"tmp":"tmp/configuration_0.300.0-development.1_1791189326980_0.7397306824509684","host":"s3://npm-registry-packages-npm-production"},"readme":"# OpenTelemetry Declarative Configuration\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 package implements a part of the [OpenTelemetry declarative configuration](https://opentelemetry.io/docs/specs/otel/configuration/#declarative-configuration) specification for Node.js. It exports:\n\n- a suite of TypeScript types representing [the configuration types](https://opentelemetry.io/docs/specs/otel-config/types/) defined by [the declarative config schema](https://github.com/open-telemetry/opentelemetry-configuration#readme);\n- [`parseConfigFile()` to parse and validate](https://opentelemetry.io/docs/specs/otel/configuration/sdk/#parse) a YAML configuration, which can then be used (e.g. by `@opentelemetry/sdk-node`) to setup an OpenTelemetry SDK; and\n- some utilities for working with parsed configuration data.\n\n## Installation\n\n```sh\nnpm install @opentelemetry/configuration\n```\n\n## Usage\n\n```js\nimport { parseConfigFile } from '@opentelemetry/configuration';\nconst config = parseConfigFile('./otel-sdk-config.yaml');\n```\n\nAn extremely limit example configuration file:\n\n```yaml\nfile_format: \"1.1\"\ntracer_provider:\n  processors:\n    - batch:\n        exporter:\n          otlp_http:\n            endpoint: ${OTEL_EXPORTER_ENDPOINT:-http://localhost:4318}/v1/traces\n```\n\nEnvironment variable substitution is supported using `${VAR_NAME}`, `${VAR_NAME:-default}`, `${env:VAR_NAME}`, and `${env:VAR_NAME:-default}` syntax. Use `$$` for a literal `$`.\n\nSee <https://opentelemetry.io/docs/specs/otel/configuration/#declarative-configuration> and <https://github.com/open-telemetry/opentelemetry-configuration> for documentation, examples, and a JSON schema for declarative configuration.\n\n## Supported schema versions\n\n- `1.0`\n- `1.1`\n\nFor a per-field view of which schema fields the SDK currently applies, see\nthe JS row in the cross-SDK [language support status][lss] doc maintained in\nthe `opentelemetry-configuration` repo. That doc is the source of truth for\ndeclarative-config conformance across all SDKs.\n\n[lss]: https://github.com/open-telemetry/opentelemetry-configuration/blob/main/language-support-status.md#js-\n\n## Exported types\n\nTypes exported from this package that model configuration data use a `ConfigModel` suffix (e.g. `SamplerConfigModel`, `SpanExporterConfigModel`) rather than their schema name (e.g. `Sampler`, `SpanExporter`). This keeps them from colliding with the SDK runtime types of the same name. The root type is `ConfigurationModel`.\n\nInternally the package uses the schema names from `src/generated/types.ts`; the renaming happens at export time in `src/index.ts`. Follow this convention when adding new exports.\n\n## Development\n\n### Generated files\n\n`src/generated/` is auto-generated — do not edit manually. It contains:\n\n- `types.ts` — TypeScript interfaces derived from the JSON schema (via `json-schema-to-typescript`)\n- `validator.js` — Pre-compiled ajv validator (ahead-of-time compiled from the schema at build time; eliminates runtime `ajv.compile()`)\n- `validator.d.ts` — TypeScript declarations for `validator.js`\n\n### Regenerating after a schema version bump\n\n1. Update the `CONFIG_VERSION` constant in `scripts/generate-config.js`\n2. Run from this package directory:\n\n   ```sh\n   npm run generate:config\n   ```\n\n3. Review the diff in `src/generated/types.ts` and `src/generated/validator.js`\n4. Update `SUPPORTED_FILE_FORMAT_MAJOR` / `SUPPORTED_FILE_FORMAT_MINOR` in `src/FileConfigFactory.ts` if the new schema version is outside the currently-supported range\n5. Update `EnvironmentConfigFactory.ts` and `utils.ts` if new fields need env var mapping\n\nThe generation script (`scripts/generate-config.js`) handles several post-processing steps:\n\n- Renames the root type from `OpenTelemetryConfiguration` to `ConfigurationModel`\n- Makes `file_format` optional (required at parse time but not needed when constructing the model in code)\n- Removes the duplicate type declarations that `json-schema-to-typescript` emits for structurally-identical sub-schemas (e.g. the second `GrpcTls`/`HttpTls`)\n- Produces a pre-compiled ajv validator (`validator.js` + `validator.d.ts`) for use at runtime\n\n## Useful links\n\n- [OpenTelemetry Declarative Configuration Specification](https://github.com/open-telemetry/opentelemetry-configuration)\n- [OpenTelemetry for Node.js](https://github.com/open-telemetry/opentelemetry-js)\n- [OpenTelemetry Community](https://opentelemetry.io/)\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/configuration\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fconfiguration.svg\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","publish_time":1791189327097,"_cnpm_publish_time":1791189327097,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0"}}