A command-line tool that identifies and instruments Kubernetes workloads that are not currently instrumented by Odigos. The tool connects to your Odigos installation, queries for workloads missing instrumentation, and can automatically enable instrumentation for them.
- Checks if
kubectlis available in your PATH - Establishes a port-forward to the Odigos UI service (
svc/uiin the specified namespace) - Connects to the Odigos GraphQL API at
http://localhost:3000/graphql - Fetches all namespaces from the cluster
- Filters out ignored namespaces (default:
kube-system,kube-public,default) - Fetches workloads for each remaining namespace
- Identifies workloads that are not instrumented
- Optionally exports uninstrumented workloads to a CSV file
- Updates the instrumentation status for uninstrumented workloads (unless
--dry-runis specified)
- Python 3.10+
- kubectl - Must be installed and available in PATH
- Kubernetes cluster access - kubectl must have access to the Odigos namespace (specified via
--odigos-namespace) - Odigos installation - The Odigos UI service must be running in the cluster
# Clone the repository
git clone <repository-url>
cd add-uninstrumented-sources
# Using uv (recommended)
uv sync
# Or using pip
pip install -e .python odigos_instrument.py [OPTIONS]| Option | Description |
|---|---|
--odigos-namespace NAMESPACE |
Required. The namespace where Odigos is installed (e.g., odigos-system) |
--log-level |
Set logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO) |
--log-file FILE |
Write logs to a file in addition to console |
--export-csv FILE |
Export uninstrumented workloads to a CSV file |
--ignore-namespaces NAMESPACE [NAMESPACE ...] |
List of namespaces to ignore when fetching workloads (default: kube-system kube-public default) |
--dry-run |
Preview changes without updating instrumentation |
--help |
Display help message |
Run with default INFO logging level (namespace is required):
python odigos_instrument.py --odigos-namespace odigos-systemSee what would be updated without making changes:
python odigos_instrument.py --odigos-namespace odigos-system --dry-runExport uninstrumented sources to a CSV file without updating:
python odigos_instrument.py --odigos-namespace odigos-system --export-csv uninstrumented.csv --dry-runExport to CSV and update instrumentation:
python odigos_instrument.py --odigos-namespace odigos-system --export-csv sources.csvBy default, the tool ignores kube-system, kube-public, and default namespaces. You can customize this:
# Ignore only kube-system
python odigos_instrument.py --odigos-namespace odigos-system --ignore-namespaces kube-system
# Ignore multiple custom namespaces
python odigos_instrument.py --odigos-namespace odigos-system --ignore-namespaces kube-system monitoring loggingRun with DEBUG logging for detailed output:
python odigos_instrument.py --odigos-namespace odigos-system --log-level DEBUGRun with WARNING level to suppress info messages:
python odigos_instrument.py --odigos-namespace odigos-system --log-level WARNINGLog to a file:
python odigos_instrument.py --odigos-namespace odigos-system --log-file /path/to/logfile.logCombine DEBUG level with file logging:
python odigos_instrument.py --odigos-namespace odigos-system --log-level DEBUG --log-file debug.logWhen using --export-csv, the tool creates a CSV file with the following columns:
| Column | Description |
|---|---|
namespace |
Kubernetes namespace of the workload |
name |
Name of the workload |
kind |
Workload type (e.g., Deployment, StatefulSet, DaemonSet) |
See LICENSE file for details.