Skip to main content

SignalFx detector sync utility

Project description

sfx-sync-detectors is a command-line tool that helps keep SignalFx detectors in version control and sync them with SignalFx. It operates over a directory tree of detector files, each representing a detector, and makes sure that what is in SignalFx is up-to-date.

Installation

$ pip install signalfx-detector-syncer

Usage

$ sfx-sync-detectors --token=$SFX_AUTH_TOKEN /path/to/detectors/

For full usage information, run with -h or --help.

How it works

The syncer works by file path under the given base directory. Each detector is written in its own file, either in JSON or YAML format and named as an easily identifiable dash-separated-slug (.json or .yaml). The relative file path from the given base directory identifies the detector: updates to the same file will update the existing detector. Creating a new file creates a new detector; removing a file removes the corresponding detector from SignalFx.

Detectors managed by the syncer are identified within SignalFx by multiple tags:

  • a signalfx-detector-syncer tag, present on all detectors created and managed by the detector syncer;

  • a from:<filepath> tag, specific to a particular detector, which ties the detector to the file path it came from in the synced directory tree;

  • optionally, an additional scope:<scope> identifier tag that further scopes the detector (see below Scoping).

JSON

When the file contains JSON, it is expected to contain the direct JSON detector model that would be pushed to SignalFx’s detector API.

YAML layout

For YAML (more human readable!), each file contains two YAML documents separated by the expected --- line. The first document, the front matter, defines the configuration of the detector and its rules and notifications. The second document is the SignalFlow 2.0 program text of the detector.

---
name: The detector name
description: The detector description
tags: [latency, demo]
rules:
  my label:
    severity: Critical
    description: Something's wrong!
    notifications:
      - type: Email
        email: test@test.com
---

detect(when(data('demo.trans.latency') > 220, lasting='5s')).publish('my label')

Specification

The specification of the front matter that configures the detector is pretty much what the detector API expects. The only expection is that rules may directly keyed by the detect label they map to if you want to.

You will also want to look at the detector Model for additional details around notifications, rules and visualization options.

Scoping

If you want, you can limit the scope of detectors that the syncer will consider by specifying the --scope option with an identifier. This will be used as an additional piece of information that the syncer looks for when considering which detectors should be updated or removed.

This allows for multiple distinct sets of detectors to be synced from different base locations into the same SignalFx organization, even if one of them uses no scope.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

signalfx_detector_syncer-0.9-py2.py3-none-any.whl (10.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file signalfx_detector_syncer-0.9-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for signalfx_detector_syncer-0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b09d1297930f9de85fda2707e3e035b7ea1ddf8ce3e756544c30c1136e991d53
MD5 3700b0adb0e0e98e267d62bca164e45b
BLAKE2b-256 d4cc73809757145ae431824580a7a6b5e0e824a526a044b54790587f5911880c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page