
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
This is a programmatic interface in Ruby for SignalFx's metadata and ingest APIs. It is meant to provide a base for communicating with SignalFx APIs that can be easily leveraged by scripts and applications to interact with SignalFx or report metric and event data to SignalFx. Library supports Ruby 2.x versions
Add this line to your application's Gemfile:
gem 'signalfx'
And then execute:
$ bundle
Or install it yourself as:
$ gem install signalfx
To use this library, you need a SignalFx API access token, which can be obtained from the SignalFx organization you want to report data into.
The default constructor SignalFx
uses Protobuf to send data to SignalFx. If it cannot send Protobuf, it falls back to sending JSON.
require('signalfx');
// Create client
client = SignalFx.new 'MY_SIGNALFX_TOKEN';
Optional constructor parameters:
false
by default.
If true
, library will retrieve Amazon unique identifier
and set it as AWSUniqueId
dimension for each datapoint and event.
Use this option only if your application deployed to AmazonThis example shows how to report metrics to SignalFx, as gauges, counters, or cumulative counters.
require('signalfx');
client = SignalFx.new 'MY_SIGNALFX_TOKEN';
client.send(
cumulative_counters:[
{ :metric => 'myfunc.calls_cumulative',
:value => 10,
:timestamp => 1442960607000 },
...
],
gauges:[
{ :metric => 'myfunc.time',
:value => 532,
:timestamp => 1442960607000},
...
],
counters:[
{ :metric => 'myfunc.calls',
:value => 42,
:timestamp => 1442960607000},
...
]);
The timestamp
must be a millisecond precision timestamp; the number of milliseconds elapsed since Epoch. The timestamp
field is optional, but strongly recommended. If not specified, it will be set by SignalFx's ingest servers automatically; in this situation, the timestamp of your datapoints will not accurately represent the time of their measurement (network latency, batching, etc. will all impact when those datapoints actually make it to SignalFx).
Reporting dimensions for the data is also optional, and can be accomplished by specifying a dimensions
parameter on each datapoint containing a dictionary of string to string key/value pairs representing the dimensions:
require('signalfx');
client = SignalFx.new 'MY_SIGNALFX_TOKEN';
client.send(
cumulative_counters:[
{ :metric => 'myfunc.calls_cumulative',
:value => 10,
:dimensions => [{:key => 'host', :value => 'server1'}]},
...
],
gauges:[
{ :metric => 'myfunc.time',
:value=> 532,
:dimensions=> [{:key => 'host', :value => 'server1'}]},
...
],
counters:[
{ :metric=> 'myfunc.calls',
:value=> 42,
:dimensions=> [{:key => 'host', :value => 'server1'}]},
...
]);
See examples/generic_usecase.py
for a complete code example for Reporting data.
Events can be sent to SignalFx via the send_event
function. The
event type must be specified, and dimensions and extra event properties
can be supplied as well.
require('signalfx');
client = SignalFx.new 'MY_SIGNALFX_TOKEN';
client.send_event(
'[event_type]',
{
host: 'myhost',
service: 'myservice',
instance: 'myinstance'
},
properties={
version: 'event_version'})
See examples/generic_usecase.py
for a complete code example for Reporting data.
Apache Software License v2 © SignalFx
FAQs
Unknown package
We found that lusis-signalfx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.