activeagents-telemetry 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fe9ec7ae7a6a457e50b5da5ec21640978ce363718236c64b3eb0b1a16fe1b7f7
|
|
4
|
+
data.tar.gz: f225f754c6365b3bc7b75d683e9f8684954e68d2b8b69e010c51b2b7f04485bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7e70e2daef1faa3527d61fcd303f6783cbac2ce32da62c5cf053fc215dc5e602a166b6b9791bee256f041a04474557e75719563f1a3e077b8218650a3296704
|
|
7
|
+
data.tar.gz: a0b55b62db84a92e41cff0ad30edc2b420fff2a947d10665f9acaf8938bb469068cc797940e89a7d3ed53a5a0ec25efc95a738b4b1c395b6b1ecb56a083dec81
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [0.3.0] - 2026-09-12
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `RubyLLM.with_agent` takes `attributes:`, `on_trace:` and `synchronous:`.
|
|
8
|
+
`attributes` are merged onto the root span of every trace recorded in the
|
|
9
|
+
block, with the `agent.*` identity keys taking precedence, so an evaluation
|
|
10
|
+
can stamp its run and result identifiers on the traces it causes. `on_trace`
|
|
11
|
+
receives each trace the reporter accepted for delivery, so the caller can
|
|
12
|
+
keep the `trace_id` of that delivery attempt; a trace dropped by
|
|
13
|
+
`sample_rate` or a disabled configuration is never announced. Acceptance is
|
|
14
|
+
not ingestion: a delivery that fails afterwards is logged by the reporter,
|
|
15
|
+
not surfaced to the callback. `synchronous: true` delivers in
|
|
16
|
+
the calling thread for that scope only, through the same sampling and
|
|
17
|
+
configuration checks as ordinary delivery; the shared asynchronous
|
|
18
|
+
configuration is untouched, and a delivery failure follows the reporter's
|
|
19
|
+
existing logging policy rather than raising. A turn keeps the scope it
|
|
20
|
+
started under, so a turn left open by a pending tool call and closed later
|
|
21
|
+
by `flush!` still reports with that scope's agent, attributes and callback,
|
|
22
|
+
and a turn that started outside any scope never adopts a later one.
|
|
23
|
+
Nested scopes restore the previous context, including when the block
|
|
24
|
+
raises. A callback that raises is logged by exception class and the trace
|
|
25
|
+
is still delivered. (#5)
|
|
26
|
+
- `Reporter#report` takes `sync: true` to deliver in the calling thread for
|
|
27
|
+
that call only, keeping the enabled, configured and sampling checks that
|
|
28
|
+
`report_now` skips, and returns whether the traces were accepted.
|
|
29
|
+
`BatchingReporter#report` delivers that call's traces in the calling
|
|
30
|
+
thread when asked the same, leaving its buffer on its own schedule. The
|
|
31
|
+
RubyLLM adapter now requires core `~> 0.3` for it.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- `Configuration::LOCAL_ENDPOINT_PATH`, the class docs and the README's
|
|
36
|
+
self-hosting example pointed at `/active_agent/api/traces`, a path no
|
|
37
|
+
current dashboard mount serves. The actionagent engine ingests at
|
|
38
|
+
`<mount>/api/traces` and is mounted at `/activeagents` by default, so the
|
|
39
|
+
constant and the docs now say `/activeagents/api/traces` and note that a
|
|
40
|
+
custom mount changes the prefix. (#3)
|
|
41
|
+
|
|
42
|
+
## [0.2.0] - 2026-08-14
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- The RubyLLM adapter captures conversation content when the configuration's
|
|
47
|
+
`capture_bodies` is enabled: `llm.prompt`, `llm.instructions` and
|
|
48
|
+
`llm.completion` on the root span, and `tool.arguments` / `tool.result` on
|
|
49
|
+
each tool span. Each value is truncated to 4,000 characters
|
|
50
|
+
(`RubyLLM::CONTENT_LIMIT`). `llm.instructions` joins every system message,
|
|
51
|
+
since RubyLLM's `with_instructions` appends by default and reporting only
|
|
52
|
+
the last one would hide a layered base prompt. A tool span records a result
|
|
53
|
+
only when the call succeeded; a raised tool reports its truncated error
|
|
54
|
+
message instead.
|
|
55
|
+
|
|
56
|
+
Capture stays **off** by default. Prompts and tool results carry whatever
|
|
57
|
+
the application sends the model, so enabling this is a data-handling
|
|
58
|
+
decision — the truncation is a cap on trace size, not a redaction boundary.
|
|
4
59
|
|
|
5
60
|
## [0.1.0] - 2026-08-10
|
|
6
61
|
|
data/README.md
CHANGED
|
@@ -50,17 +50,22 @@ root SupportBot.respond 1,240ms OK
|
|
|
50
50
|
└─ tool tool.search_docs 310ms OK
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Prompts, completions, and tool arguments/results are sent only when
|
|
54
|
+
`capture_bodies` is enabled (off by default). Error messages are truncated and
|
|
54
55
|
backtraces are never transmitted.
|
|
55
56
|
|
|
56
57
|
## Self-hosting
|
|
57
58
|
|
|
58
|
-
Point the endpoint at your mounted dashboard — same gems, same wire format
|
|
59
|
+
Point the endpoint at your mounted dashboard — same gems, same wire format.
|
|
60
|
+
The dashboard engine ingests at `<mount>/api/traces`; its install generator
|
|
61
|
+
mounts it at `/activeagents`, so on a default install that is:
|
|
59
62
|
|
|
60
63
|
```ruby
|
|
61
|
-
config.endpoint = "https://your-app.example.com/
|
|
64
|
+
config.endpoint = "https://your-app.example.com/activeagents/api/traces"
|
|
62
65
|
```
|
|
63
66
|
|
|
67
|
+
If you mounted `ActionAgent::Engine` somewhere else, use that prefix instead.
|
|
68
|
+
|
|
64
69
|
## Development
|
|
65
70
|
|
|
66
71
|
```bash
|
|
@@ -24,13 +24,28 @@ module ActiveAgents
|
|
|
24
24
|
@shutdown = false
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
# Enqueues a trace, flushing if the batch is full.
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
# Enqueues a trace, flushing if the batch is full. `sync: true` skips the
|
|
28
|
+
# buffer: that call's traces are delivered in the calling thread before
|
|
29
|
+
# it returns, so a short-lived process can hand a trace over before it
|
|
30
|
+
# exits, and whatever the buffer already holds stays on its own schedule.
|
|
31
|
+
# @return [Boolean] whether any of the traces were accepted
|
|
32
|
+
def report(traces, sync: false)
|
|
33
|
+
return false if @shutdown
|
|
30
34
|
|
|
31
35
|
accepted = normalize(traces).select { sample_trace? }
|
|
32
|
-
return if accepted.empty?
|
|
33
|
-
return unless configuration.enabled? && configuration.configured?
|
|
36
|
+
return false if accepted.empty?
|
|
37
|
+
return false unless configuration.enabled? && configuration.configured?
|
|
38
|
+
|
|
39
|
+
if sync
|
|
40
|
+
body = begin
|
|
41
|
+
payload_for(accepted)
|
|
42
|
+
rescue StandardError => e
|
|
43
|
+
log("failed to build trace payload: #{e.class}: #{e.message}")
|
|
44
|
+
return false
|
|
45
|
+
end
|
|
46
|
+
deliver(body)
|
|
47
|
+
return true
|
|
48
|
+
end
|
|
34
49
|
|
|
35
50
|
batch = nil
|
|
36
51
|
@mutex.synchronize do
|
|
@@ -39,7 +54,7 @@ module ActiveAgents
|
|
|
39
54
|
start_flusher
|
|
40
55
|
end
|
|
41
56
|
deliver_batch(batch) if batch
|
|
42
|
-
|
|
57
|
+
true
|
|
43
58
|
end
|
|
44
59
|
|
|
45
60
|
# Delivers everything buffered, blocking until done.
|
|
@@ -14,13 +14,17 @@ module ActiveAgents
|
|
|
14
14
|
# end
|
|
15
15
|
#
|
|
16
16
|
# A self-hosted ActiveAgent dashboard is the same thing with a different
|
|
17
|
-
# endpoint — point it at "https://your-app.example.com/
|
|
17
|
+
# endpoint — point it at "https://your-app.example.com/activeagents/api/traces"
|
|
18
|
+
# (the actionagent engine's default mount; adjust the prefix to wherever
|
|
19
|
+
# the host app actually mounted ActionAgent::Engine).
|
|
18
20
|
class Configuration
|
|
19
21
|
# The hosted platform. Self-hosters override `endpoint`.
|
|
20
22
|
DEFAULT_ENDPOINT = "https://api.activeagents.ai/v1/traces"
|
|
21
23
|
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
+
# The ingest path of the dashboard engine (ActionAgent::Engine) at its
|
|
25
|
+
# default mount. The engine ingests at "<mount>/api/traces", so a host
|
|
26
|
+
# that mounted it elsewhere uses that prefix instead.
|
|
27
|
+
LOCAL_ENDPOINT_PATH = "/activeagents/api/traces"
|
|
24
28
|
|
|
25
29
|
# Attribute keys scrubbed from spans before delivery. Name-based — a
|
|
26
30
|
# secret inside free text is not caught; see the wiki's privacy page.
|
|
@@ -35,19 +35,29 @@ module ActiveAgents
|
|
|
35
35
|
|
|
36
36
|
# @param traces [Trace, Hash, Array<Trace, Hash>] traces to deliver —
|
|
37
37
|
# Trace objects or already-serialized trace hashes
|
|
38
|
-
# @
|
|
39
|
-
|
|
38
|
+
# @param sync [Boolean] deliver in the calling thread for this call
|
|
39
|
+
# only; every other call keeps the configured async behaviour. The
|
|
40
|
+
# enabled, configured and sampling checks still apply, unlike
|
|
41
|
+
# #report_now.
|
|
42
|
+
# @return [Boolean] whether the traces were accepted for delivery. A
|
|
43
|
+
# delivery failure is logged rather than surfaced here, so true means
|
|
44
|
+
# the traces passed the enabled, configured and sampling checks.
|
|
45
|
+
def report(traces, sync: false)
|
|
40
46
|
traces = normalize(traces)
|
|
41
|
-
return if traces.empty?
|
|
42
|
-
return unless configuration.enabled? && configuration.configured?
|
|
43
|
-
return unless sample_trace?
|
|
47
|
+
return false if traces.empty?
|
|
48
|
+
return false unless configuration.enabled? && configuration.configured?
|
|
49
|
+
return false unless sample_trace?
|
|
44
50
|
|
|
45
51
|
body = payload_for(traces)
|
|
46
|
-
configuration.async?
|
|
47
|
-
|
|
52
|
+
if sync || !configuration.async?
|
|
53
|
+
deliver(body)
|
|
54
|
+
else
|
|
55
|
+
Thread.new { deliver(body) }
|
|
56
|
+
end
|
|
57
|
+
true
|
|
48
58
|
rescue StandardError => e
|
|
49
59
|
log("failed to build trace payload: #{e.class}: #{e.message}")
|
|
50
|
-
|
|
60
|
+
false
|
|
51
61
|
end
|
|
52
62
|
|
|
53
63
|
# Blocking delivery, for tests and for at-exit flushes.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activeagents-telemetry
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ActiveAgents
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
14
|
The wire format, configuration, and delivery layer behind ActiveAgents
|