Downgrade Collector Privileges
Linux
By default, the observiq-otel-collector
service runs as the root
user. This is required for some sources to read things like host metrics and log files owned by other users.
Network-based sources (such as OTLP receivers bound to port 4317) are excellent candidates for running with reduced privileges, as they don't require access to host resources.
To run the agent as the observiq-otel-collector
user instead of root
, you may create a systemd override.
Paste the following config:
Note: The group is already set to observiq-otel-collector
by default
Reload Systemd and restart the collector:
Verifying
Check that the collector is running as the new user:
Important Considerations
- Ensure the
observiq-otel-collector
user has the necessary permissions to access any required resources - Some collector components may not function properly without root access
- If you experience issues, check the collector logs for permission-related errors
Common examples of operations that require specific permissions:
- Binding to network ports below 1024 (e.g., syslog on port 514) requires root privileges
- Reading log files owned by other users requires the collector user to be added to the appropriate group that has read access to those files
Troubleshooting
If you encounter permission issues after downgrading privileges:
-
Check the collector logs:
-
Verify the user has access to required directories and files
-
If problems persist, you may need to revert to root privileges by removing the override file:
Windows
By default, the observIQ Distro for OpenTelemetry Collector
service runs with admin privileges. Some OpenTelemetry components require elevated permissions to read certain logs and metrics.
To run the agent as a less privileged user:
- Create a dedicated service account with the minimum required permissions
- Open the Windows Services console (services.msc)
- Find and right-click on the
observIQ Distro for OpenTelemetry Collector
service - Select "Properties"
- Go to the "Log On" tab
- Select "This account"
- Enter the service account credentials
- Click "Apply" and "OK"
- Restart the service
Verifying
Check that the collector is running as the new user:
Important Considerations
- Ensure the service account has the necessary permissions to access any required resources
- Some collector components may not function properly without admin privileges
- The service account should be a member of the
Event Log Readers
group if collecting Windows Events - If collecting Windows Events remotely, the account needs DCOM and WMI permissions
- If you experience issues, check the Windows Event Logs for permission-related errors
Troubleshooting
If you encounter permission issues after downgrading privileges:
-
Check the Windows Event Logs:
- Open Event Viewer
- Look under "Windows Logs" > "Application" for collector-related errors
-
Verify the service account has access to required resources:
- Event Logs
- Performance Counters
- Configuration files
- Network resources
-
If problems persist, you may need to revert to admin privileges:
- Open Services (services.msc)
- Find the collector service
- Set it back to "Local System Account" in the Log On tab
- Restart the service
macOS
Not currently supported