A custom Instana plugin for monitoring Strategy₿ M8PrcSvr processes. This plugin collects process-specific metrics and sends them to Instana using OpenTelemetry.
The M8PrcSvr plugin monitors the Strategy₿ Process Server component, providing real-time visibility into its resource usage and performance characteristics.
- Real-time monitoring of Strategy₿ M8PrcSvr processes
- Case-insensitive process detection for flexibility
- Detailed resource usage metrics collection
- OpenTelemetry integration for seamless Instana reporting
- Lightweight with minimal performance impact
- Configurable monitoring intervals
- CPU Usage (%)
- Memory Usage (RSS, VMS)
- Process Count
- Disk I/O (read/write bytes)
- Open File Descriptors
- Thread Count
- Context Switches (voluntary/involuntary)
-
Instana Agent 1.2.0 or higher
-
Python 3.6 or higher
-
OpenTelemetry Python packages:
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
-
Strategy₿ environment with M8PrcSvr processes
Use the installation script to easily deploy the plugin:
# Clone the repository
git clone https://github.com/laplaque/instana_plugins.git
cd instana_plugins/m8prcsvr
# Run the installer script
sudo ./install-instana-m8prcsvr-plugin.shThe installation script requires elevated privileges (sudo) to:
- Copy files to the Instana agent directory (typically
/opt/instana/agent/plugins/custom_sensors/) - Set appropriate file permissions
- Create and enable a systemd service for automatic startup
If you need to install without sudo access:
-
Create a custom sensors directory in your user space:
mkdir -p ~/instana-plugins/custom_sensors/microstrategy_m8prcsvr mkdir -p ~/instana-plugins/custom_sensors/common
-
Copy the necessary files:
cp -r m8prcsvr/* ~/instana-plugins/custom_sensors/microstrategy_m8prcsvr/ cp -r common/* ~/instana-plugins/custom_sensors/common/
-
Configure the Instana agent to look for plugins in this directory by adding to
configuration.yaml:com.instana.plugin.python: enabled: true custom_sensors_path: /home/yourusername/instana-plugins/custom_sensors
-
Set up a user-level service or cron job to run the sensor:
# Example crontab entry to run every minute * * * * * env PYTHONPATH=/home/yourusername/instana-plugins/custom_sensors /home/yourusername/instana-plugins/custom_sensors/microstrategy_m8prcsvr/sensor.py
The plugin needs access to process information. If running without root:
- Ensure your user has permission to read
/procentries for the M8PrcSvr processes - If the M8PrcSvr processes run as a different user, you may need to:
-
Run the Instana agent as the same user
-
Use Linux capabilities to grant specific permissions:
sudo setcap cap_dac_read_search,cap_sys_ptrace+ep ~/instana-plugins/custom_sensors/microstrategy_m8prcsvr/sensor.py -
Adjust process group permissions to allow monitoring
-
The installer will automatically set up the plugin to run as a systemd service. The plugin uses OpenTelemetry to send metrics to the Instana agent.
Ensure your Instana agent is configured to receive OpenTelemetry data (enabled by default in Instana agent version 1.1.726 or higher):
com.instana.plugin.opentelemetry:
grpc:
enabled: true
http:
enabled: trueThe Instana agent will listen for OpenTelemetry data on:
- Port 4317 for gRPC connections (used by default)
- Port 4318 for HTTP/HTTPS connections
To enable TLS encryption for secure communication with the Instana agent:
-
Configure the Instana agent with TLS certificates:
- Place certificate and key files in
<agent_installation>/etc/certs/ - By default, the agent looks for
tls.crtandtls.keyfiles - Restart the agent after adding certificates
- Place certificate and key files in
-
Configure the sensor to use TLS by setting environment variables:
USE_TLS=true \ CA_CERT_PATH=/path/to/ca.crt \ CLIENT_CERT_PATH=/path/to/client.crt \ CLIENT_KEY_PATH=/path/to/client.key \ /opt/instana/agent/plugins/custom_sensors/microstrategy_m8prcsvr/sensor.py
-
For systemd service, add these environment variables to the service configuration:
sudo systemctl edit instana-m8prcsvr-sensor
Add the following:
[Service] Environment="USE_TLS=true" Environment="CA_CERT_PATH=/path/to/ca.crt" Environment="CLIENT_CERT_PATH=/path/to/client.crt" Environment="CLIENT_KEY_PATH=/path/to/client.key"
Note: When TLS is enabled, the plugin automatically uses https:// protocol for connections.
To verify the plugin is correctly detecting M8PrcSvr processes:
/opt/instana/agent/plugins/custom_sensors/microstrategy_m8prcsvr/sensor.pyThis will output JSON with the collected metrics if processes are found.
The plugin uses:
common/process_monitor.pyto collect metrics about M8PrcSvr processescommon/otel_connector.pyto send these metrics to Instana using OpenTelemetry
The sensor runs continuously, collecting metrics at configurable intervals and sending them to the Instana agent.
When installed using the installation script, the plugin is configured as a systemd service that:
- Starts automatically at system boot
- Runs continuously in the background
- Collects metrics every 60 seconds by default
You can adjust how often metrics are collected in several ways:
-
Modify the systemd service:
sudo systemctl edit instana-m8prcsvr-sensor
Add the following to override the default interval (in seconds):
[Service] Environment="COLLECTION_INTERVAL=30"
-
When running manually:
COLLECTION_INTERVAL=15 /opt/instana/agent/plugins/custom_sensors/microstrategy_m8prcsvr/sensor.py
-
Using a custom scheduler: You can create a custom scheduling mechanism using systemd timers or more sophisticated cron configurations.
For testing or ad-hoc monitoring, you can run the sensor once:
/opt/instana/agent/plugins/custom_sensors/microstrategy_m8prcsvr/sensor.py --run-once- Standard monitoring: 60 seconds (default)
- Detailed monitoring: 15-30 seconds
- Minimal overhead: 300 seconds (5 minutes)
The optimal frequency depends on your monitoring needs and the performance impact on your system. More frequent collection provides better visibility but increases overhead.
If metrics aren't appearing in Instana:
-
Verify the M8PrcSvr process is running:
ps aux | grep -i m8prcsvr -
Check if the sensor is running:
ps aux | grep microstrategy_m8prcsvr -
Examine the Instana agent logs for errors
-
Run the sensor manually with debug logging:
PYTHONPATH=/opt/instana/agent/plugins/custom_sensors LOG_LEVEL=DEBUG /opt/instana/agent/plugins/custom_sensors/microstrategy_m8prcsvr/sensor.py
-
Verify the Instana agent is accepting OTLP connections on port 4317
-
Process Not Found:
- If you see "No processes found matching 'M8PrcSvr'" in the logs, verify that:
- The Strategy₿ M8PrcSvr process is running
- The process name matches (case-insensitive matching is used)
- You have permissions to view process information
- If you see "No processes found matching 'M8PrcSvr'" in the logs, verify that:
-
Permission Issues:
- If you see permission errors when accessing
/procfiles:- Run the sensor with elevated privileges
- Ensure the user running the sensor has access to process information
- If you see permission errors when accessing
-
Connection to Instana Agent:
- If metrics aren't appearing in Instana:
- Verify the agent host and port are correct
- Check that the Instana agent is running
- Ensure OpenTelemetry is enabled in the agent configuration
- If metrics aren't appearing in Instana:
-
Debugging:
-
Run the sensor with
--log-level=DEBUGfor more detailed logs:./sensor.py --log-level=DEBUG
-
Run once with
--onceflag to check for immediate issues:./sensor.py --once --log-level=DEBUG
-
-
Log File Location:
-
By default, logs are written to
app.login the current directory -
Specify a custom log file with
--log-file:./sensor.py --log-file=/var/log/instana/m8prcsvr.log
-
-
Multiple M8PrcSvr Instances:
- The plugin monitors all processes matching the "M8PrcSvr" pattern
- If you have multiple M8PrcSvr instances, metrics will be aggregated
- To monitor instances separately, modify the process name pattern
-
Resource Constraints:
- On systems with limited resources, consider increasing the collection interval
- For production environments with many processes, 60 seconds is recommended
- Memory usage increases with the number of monitored processes
-
Process Restarts:
- If M8PrcSvr processes restart between collections, some metrics will reset
- Disk I/O and context switch counters will start from zero after restart
- Process count metrics will remain accurate even during restarts
-
Virtualized Environments:
- In virtualized environments, CPU metrics may be relative to the VM allocation
- Container environments may have limited access to host metrics
- Some metrics may be unavailable in certain container runtimes
For a detailed history of changes and improvements, see the Release Notes.
This plugin is licensed under the MIT License.
Copyright © 2025 laplaque/instana_plugins Contributors