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
| """ | |
| Common telemetry initialization utilities. | |
| Provides standardized resource attribute creation for logging, metrics, and tracing | |
| across all DWS components. | |
| """ | |
| import os | |
| from typing import Optional |
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
| ═══════════════════════════════════════════════════════════════════════════════ | |
| LOCK REQUEST TRACE (traceparent: 00-ABC123...-001-01) | |
| Services: 4 (fpv-ops, tower-sidecar, striker, drone-cmd) | |
| ═══════════════════════════════════════════════════════════════════════════════ | |
| [1] fpv-ops: publish_lock_request_striker (PRODUCER) ✅ ROOT | |
| │ User selected option 1 from fpv-ops UI | |
| │ Creates trace root with new trace ID | |
| │ Injects traceparent into Redis message envelope | |
| │ Publishes to: striker_control_channel |
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
| """ | |
| Redis Tracer - Distributed tracing for Redis pub/sub messaging | |
| Provides utilities to publish and subscribe to Redis channels with | |
| W3C Trace Context propagation via message envelopes. | |
| """ | |
| import json | |
| import time | |
| from typing import Optional, Dict, Any, Callable |
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
| """ | |
| HTTPS Tracer - Distributed tracing for HTTPS client/server communication | |
| Client-side: Uses standard requests library (no framework dependency) | |
| Server-side: Provides generic patterns adaptable to any HTTP framework | |
| """ | |
| from typing import Optional, Dict, Any, Callable | |
| import requests |
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
| #!/usr/bin/env python3 | |
| """ | |
| Tower Sidecar - Unified Metrics and Distributed Tracing Bridge | |
| Monitors Redis channels and provides: | |
| 1. Metrics: Message throughput, rates (existing functionality) | |
| 2. Traces: Distributed trace context propagation (new functionality) | |
| Implements the three-span pattern for async messaging while maintaining | |
| metrics collection. |
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
| #!/usr/bin/env python3 | |
| """ | |
| Redis Channel Monitor - Monitors message throughput on Redis channels | |
| and reports metrics to OpenTelemetry Collector. | |
| """ | |
| import os | |
| import sys | |
| import time | |
| import logging |
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
| configs: | |
| # This is the minimal yaml configuration needed to listen on all interfaces | |
| # for OTLP logs, metrics and traces, exporting to Elasticsearch. | |
| edot-collector-config: | |
| content: | | |
| receivers: | |
| # Receives data from other Collectors in Agent mode | |
| otlp: | |
| protocols: | |
| grpc: |
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
| """ | |
| Thread-safe Death Telemetry Metrics Module (Multi-Drone Version) | |
| This module provides observable gauges for death data including: | |
| - drone id | |
| - drone id position (latitude and longitude) | |
| The module uses callbacks to pull the latest data from shared state when | |
| the OTLP exporter requests metric values. It includes staleness checking | |
| to prevent reporting outdated data. |
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
| import numpy as np | |
| from scipy.optimize import linear_sum_assignment | |
| def best_intercepts_hungarian( | |
| all_intercepts: List[Dict[str, Any]], | |
| strikers: List[Dict[str, Any]], | |
| optimization_metric: str = 'intercept_time' | |
| ) -> Dict[str, Dict[str, Any]]: | |
| """ | |
| Use Hungarian algorithm to find globally optimal striker-target assignments. |
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
| import os | |
| import threading | |
| from typing import Optional | |
| from opentelemetry import trace | |
| from opentelemetry.sdk.trace import TracerProvider | |
| from opentelemetry.sdk.trace.export import BatchSpanProcessor | |
| from opentelemetry.sdk.resources import Resource | |
| from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter |
NewerOlder