Install & Compatibility
Where this runs
tested against v1.1.16 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.584s · 24.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.540s · 28MB
23MB installed
● package 23MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SignalFx
✓ from signalfx import SignalFx
✗ import signalfx
SignalFx class is under the signalfx package, not a top-level import.
SignalFxClient
✓ from signalfx import SignalFx
✗ from signalfx.client import SignalFxClient
Use SignalFx class; client classes are internal.
Send a datapoint and event using the v1 SDK with a context manager.
import os
from signalfx import SignalFx
# Set token via environment variable
sfx = SignalFx(api_endpoint='https://ingest.signalfx.com', ingest_timeout_seconds=5)
# If using a realm: sfx = SignalFx(api_endpoint='https://ingest.<REALM>.signalfx.com')
with sfx.ingest(os.environ.get('SIGNALFX_ACCESS_TOKEN', '')) as ingest:
ingest.send_datapoints([
{
'metric': 'cpu.utilization',
'value': 42.0,
'dimensions': {'host': 'server1'}
}
])
ingest.send_events([
{
'eventType': 'deployment',
'dimensions': {'host': 'server1'}
}
])
Errors
Common errors & fixes
ValueError: Unknown type for value: ...
Sending invalid metric value type (e.g., string, list). Values must be int or float.
fixEnsure metric value is numeric: {'metric': 'cpu', 'value': float(cpu_percent)} signalfx.exceptions.SignalFxException: 401 Unauthorized
Invalid or missing access token.
fixSet SIGNALFX_ACCESS_TOKEN environment variable or pass token to SignalFx().
ImportError: cannot import name 'SignalFx' from 'signalfx' (unknown location)
Old Python version missing the module or corrupted install.
fixpip install --upgrade signalfx. On Python 2.7, use signalfx <=1.0.19.
Upgrade
Version history
1.1.16latest on PyPI · released Nov 2, 2022
Audit
Dependencies
protobufrequiredRequired for protobuf-based ingest; pinned to <4.21.0 in 1.1.16