Giter Club home page Giter Club logo

terraform-provider-signalform's Introduction

terraform-provider-signalform

GitHub version Build Status License

SignalForm is a terraform provider to codify SignalFx detectors, charts and dashboards, thereby making it easier to create, manage and version control them.

Signalform is not an official SignalFx product, so we do not guarantee a 1:1 mapping between the SignalFx API and the functionalities offered by the provider.

Please note that this provider is tested against Terraform 0.10. We do not guarantee that the provider works correctly with any other version of Terraform, even though it might.

Documentation is available here.

Changelog is available here.

Build And Install

Build binary from source

To build the go binary from source:

make build

The output binary will be placed in the bin/ folder.

The default platform target is linux-amd64. If you want to customize your target platform set the GOOS and GOARCH environment variables; e.g.:

GOOS=darwin GOARCH=amd64 make build

Once you have built the binary, place it in the same folder of your terraform installation for it to be available everywhere.

Build debian package from source

If you want to build your package targeting at the same time Ubuntu Trusty and Xenial, then run:

make package

The output package will be placed in the dist/ folder (e.g. dist/terraform-provider-signalform-0.9_2.2.5-default0_amd64.deb)

If you want to target a specific Ubuntu version, use the itest_* command as below:

make itest_trusty

You can set environament variables to customize your build:

  • TF_PATH: Path of your terraform installation. Default: /nail/opt/terraform-$(TF_VERSION), with TF_VERSION being the one supported by the provider.
  • ORG: Organization name to be used for your package name. Default: default (e.g. terraform-provider-signalform-0.9_2.2.5-$(ORG)0_amd64.deb)
  • BUILD_NUMBER: This variable will be used as iteration number. If not set, the default will be 0 (e.g. terraform-provider-signalform-0.9_2.2.5-default$(BUILD_NUMBER)_amd64.deb)
  • upstream_build_number: If BUILD_NUMBER is not set and if your CI pipeline (e.g. Jenkins) defines this variable, then the job id will be used as iteration number for your package (e.g. terraform-provider-signalform-0.9_2.2.5-default$(upstream_build_number)_amd64.deb)
  • GOOS and GOARCH: see the above section. Remember to run make clean between builds with different target platform, so you start from a clean environment.

Once you built the package, you can just install like:

sudo dpkg -i dist/terraform-provider-signalform.deb

Release

To make a new release:

  1. bump VERSION up in build/Makefile (use semantic versioning)
  2. run make changelog and edit the changelog file
  3. git commit
  4. git tag v<VERSION>
  5. git push origin master && git push origin --tags

Contributing

Everyone is encouraged to contribute to terraform-provider-signalform. You can contribute by forking the GitHub repo and making a pull request or opening an issue.

Running tests

To run the tests, run make test

To pass options to the test, e.g to target a specific test, pass the TEST_OPTS option to the make task - e.g

make test TEST_OPTS='-test.run TestSendRequestSuccess'

To make the tests run faster, you can run

make test TEST_OPTS='-i'

Subsequent make test commands should be quicker

FAQ

Why not calling it terraform-provider-signalfx?

Signalform is not an official SignalFx product, being owned and maintained by Yelp. For this reason, we decided not to call this provider terraform-provider-signalfx in case SignalFx decides to publish an official one.

SignalFlow is hard!

It is a bit hard, indeed. You might find useful to read the SignalFlow Overview.

Also remember that given a chart or detector created from the UI, you can see its representation in Signalflow from the Actions menu:

Show SignalFlow Signalflow

terraform-provider-signalform's People

Contributors

angelolicastro avatar bobtfish avatar dichiarafrancesco avatar drmorr0 avatar ewr avatar joshu-stripe avatar jvperrin avatar kennydo avatar liorrozen avatar matfra avatar nhandler avatar poros avatar rahulravindran0108 avatar sarguru avatar sjung-stripe avatar solarkennedy avatar stephenthedev avatar timmow avatar tub avatar vulpine avatar wvivar avatar zachm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-signalform's Issues

Treat notification as an object instead of a string

Currently, the notifications associated with a detector rule are stored as a list of strings:

rule {
    description = "maximum > 60 for 30m"
    severity = "Critical"
    detect_label = "Processing old messages 30m"
    notifications = ["Email,[email protected]"]
}

I would like to propose storing them as objects instead:

rule {
    description = "maximum > 60 for 30m"
    severity = "Critical"
    detect_label = "Processing old messages 30m"
    notification {
        type = "Email"
        email = "[email protected]"
    }
}

or perhaps even:

rule {
    description = "maximum > 60 for 30m"
    severity = "Critical"
    detect_label = "Processing old messages 30m"
    email {
        email = "[email protected]"
    }
}

Motivation for this change: I am planning to add support for the signalfx teams api to signalform, and teams support a notificationlist which (to my understanding) uses the same object as detector rules. It would be useful to have the same structure in both places. In addition, this approach would more closely reflect the underlying API's data model, and would allow for more types of notifications to be supported. (For example, signalform does not currently support sending notifications to a team, which could have its own notification configuration.)

What are your thoughts on this change? I am happy to implement it myself if this is something you'd be willing to accept.

Detector fails to link Slack notification silently

The Slack notification is silently failing. The Pagerduty one is linked but the Slack one is not linked when I look at them in the SignalFX UI.

This is the code that I have that creates the detectors.

resource "signalform_detector" "site_capacity" {
    provider = "signalform"
    count = "${length(var.regions)}"
    name = "${var.regions[count.index]} stack capacity"
    max_delay = 30
    description = "Alerts when stack capacity in a region is full"
    program_text = <<-EOF
        [.....]
        detect("Site Capacity @ 95%", when(site_count > site_capacity * 0.95, lasting='5s'))
        detect("Site Capacity @ 90%", when(site_count > site_capacity * 0.90, lasting='5s'))
    EOF
    rule {
        description = "active when site count exceeds 95% site capacity"
        severity = "Critical"
        detect_label = "Site Capacity @ 95%"
        notifications = ["PagerDuty,RedactedId"]
    }
    rule {
        description = "active when site count exceeds 90% site capacity"
        severity = "Major"
        detect_label = "CDE Site Capacity @ 90%"
        notifications = ["Slack,RedactedId,#channelname"]
    }
}

Clarify terraform version requirement

The readme states "Please note that this provider only works with terraform 0.9." but in testing it appears to be working on Terraform v0.11.2. Is 0.9 a minimum requirement, the only version being tested or are their known issues on the new versions?

400 "Failed to deserialize payload" when creating a dashboard

We have a (somewhat simple) signalform_dashboard resource being created.

See gist: https://gist.github.com/cb-tjuricek/5d4711493c061f83da0de0e3b93fe380

When attempting to apply, even with the TF_LOG=TRACE variable set, the only information we receive is the following:

2018-10-19T09:01:11.386-0700 [DEBUG] plugin.terraform-provider-signalform: 2018/10/19 09:01:11 [ERR] plugin: stream copy 'stderr' error: stream closed
2018-10-19T09:01:11.386-0700 [DEBUG] plugin.terraform-provider-signalform: 2018/10/19 09:01:11 [ERR] plugin: plugin server: accept unix /Users/tjuricek/Desktop/reno/plugin158257377: use of closed network connection
* signalform_dashboard.cache_layer: For the resource CbDefense Central Cache Layer SignalFx returned status 400: 
{
  "code" : 400,
  "message" : "Failed to deserialize payload"
}

This is a little hard to interpret - is there a way to get more details from the plugin?

I've double checked all chart IDs referenced, and they exist and the charts themselves all appear to be created. It's only this dashboard resource failing.

Add ability to configure provider using .netrc file

The .netrc file is quite a common way to handle authentication credentials for any host.

We are using this way for handling auth credentials for various machines in our network.

Is it planned to add .netrc support?

Visualization options for detector

Hi!

I'm trying to create detector chart and could not find a way to add visualization options (color metrics with different colors, units etc.). I see this options available on the chart.

Maybe there is a way to create a chart and then reference chart in the detector resource. Any suggestions?

Suggestion: Docker build

Before I do the work to implement it I wondered if you would be open to me providing a PR which adds a Dockerfile to this project to allow building in a docker container instead of needing build tools installed locally?

I would also propose to add a make docker target which will run the necessary docker commands to build the provider.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.