feat(logs): add agentkit logs --harness <name>#75
Merged
Conversation
…logs Query a deployed harness runtime's logs from APMPlus / TLS (VE Sign auth): - Resolve the runtime by name (or RuntimeId) and verify the deploy-time harness tag (agentkit:agenttype=harness); reject non-harness apps with a clear message. - GetLogModuleConfig (APMPlus, signed via _sigv4.sign_headers) yields the TLS LogTopicId; SearchLogs (api-version 0.3.0) runs via the official volcengine.tls SDK, which handles TLS-specific signing. - Default filter service:<runtime_id>.<name>; flags: --query, --since (1h/30m/2d), --start/--end (epoch ms), --limit (default 200), --sort, --tls-endpoint, --output (write to file), --raw. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
agentkit logs --harness <name>to query a deployed harness runtime's logs from APMPlus / TLS, authenticated with Volcengine signing (VE Sign).How it works
agentkit:agenttype=harness. Non-harness apps are rejected with非 Harness 应用,无法查询日志.GetLogModuleConfig(APMPlus OpenAPI, signed viaagentkit.auth._sigv4.sign_headers) returns the TLSLogTopicId.SearchLogs(api-version 0.3.0) runs through the officialvolcengine.tlsSDK, which handles TLS-specific signing (serviceTLS,Content-MD5/x-tls-apiversion).Default filter is
service:<runtime_id>.<name>.Flags
--query,--since(e.g.1h/30m/2d/1h30m, mutually exclusive with--start),--start/--end(epoch ms),--limit(default 200),--sort,--tls-endpoint,--output/-o(write to file),--raw.Tests
tests/toolkit/cli/test_cli_logs.py— 9 cases: non-harness rejection, runtime-not-found, default query build,--queryoverride,--sinceparsing/window,--since+--startconflict,--outputfile write. All pass; ruff clean.🤖 Generated with Claude Code