Skip to content

fix(temporal): allowing-ACP-temporal-telemetry#318

Open
brucey31 wants to merge 1 commit intomainfrom
fix/temporal-worker/allowing-ACP-temporal-telemetry
Open

fix(temporal): allowing-ACP-temporal-telemetry#318
brucey31 wants to merge 1 commit intomainfrom
fix/temporal-worker/allowing-ACP-temporal-telemetry

Conversation

@brucey31
Copy link
Copy Markdown

@brucey31 brucey31 commented Apr 10, 2026

Summary

Plumb metrics_url string through to AgentexWorker into get_temporal_client and leverage out-of-the-box temporal metrics through a push model.

get_temporal_client already supports an optional metrics_url and configures the Temporal Python SDK runtime with OpenTelemetry metrics when it is set. AgentexWorker did not expose that parameter, so worker-based runs could not pass a metrics endpoint even though the client helper could use one.

This allows the same pattern as seen here to instrument temporal workers with an OTEL endpoint.

This change adds an optional metrics_url on AgentexWorker and forwards it when creating the Temporal client, so workers can emit Temporal telemetry (e.g. for ACP / observability) the same way other code paths can.

Scope: src/agentex/lib/core/temporal/workers/worker.py only (+3 lines: constructor arg, instance field, and call argument).

Greptile Summary

This PR plumbs an optional metrics_url parameter through AgentexWorker.__init__self.metrics_urlget_temporal_client, enabling Temporal SDK OpenTelemetry metric emission from worker-based runs. The change is minimal (3 lines), follows the existing pattern already implemented in get_temporal_client, and is correctly scoped to worker.py.

Confidence Score: 5/5

This PR is safe to merge — it is a minimal, focused 3-line change that wires an already-supported parameter through one additional layer.

The change follows the exact same pattern already present in get_temporal_client, introduces no new logic, and has no edge-case concerns. No P0/P1 findings were identified.

No files require special attention.

Important Files Changed

Filename Overview
src/agentex/lib/core/temporal/workers/worker.py Adds optional metrics_url constructor arg to AgentexWorker and forwards it to get_temporal_client; follows existing pattern exactly, no issues found.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant AgentexWorker
    participant get_temporal_client
    participant TemporalRuntime
    participant TemporalClient

    Caller->>AgentexWorker: __init__(metrics_url=..., ...)
    AgentexWorker->>AgentexWorker: self.metrics_url = metrics_url
    Caller->>AgentexWorker: run(activities, workflow=...)
    AgentexWorker->>get_temporal_client: get_temporal_client(temporal_address, plugins, metrics_url)
    alt metrics_url is set
        get_temporal_client->>TemporalRuntime: Runtime(TelemetryConfig(OpenTelemetryConfig(url=metrics_url)))
        get_temporal_client->>TemporalClient: Client.connect(..., runtime=runtime)
    else metrics_url is None
        get_temporal_client->>TemporalClient: Client.connect(...)
    end
    get_temporal_client-->>AgentexWorker: client
    AgentexWorker->>AgentexWorker: Worker(client, ...)
Loading

Reviews (1): Last reviewed commit: "fix(temporal): allowing-ACP-temporal-tel..." | Re-trigger Greptile

@brucey31 brucey31 requested a review from danielmillerp April 10, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant