Registry / observability / sdcclient

sdcclient

JSON →
library0.19.0pypypi✓ verified 90d ago

sdcclient is the official Python client for the Sysdig Platform APIs (Monitor and Secure). It provides an easy-to-use interface to interact with Sysdig's REST APIs for tasks such as metric extraction, alert management, and user/team administration. The current version is 0.19.0, and releases generally follow the development of the Sysdig platform, with updates for new API features and bug fixes.

pip install sdcclient
INSTALL
IMPORT
SIG · SDCCLIENT
S
sdcclient
observabilitypythonv0.19.0
Install
2.7s avg
Import
867ms
Disk
25MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.19.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.909s · 25.9MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 2.7s · import 0.826s · 27MB
25MB installed
● package 25MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SdMonitorClient
✓ from sdcclient import SdMonitorClient
SdSecureClient
✓ from sdcclient import SdSecureClient
SdcClient
✓ from sdcclient import SdcClient
SdcClient is an alias for SdMonitorClient for backward compatibility. For new code, it is recommended to use SdMonitorClient or SdSecureClient explicitly.

This quickstart demonstrates how to instantiate a Sysdig Monitor client using an API token, preferably from an environment variable, and then fetch basic user information. It also shows how to handle the common `[success_boolean, result_or_error]` return pattern.

import os from sdcclient import SdMonitorClient # It's recommended to store your API token in an environment variable for security. # export SYSDIG_API_TOKEN='YOUR_SYSDIG_API_TOKEN' # export SDC_URL='https://app.sysdig.com' api_token = os.environ.get('SYSDIG_API_TOKEN', '') sdc_url = os.environ.get('SDC_URL', 'https://app.sysdig.com') # Default SaaS URL if not api_token: print("Error: SYSDIG_API_TOKEN environment variable not set.") exit(1) # Instantiate the Sysdig Monitor client client = SdMonitorClient(api_token, sdc_url=sdc_url) # Example: Get current user information ok, res = client.get_user_info() if ok: print("Successfully connected to Sysdig Monitor.") print(f"User Info: {res}") else: print(f"Failed to get user info: {res}")
Debug
Known issues
gotchaThe `SdcClient` class is an alias for `SdMonitorClient` for backward compatibility. While it still works, new code should explicitly use `SdMonitorClient` for Sysdig Monitor interactions and `SdSecureClient` for Sysdig Secure interactions to improve clarity and future-proof your code.
fix
Use `from sdcclient import SdMonitorClient` or `from sdcclient import SdSecureClient` and instantiate the respective class.
affects: All versions
gotchaSysdig API methods return a tuple: `[boolean_success_status, result_data_or_error_string]`. Always check the boolean status before attempting to process the second element, as it will contain an error message on failure.
fix
Always include `if ok: ... else: ...` logic after every API call.
affects: All versions
gotchaFor on-premises Sysdig installations, you must specify the API server URL and potentially disable SSL verification. This can be done via environment variables (`SDC_URL`, `SDC_SSL_VERIFY`) or directly in the client constructor.
fix
Set `SDC_URL` and `SDC_SSL_VERIFY='false'` environment variables, or pass `sdc_url='https://your-api-server'` and `ssl_verify=False` to the client constructor.
affects: All versions
Errors
Common errors & fixes
Error: SYSDIG_API_TOKEN environment variable not set.
The Sysdig API token was not provided to the client constructor and the `SYSDIG_API_TOKEN` environment variable is missing.
fix
Export your Sysdig API token: `export SYSDIG_API_TOKEN='YOUR_TOKEN_HERE'` or pass it directly: `client = SdMonitorClient('YOUR_TOKEN_HERE')`.
Failed to get user info: status code 401
The provided Sysdig API token is invalid or expired, resulting in an unauthorized access error.
fix
Verify your Sysdig API token. Obtain a new one from the Sysdig Monitor/Secure settings page if necessary.
requests.exceptions.SSLError: ('CERTIFICATE_VERIFY_FAILED', ...)
This usually occurs in on-premises installations with self-signed SSL certificates when `ssl_verify` is set to `True` (the default).
fix
Set `SDC_SSL_VERIFY='false'` as an environment variable or pass `ssl_verify=False` to the client constructor. Ensure you understand the security implications of disabling SSL verification.
Upgrade
Version history
0.19.0latest on PyPI · released May 8, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
2
Amazon
1
Resources