@volcengine/tls-observer-pi
v0.0.2
Published
Export Pi plugin telemetry to Volcengine TLS with GenAI OTEL traces.
Maintainers
Readme
TLS Observer for Pi
Pi Coding Agent plugin that converts Pi lifecycle events into GenAI OTEL traces and exports them to Volcengine TLS.
Trace shape
agent.turn (server)
llm.request (client)
tool.call (client)The plugin listens to Pi public lifecycle hooks, groups them by session and turn in memory, and exports one agent.turn trace when the turn or agent run finishes.
Configuration
Environment variables:
PI_TLS_EXPORT=0disables export.PI_TLS_ENV_FILEoptionally points to an env file. Defaults to~/.pi/agent/tls-observer-pi.env.PI_TLS_DATA_ROOToverrides local send-log and retry state.PI_TLS_CAPTURE_CONTENT=0disables prompt/response/tool content capture.PI_TLS_ENDPOINTorTRACE_TLS_ENDPOINTorTLS_ENDPOINTPI_TLS_REGIONorTRACE_TLS_REGIONorTLS_REGIONPI_TLS_TRACE_TOPIC_IDorPI_TLS_TOPIC_IDorTRACE_TLS_TRACE_TOPIC_IDorTLS_TRACE_TOPIC_IDPI_TLS_API_KEYorTRACE_TLS_API_KEYorTLS_API_KEYPI_TLS_AK/PI_TLS_SKorTRACE_TLS_AK/TRACE_TLS_SKorTLS_AK/TLS_SK
Default data root:
~/.pi/agent/tls-observer-piPi plugin loading
Install with the dedicated installer:
npm exec -y --package=@volcengine/tls-observer-pi-install -- tls-observer-pi-installIf pi is not on PATH, pass PI_TLS_PI_BIN=/absolute/path/to/pi or --pi-bin /absolute/path/to/pi.
For local installs, build the runtime package first and point the installer at the package source. The installer uses Pi CLI install semantics: pi install npm:<package> for registry installs and pi install <local-path> for local runtime packages.
cd packages/pi
rslib build
node scripts/build-package.mjs
cd ../pi-install
PI_PLUGIN_SOURCE=../pi/dist-package npm exec -y -- tls-observer-pi-install
cd -Design notes
This implementation uses a clean-room Pi adapter. It borrows the event-aggregation idea from existing Pi tracing integrations, but the code, names, state model, and TLS span mapping are independently implemented for this repository.
