@plusscommunities/pluss-llm-telemetry-aws
v1.0.0
Published
Dependency-free shared LLM invocation telemetry for Pluss Communities AWS services
Downloads
547
Keywords
Readme
@plusscommunities/pluss-llm-telemetry-aws
Dependency-free CommonJS telemetry for Pluss Communities LLM invocations. The package exports:
withLlmTelemetry(options), which records one JSON-safellm.invocationevent while preserving the provider result or thrown-error identity.GLOBAL_COMMUNITY_ID, the attribution value for model calls that are not scoped to one community.
The event includes the complete normalized prompt and completion, model and operation identifiers, token usage, latency, pricing evidence, feature/community attribution, trace correlation, and projected provider diagnostics. usageIncomplete is 1 when either input or output usage is missing. telemetryError distinguishes a success-extraction failure from legitimately absent provider usage. Callers must provide deployment-pinned USD token pricing and may inject extraction, logging, clock, invocation-ID, and onTelemetryError functions. Logger failures never replace the provider outcome; without an injected reporter they produce a minimal JSON-safe llm.telemetry_error line on stderr.
Import boundary
Backend extensions must not import this package directly. They must use the stable core facade:
const {
GLOBAL_COMMUNITY_ID,
withLlmTelemetry,
} = require("@plusscommunities/pluss-core-aws/helper/llmTelemetry");Parent backend services that do not need the legacy core package may depend on this zero-runtime-dependency package directly.
Release order
Release consumers only in this order:
- Publish
@plusscommunities/[email protected]. - Publish
@plusscommunities/[email protected], whose facade depends on telemetry1.0.0. - Publish every newsletter package variant at
2.0.12, then update and release the parentminuss-awssupport-assistant integration. - After committing these extension-repository changes, update the
pluss-extension-awsgitlink in the real parentminuss-awsrepository to that extension commit.
Do not publish core or install it in a registry-exact consumer before telemetry 1.0.0 is available.
