[WIP] feat: add MLflow tracing integration via OpenTelemetry bridge#310
Open
luis5tb wants to merge 4 commits into
Open
[WIP] feat: add MLflow tracing integration via OpenTelemetry bridge#310luis5tb wants to merge 4 commits into
luis5tb wants to merge 4 commits into
Conversation
9a3b873 to
2958385
Compare
Add MLflow LLM observability support. Google ADK natively generates OTel traces; MLflow (>= 3.6.0) accepts them at its /v1/traces OTLP endpoint. The agent adds a second BatchSpanProcessor targeting MLflow alongside existing exporters. - config/settings.py: 6 new MLflow settings (enabled, tracking_uri, experiment_name, experiment_id, log_prompts, run_tags) - telemetry/setup.py: _add_mlflow_processor() sends all settings as OTLP headers; setup_telemetry() restructured so MLflow works independently of otel_enabled - pyproject.toml: mlflow optional dep group (otlp-proto-http exporter) - requirements-mlflow.txt: lock file with hashes - .env.example, Makefile: env var docs + lock-mlflow target - tests/test_mlflow.py: 26 test cases covering defaults, env loading, enabled/disabled paths, independent MLflow, headers, trailing slash handling, and ImportError Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
On Cloud Run the agent connects to an external MLflow instance (Red Hat infrastructure) — no new GCP services deployed. - service.yaml: MLFLOW_ENABLED, MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_NAME, MLFLOW_EXPERIMENT_ID, MLFLOW_LOG_PROMPTS, MLFLOW_RUN_TAGS env vars - README.md: MLflow Tracing section with configuration table, enabling instructions, networking/auth notes, and dependency info Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploy MLflow Tracking Server as an optional Helm component with dedicated PostgreSQL, artifact PVC, NetworkPolicy, and optional Route. New templates: - mlflow-deployment.yaml: MLflow server with security contexts, readiness probe (/api/2.0/mlflow/experiments/search), liveness probe (tcpSocket), artifact PVC + tmp emptyDir mounts - mlflow-service.yaml: ClusterIP service - mlflow-route.yaml: optional OpenShift Route - mlflow-pvc.yaml: artifact storage (10Gi default) - mlflow-postgresql-deployment.yaml: dedicated PostgreSQL + Service - mlflow-postgresql-pvc.yaml: PostgreSQL data (5Gi default) - networkpolicy-mlflow.yaml: restricts ingress to agent pods only Modified: - _helpers.tpl: MLflow + PostgreSQL service name and selector helpers - configmap.yaml: MLflow env vars with auto-resolved trackingUri pointing to the ClusterIP Service - secret.yaml: MLFLOW_DB_PASSWORD for dedicated PostgreSQL - values.yaml: mlflow section with pinned image (v3.14.0), resource defaults, storage, route, auth, and postgresql config - README.md: MLflow Tracking section with value table and usage docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add Helm fail guard when mlflow.postgresql.mode != 'dedicated' to prevent silent OTLP trace ingestion failure (file-based backends silently drop traces per MLflow docs) - Replace incorrect mlflow-tracing package references in Cloud Run and OpenShift READMEs with the actual dependency (opentelemetry-exporter-otlp-proto-http, already in the container) - Document that MLFLOW_EXPERIMENT_ID requires the experiment to already exist on the server (use MLFLOW_EXPERIMENT_NAME for auto-creation) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Changes
Agent code:
Cloud Run: env vars in service.yaml pointing at external MLflow
OpenShift: 7 new Helm templates (Deployment, Service, Route, PVC, PostgreSQL, PostgreSQL PVC, NetworkPolicy) + values.yaml, configmap.yaml, secret.yaml, _helpers.tpl updates
Tests: 20 test cases covering settings, enabled/disabled paths, independent MLflow (no OTel), experiment ID headers
Test plan
🤖 Generated with Claude Code