<#7631 feat(connector): add connector RPC and GetT...
# flyte-github
a
#7631 feat(connector): add connector RPC and GetTask-status metrics Pull request opened by pingsutw Why are the changes needed? The connector plugin runs in-process inside the leaseworker/executor, but it emitted no observability for two operationally interesting questions: 1. How many RPCs the caller sends to connector pods (CreateTask/GetTask/DeleteTask), and with what result/latency. 2. What status the connector returns from
GetTask
(RUNNING/SUCCEEDED/FAILED/…). Neither was answerable: the connector gRPC client had no Prometheus interceptor, and the returned task status was never recorded. This PR adds the metrics needed to build a Connectors dashboard.
Note on running-task count: an earlier revision of this PR added an
active_tasks
gauge. It was dropped — review found the manual Inc/Dec bookkeeping was fragile (the persisted
state.Phase
is terminal by
Finalize
, so it would leak upward). The number of in-flight connector tasks is instead derived from the plugin's existing autorefresh cache size (
…:cache:cache:size
), which needs no new metric.
What changes were proposed in this pull request? • gRPC client interceptors on the connector dial (
flyteplugins/.../webapi/connector/client.go
) → caller→connector-pod RPCs now emit the standard
v2_grpc_client_*
series with
grpc_service=\"flyteidl2.connector.*\"
(rate via
handled_total
, errors via
grpc_code
, latency via the histogram below). •
connector_get_task_phase
CounterVec
(
flyteplugins/.../webapi/connector/plugin.go
) →
GetTask
responses keyed by the task phase the connector returns. Registered under the connector plugin's metrics scope (repurposing the previously-dead
connector_plugin
scope to the real plugin metrics scope). • Enable the gRPC client handling-time histogram (
flytestdlib/grpcutils/factory.go
) so
v2_grpc_client_handling_seconds
exists and RPC latency is chartable. How was this patch tested? • Updated the connector integration-test plugin loaders to initialize the new
connector_get_task_phase
counter (otherwise
Get()
would nil-panic). •
go build
,
go vet
, and package tests pass for
flytestdlib/grpcutils
,
pluginmachinery/internal/webapi
, and
plugins/webapi/connector
. Labels added Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. flyteorg/flyte