feat(callbacks/tls): add opt-in TLS observability callback - #936
feat(callbacks/tls): add opt-in TLS observability callback#936runninggo wants to merge 13 commits into
Conversation
import TLS callback module into eino-ext align tracing hooks with existing callback integrations add regression tests for tool-name mapping and stream concat behavior
07477ad to
460ba5d
Compare
| return "" | ||
| } | ||
| var value any | ||
| if json.Unmarshal([]byte(raw), &value) == nil { |
There was a problem hiding this comment.
This json.Unmarshal into any converts JSON numbers to float64, so the later marshal in the Lens payload can round legitimate tool arguments. For example, {"record_id":9007199254740993} becomes {"record_id":9007199254740992}.
Please preserve the raw JSON (for example, json.RawMessage) or decode with json.Decoder.UseNumber, and add a regression test for an integer above 2^53.
| } | ||
| } | ||
|
|
||
| func WithAggrMessageOutput(enable bool) Option { |
There was a problem hiding this comment.
WithAggrMessageOutput(false) currently has no observable effect. The value is stored in defaultDataParser, but ParseStreamOutput always calls tryConcatOutputChunks and exports the aggregated message.
Please branch the stream-output behavior on this option (and cover both settings), or remove the public option if aggregation must remain unconditional.
| }) | ||
| } | ||
|
|
||
| // WithTLSInsecure disables client transport security for the exporter's gRPC with tls |
There was a problem hiding this comment.
This option name and doc say it disables transport security, but the implementation passes credentials.NewClientTLSFromCert(nil, ""), which enables normal certificate-validating TLS and is effectively the OTLP client's default secure path.
Please remove or rename this no-op API to describe its real behavior. If an insecure transport is actually required, use the existing WithInsecure option explicitly rather than publishing a misleading TLS-specific alternative.
What type of PR is this?
feat: A new opt-in callback integration.
Check the PR title
<type>(optional scope): <description>More detailed description
en:
Adds
callbacks/tls, an opt-in Eino callback module that exports callback spans to Volcengine TLS. It keeps existing callback and generic OTLP behavior unchanged unless TLS export is explicitly configured.The module records
agent.turn,llm.request, andtool.callspans, aggregates streaming chunks before exporting, and attaches token usage, provider/model metadata, tool arguments/results, error state, and duration when available.The PR also adds TLS transport options in
libs/acl/opentelemetryand Ark callback usage metadata needed for complete trace attribution.The module-local
genprotoreplacement was removed so downstream consumers do not rely on non-transitive Go module configuration.zh(optional):
新增可选的
callbacks/tls回调模块,将 Eino 回调 Span 导出到 Volcengine TLS;未显式配置时不会改变现有 callback 或通用 OTLP 行为。流式输出会在导出前聚合,并保留模型、Token、工具调用、错误和耗时信息。Which issue(s) this PR fixes
Fixes #935
Validation
go test -mod=readonly -race -gcflags='all=-l -N' ./...incallbacks/tlsgo test -mod=readonly -race -gcflags='all=-l -N' ./...inlibs/acl/opentelemetrygo test -mod=readonly -race -gcflags='all=-l -N' ./...incomponents/model/arkgofmt, andgit diff --checkverified.Upstream GitHub Actions will run after this PR is opened.