Skip to content

Releases: middleware-labs/mw-injector

Fix: Http Exporter Default for Python Dropin

25 Mar 11:59
0a4fbed

Choose a tag to compare

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

24 Mar 12:35
388a86b

Choose a tag to compare

  • Fixed: instrument_this selections reset on every agent report cycle

    When 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 any instrument_this=true flags, ensuring user choices persist across report cycles.

ListSystemdServices() — rich service discovery API

19 Mar 10:47
02003e7

Choose a tag to compare

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 to ListSystemdServices()
  • 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 -

17 Mar 10:21
4c6ec53

Choose a tag to compare

Pre-release

mw-injector Release Notes — 2026-03-17 (TEST RELEASE)

New Features

Unit-level Instrumentation API

  • New InstrumentUnit(unitName, language) and UninstrumentUnit(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 AgentAPIClient with ReportStatus() — 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
    AgentReportValue report
  • 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_PRELOAD drop-in (handled by libotelinject.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 /proc reads
  • Deployment type detection — correctly classifies processes as systemd, docker, or standalone using
    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() in PythonSystemdInjector missing deduplication, causing multiple daemon-reloads per
    service
  • Fix ContainerID[:12] slice panic when container ID shorter than 12 chars
  • Fix double /proc/<pid>/cgroup read 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_type not being set to "systemd" for systemd-managed processes
  • Surface partial discovery failures instead of silently swallowing errors

Release for Using Otel Injector

18 Mar 10:03
4c6ec53

Choose a tag to compare

mw-injector Release Notes — 2026-03-17

New Features

Unit-level Instrumentation API

  • New InstrumentUnit(unitName, language) and UninstrumentUnit(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 AgentAPIClient with ReportStatus() — 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
    AgentReportValue report
  • 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_PRELOAD drop-in (handled by libotelinject.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 /proc reads
  • Deployment type detection — correctly classifies processes as systemd, docker, or standalone using
    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() in PythonSystemdInjector missing deduplication, causing multiple daemon-reloads per
    service
  • Fix ContainerID[:12] slice panic when container ID shorter than 12 chars
  • Fix double /proc/<pid>/cgroup read 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_type not 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

23 Jan 09:17
d7cfbd0

Choose a tag to compare

v1.0.5

Merge pull request #30 from middleware-labs/java-discovery/service-na…

Python Discovery - updated default service type

21 Jan 07:35
d977d2b

Choose a tag to compare

v1.0.4

Merge pull request #29 from middleware-labs/python-discovery/defaulti…

Python Discovery - 6 step service name resolution.

20 Jan 09:57
9975cbb

Choose a tag to compare

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

  1. Explicit Environment Variables (100% confidence) - OTEL_SERVICE_NAME, SERVICE_NAME, FLASK_APP
  2. Infrastructure Detection (85% confidence) - Container name extraction from Docker/Kubernetes
  3. VirtualEnv Path Analysis (75% confidence) - Extracts project names from paths like /project-name/.venv/bin/python
  4. Entry Point / Module Analysis (60% confidence) - Detects Uvicorn/Gunicorn patterns (main:app)
  5. Absolute Script Path Analysis (50% confidence) - Analyzes parent directory of entry point scripts
  6. 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

15 Jan 05:35
8d06da6

Choose a tag to compare

v1.0.2

Merge pull request #25 from middleware-labs/fix/node-container-servic…

Node Container Discovery

13 Jan 00:46
48a735f

Choose a tag to compare

BUG FIX:
Better service name for node containers.
Enabled default Node Discovery Option for to include node containers.