feat: add version labels to Temporal Prometheus metrics#1083
Open
anbarasantr wants to merge 8 commits intomainfrom
Open
feat: add version labels to Temporal Prometheus metrics#1083anbarasantr wants to merge 8 commits intomainfrom
anbarasantr wants to merge 8 commits intomainfrom
Conversation
Expose ~40 built-in Temporal SDK metrics (activity/workflow latencies, failures, task slot usage, gRPC request stats) via a Prometheus endpoint on port 9464. This is always-on with no configuration required. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use ATLAN_TEMPORAL_PROMETHEUS_BIND_ADDRESS env var with default "0.0.0.0:9464", following the same convention as other SDK constants. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Follow the same convention as WORKFLOW_HOST/WORKFLOW_PORT: - ATLAN_TEMPORAL_PROMETHEUS_HOST (default: 0.0.0.0) - ATLAN_TEMPORAL_PROMETHEUS_PORT (default: 9464) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Host is always 0.0.0.0. Only the port needs to be configurable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Single env var override for the full bind address (host:port). Default: 0.0.0.0:9464 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use TelemetryConfig global_tags to expose version labels on all Temporal worker metrics at the /metrics Prometheus endpoint. This enables version tracking in dashboards and alerting without breaking existing queries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Summary
service_versionandsdk_versionas global tags to all Temporal worker Prometheus metrics viaTelemetryConfig.global_tagsservice_versioncomes fromOTEL_SERVICE_VERSIONenv var (default0.1.0) — represents the app/connector version per deploymentsdk_versioncomes fromapplication_sdk.version.__version__(2.4.1) — the SDK package versionWhy
The Temporal Prometheus
/metricsendpoint on:9464previously had no version information on any metric. This makes it impossible to filter or alert by app version in dashboards.What changes
Only
application_sdk/clients/temporal.py— addedSERVICE_VERSIONandSDK_VERSIONimports, and passedglobal_tagstoTelemetryConfig. Fully backward compatible — only adds new labels to existing metrics.Verified
Tested locally with Temporal test server. All 249 metric lines now carry
sdk_versionandservice_versionlabels:Test plan
test_temporal_client.pyunit tests pass/metricsoutput with Temporal test server shows version labelscurl http://<pod>:9464/metrics | grep service_version🤖 Generated with Claude Code