SIENTIAPDE-1169
feat: add SDK metrics service and update telemetry configuration - Introduced a new service for SDK metrics in values.yaml, enabling metrics collection on port 9091. - Updated the worker.py to initialize a new runtime with Prometheus metrics configuration for the SDK metrics server. - Adjusted environment variable for GITHUB_BRANCH to reflect the current focus on testing and performance design.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from temporalio import workflow, client
|
||||
from temporalio.worker import Worker
|
||||
|
||||
from temporalio.runtime import Runtime, TelemetryConfig, PrometheusConfig
|
||||
|
||||
with workflow.unsafe.imports_passed_through():
|
||||
import os
|
||||
@@ -26,6 +26,7 @@ with workflow.unsafe.imports_passed_through():
|
||||
from orchestrator import metrics
|
||||
|
||||
POD_ID = os.getenv("POD_ID")
|
||||
SDK_METRICS_PORT = int(os.getenv('HTTP_SDK_METRICS_PORT', "9091"))
|
||||
|
||||
|
||||
async def main():
|
||||
@@ -55,11 +56,21 @@ async def main():
|
||||
project_name=os.getenv('PROJECT_NAME', 'orchestrator'),
|
||||
)
|
||||
|
||||
logger.info(f'Starting SDK Metrics Server on port {SDK_METRICS_PORT}...')
|
||||
|
||||
new_runtime = Runtime(
|
||||
telemetry=TelemetryConfig(
|
||||
metrics=PrometheusConfig(
|
||||
bind_address=f"0.0.0.0:{SDK_METRICS_PORT}")
|
||||
)
|
||||
)
|
||||
|
||||
logger.info(f'Starting Temporal Client at {host}:{namespace}')
|
||||
|
||||
temporal_client = await client.Client.connect(
|
||||
target_host=host,
|
||||
namespace=namespace
|
||||
namespace=os.getenv('TEMPORAL_NAMESPACE', 'laborious'),
|
||||
runtime=new_runtime
|
||||
)
|
||||
|
||||
logger.info('Starting Activities...')
|
||||
|
||||
Reference in New Issue
Block a user