Releases: middleware-labs/mw-injector
Fix: Http Exporter Default for Python Dropin
Merge pull request #47 from middleware-labs/fix/python-exporter-http python exporter to be defaulted to otlp_proto_http
fix: instrument_this selections no longer reset on agent report cycle
-
Fixed:
instrument_thisselections reset on every agent report cycleWhen a user enabled a service for instrumentation via the dashboard, the selection was silently undone the next
time the agent sent a report. The agent now fetches stored settings from the backend before each report and carries
over anyinstrument_this=trueflags, ensuring user choices persist across report cycles.
ListSystemdServices() — rich service discovery API
ListSystemdServices() — rich service discovery API
A new ListSystemdServices() function returns structured ServiceInfo for every
process discovered under a systemd unit, replacing the previous unit-name-only
ListUnits().
Each ServiceInfo includes:
| Field | Description |
|---|---|
SystemdUnit |
Systemd unit name |
Name |
Service name |
Language |
java, python, or node |
PID |
Process ID |
Owner |
Process owner |
Status |
Current process status |
AgentType |
OTel agent type if instrumented |
Instrumented |
Whether the service is currently instrumented |
Fixes
ListUnits()preserved for backwards compatibility — now delegates toListSystemdServices()- Partial discovery failures (e.g. Java found but Python fails) no longer discard valid results — data is returned
alongside the error - Unsafe map access on
rawReportValue[runtime.GOOS]replaced with an explicit key check
Test Release for Using Otel Injector -
mw-injector Release Notes — 2026-03-17 (TEST RELEASE)
New Features
Unit-level Instrumentation API
- New
InstrumentUnit(unitName, language)andUninstrumentUnit(unitName)for instrumenting individual systemd
services by name, without needing a full process scan - New
ListUnits()to enumerate all discoverable systemd services - Supports Java, Node.js, and Python
Agent Status Reporting
- New
AgentAPIClientwithReportStatus()— sends discovered process inventory to the Middleware backend as a
base64-encoded JSON payload GetAgentReportValue()aggregates all discovered Java, Node, and Python processes into a structured
AgentReportValuereport- Report includes service name, language, runtime version, instrumentation status, systemd unit, deployment type,
and process manager
Python Systemd Instrumentation
- Instruments Python services running under systemd via drop-in files
- Sets
LD_PRELOAD,PYTHON_AUTO_INSTRUMENTATION_AGENT_PATH_PREFIX, and all OTEL env vars - Deduplicates instrumentation across multi-worker apps (e.g. Gunicorn) to avoid cascading restarts
Node.js Systemd Instrumentation
- Instruments Node.js systemd services via
LD_PRELOADdrop-in (handled bylibotelinject.so)
Python Process Discovery
- Detects Python agent type: None, OpenTelemetry, Middleware, OtelInjector
- Identifies process managers: Gunicorn, Uvicorn, Celery
- Detects Python instrumentation via systemd drop-in inspection
Improvements
- Cgroup parsing consolidated — single
parseCgroupUnitName()shared across all systemd detection logic,
replacing three independent implementations - Service name discovery — 6-level heuristic for Java: container name → OTEL env var → systemd unit → JVM
properties → JAR filename → directory structure - Process discovery caching — TTL-based cache with 20-minute expiry reduces repeated
/procreads - Deployment type detection — correctly classifies processes as
systemd,docker, orstandaloneusing
cgroup inspection - Key generation — name-based stable keys (
host-java-<name>) replacing PID-based keys that changed on restart - Node and java agent type --- Agent type otel-injector for node and java.
Bug Fixes
- Fix
Uninstrument()inPythonSystemdInjectormissing deduplication, causing multiple daemon-reloads per
service - Fix
ContainerID[:12]slice panic when container ID shorter than 12 chars - Fix double
/proc/<pid>/cgroupread per Java process during report generation - Fix
ListUnits()returning empty strings for non-systemd processes, preventing corrupted drop-in paths - Fix Python and Node
service_typenot being set to"systemd"for systemd-managed processes - Surface partial discovery failures instead of silently swallowing errors
Release for Using Otel Injector
mw-injector Release Notes — 2026-03-17
New Features
Unit-level Instrumentation API
- New
InstrumentUnit(unitName, language)andUninstrumentUnit(unitName)for instrumenting individual systemd
services by name, without needing a full process scan - New
ListUnits()to enumerate all discoverable systemd services - Supports Java, Node.js, and Python
Agent Status Reporting
- New
AgentAPIClientwithReportStatus()— sends discovered process inventory to the Middleware backend as a
base64-encoded JSON payload GetAgentReportValue()aggregates all discovered Java, Node, and Python processes into a structured
AgentReportValuereport- Report includes service name, language, runtime version, instrumentation status, systemd unit, deployment type,
and process manager
Python Systemd Instrumentation
- Instruments Python services running under systemd via drop-in files
- Sets
LD_PRELOAD,PYTHON_AUTO_INSTRUMENTATION_AGENT_PATH_PREFIX, and all OTEL env vars - Deduplicates instrumentation across multi-worker apps (e.g. Gunicorn) to avoid cascading restarts
Node.js Systemd Instrumentation
- Instruments Node.js systemd services via
LD_PRELOADdrop-in (handled bylibotelinject.so)
Python Process Discovery
- Detects Python agent type: None, OpenTelemetry, Middleware, OtelInjector
- Identifies process managers: Gunicorn, Uvicorn, Celery
- Detects Python instrumentation via systemd drop-in inspection
Improvements
- Cgroup parsing consolidated — single
parseCgroupUnitName()shared across all systemd detection logic,
replacing three independent implementations - Service name discovery — 6-level heuristic for Java: container name → OTEL env var → systemd unit → JVM
properties → JAR filename → directory structure - Process discovery caching — TTL-based cache with 20-minute expiry reduces repeated
/procreads - Deployment type detection — correctly classifies processes as
systemd,docker, orstandaloneusing
cgroup inspection - Key generation — name-based stable keys (
host-java-<name>) replacing PID-based keys that changed on restart - Node and java agent type --- Agent type otel-injector for node and java.
Bug Fixes
- Fix
Uninstrument()inPythonSystemdInjectormissing deduplication, causing multiple daemon-reloads per
service - Fix
ContainerID[:12]slice panic when container ID shorter than 12 chars - Fix double
/proc/<pid>/cgroupread per Java process during report generation - Fix
ListUnits()returning empty strings for non-systemd processes, preventing corrupted drop-in paths - Fix Python and Node
service_typenot being set to"systemd"for systemd-managed processes - Surface partial discovery failures instead of silently swallowing errors
Java Discovery: More priority to systemd service name itself
v1.0.5 Merge pull request #30 from middleware-labs/java-discovery/service-na…
Python Discovery - updated default service type
v1.0.4 Merge pull request #29 from middleware-labs/python-discovery/defaulti…
Python Discovery - 6 step service name resolution.
Release Notes - Python Service Discovery Enhancement
Features
Prioritized Heuristic Engine for Python Service Name Detection
Implemented a multi-level, confidence-based service discovery system that improves Python service name detection accuracy across diverse deployment scenarios.
6-Level Priority System
- Explicit Environment Variables (100% confidence) -
OTEL_SERVICE_NAME,SERVICE_NAME,FLASK_APP - Infrastructure Detection (85% confidence) - Container name extraction from Docker/Kubernetes
- VirtualEnv Path Analysis (75% confidence) - Extracts project names from paths like
/project-name/.venv/bin/python - Entry Point / Module Analysis (60% confidence) - Detects Uvicorn/Gunicorn patterns (
main:app) - Absolute Script Path Analysis (50% confidence) - Analyzes parent directory of entry point scripts
- Working Directory Fallback (lowest confidence) - Uses current working directory
Improvements
- Enhanced generic name filtering to avoid false positives from
bin,src,lib - Environment variable extraction from
/proc/[pid]/environ - Optimized generic name checking with map-based lookup
- Better path handling and resolution
Bug Fixes
- Fixed service name detection for projects using virtual environments
- Resolved FastAPI and Flask application discovery issues
- Improved module pattern detection edge cases
Code Changes
- +90 / -49 lines in
pkg/discovery/process.go - Refactored
extractPythonServiceName()with confidence-level architecture - Added
extractFromEnviron()helper function - Converted
isGenericPythonName()to map-based lookup
Migration Notes
No breaking changes. The system gracefully falls back through detection levels, maintaining backward compatibility.
Related PR: #28
Merged: 3 hours ago into master
Node Container Discovery: Instrumented status fix
v1.0.2 Merge pull request #25 from middleware-labs/fix/node-container-servic…
Node Container Discovery
BUG FIX:
Better service name for node containers.
Enabled default Node Discovery Option for to include node containers.