CodingAgentMetrics
public class CodingAgentMetrics
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:41–118Coding 智能体指标,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.coding.observability 包。核心成员包括 recordWebhookReceived、recordWebhookDuplicate、recordDispatch、recordDispatchError、recordModelCall、recordFindingAdded。
Centralized Micrometer metrics for the coding agent.
Metrics are exposed via Spring Boot Actuator (/actuator/prometheus) and can be
scraped by Prometheus or shipped to an OTel collector via the Micrometer OTel bridge.
Key metrics:
-
coding_agent.webhook.received— total GitHub webhooks received (tagged by event) -
coding_agent.webhook.duplicate— deduplicated webhook deliveries -
coding_agent.dispatch.total— total agent dispatches (tagged by agent_id) -
coding_agent.dispatch.errors— failed dispatches -
coding_agent.model.calls— LLM calls across all threads -
coding_agent.findings.added— reviewer findings added -
coding_agent.review.published— PR reviews published to GitHub -
coding_agent.dispatch.duration— end-to-end dispatch latency
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public CodingAgentMetrics(MeterRegistry registry) | 初始化 `CodingAgentMetrics` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void recordWebhookReceived() | 执行 `recordWebhookReceived` 方法。 Returns the record webhook received. |
public void recordWebhookDuplicate() | 执行 `recordWebhookDuplicate` 方法。 Returns the record webhook duplicate. |
public void recordDispatch() | 执行 `recordDispatch` 方法。 Returns the record dispatch. |
public void recordDispatchError() | 执行 `recordDispatchError` 方法。 Returns the record dispatch error. |
public void recordModelCall() | 执行 `recordModelCall` 方法。 Returns the record model call. |
public void recordFindingAdded() | 执行 `recordFindingAdded` 方法。 Returns the record finding added. |
public void recordReviewPublished() | 执行 `recordReviewPublished` 方法。 Returns the record review published. |
public Timer getDispatchDuration() | 获取 `getDispatchDuration`。 Returns the dispatch duration. |
构造器详情Constructor Detail
CodingAgentMetrics
public CodingAgentMetrics(MeterRegistry registry)
初始化 CodingAgentMetrics 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
registry | MeterRegistry | 注册表(类型 `MeterRegistry`)。The registry. |
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:52–85方法详情Method Detail
recordWebhookReceived
public void recordWebhookReceived()
执行 recordWebhookReceived 方法。
Returns the record webhook received.
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:87–89recordWebhookDuplicate
public void recordWebhookDuplicate()
执行 recordWebhookDuplicate 方法。
Returns the record webhook duplicate.
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:91–93recordDispatch
public void recordDispatch()
执行 recordDispatch 方法。
Returns the record dispatch.
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:95–97recordDispatchError
public void recordDispatchError()
执行 recordDispatchError 方法。
Returns the record dispatch error.
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:99–101recordModelCall
public void recordModelCall()
执行 recordModelCall 方法。
Returns the record model call.
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:103–105recordFindingAdded
public void recordFindingAdded()
执行 recordFindingAdded 方法。
Returns the record finding added.
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:107–109recordReviewPublished
public void recordReviewPublished()
执行 recordReviewPublished 方法。
Returns the record review published.
io/agentscope/harness/coding/observability/CodingAgentMetrics.java:111–113getDispatchDuration
public Timer getDispatchDuration()
获取 getDispatchDuration。
Returns the dispatch duration.
Timerio/agentscope/harness/coding/observability/CodingAgentMetrics.java:115–117