{"_id":"@opentelemetry/configuration@0.301.0","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"cba5d76ee20edbd4d974f260b3a3b248b8bbddaf","tarball":"http://registry-npm.ywwl.com/@opentelemetry/configuration/download/@opentelemetry/configuration-0.301.0.tgz","fileCount":29,"integrity":"sha512-pq68mOXEwi/4ojJBc38VEGg3qADsTt5I+mDHgxCh03nAg/QcD7NR4xjY9htyhWkFTQZFKyg9PR3At0GJKaYBFg==","signatures":[{"sig":"MEQCICFRSUkCD6cRDD8jCpPr8gI14aVBpSoA4JWQy5nvmwcwAiBBNPdv5wSmaRnhJgH3f8SQQu75WAagJ2BLEZ3VDf2nOg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFl4p1fg4daONyMedECYIa7fuJ7+DS2XlsalybOIeVFJAiEAw49DQfRcoNgfFuRg/ABsEc62fY2UJPHCGYhB1/qG2v4="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fconfiguration@0.301.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2752602,"size":303442,"noattachment":false,"key":"/@opentelemetry/configuration/-/@opentelemetry/configuration-0.301.0.tgz"},"main":"./dist/index.cjs","name":"@opentelemetry/configuration","types":"./dist/index.d.cts","author":{"name":"OpenTelemetry Authors"},"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":"9985264933cc7d93bfa4cbd02f1de562a050e9ce","license":"Apache-2.0","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"},"version":"0.301.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"2d094cca-73e2-442c-94ea-74a30988c6a0"}},"homepage":"https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/configuration","keywords":["opentelemetry","configuration"],"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/10.1.1/node@v24.22.2+x64 (linux)","description":"OpenTelemetry Configuration","directories":{},"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"}],"sideEffects":false,"_nodeVersion":"24.22.2","dependencies":{"yaml":"^2.8.3","@opentelemetry/core":"3.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.0.0","nyc":"18.0.0","mocha":"12.0.3","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.10.0","json-schema-to-typescript":"^15.0.0"},"peerDependencies":{"@opentelemetry/api":"^1.10.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/configuration_0.301.0_1793903720195_0.7280730503607487"},"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":1793903720367,"_cnpm_publish_time":1793903720367,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0"}}