Git Product home page Git Product logo

go-newrelic's Introduction

This is now archived, please see https://github.com/newrelic/newrelic-client-go

go-newrelic

Build Status Go Report Card GoDoc Release

go-newrelic is a Go SDK for communicating with New Relic APIs.

Installation

Use go get to install go-newrelic.

$ go get -u github.com/paultyng/go-newrelic

Usage

import "github.com/paultyng/go-newrelic/v4/api"	// with go modules enabled (GO111MODULE=on or outside GOPATH)
import "github.com/paultyng/go-newrelic/api" // with go modules disabled

Construct a new New Relic client, then use the various methods on the client to access different parts of the New Relic V2 REST API. For example:

config := newrelic.Config{
	APIKey: "<NEWRELIC_API_KEY>",
}

client := newrelic.New(config)
apps, err := client.ListApplications()

Infrastructure Alert Conditions

Infrastructure Alert Conditions are backed by the New Relic Infrastructure API, and require the use of the InfraClient type:

config := newrelic.Config{
	APIKey: "<NEWRELIC_API_KEY>",
}

client := newrelic.NewInfraClient(config)
apps, err := client.ListAlertInfraConditions(policyId)

The GoDoc link below details the available client options and the full list of available client methods.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Validate all linting / tests pass.
  5. Push to the Branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request

Running tests

# Use make to run all validations / tests
make

# Just run tests
make test

Releasing

When cutting a new release, remember to update the Version in api/version.go to match the new tag.

License

Apache-2.0

go-newrelic's People

Contributors

acondrat avatar billmoritz avatar burck1 avatar colesnodgrass avatar constantinelse avatar ctrombley avatar grubernaut avatar ianrayns avatar link-publisher avatar meqif avatar nathanweddle avatar oba11 avatar paul91 avatar paultyng avatar renovate-bot avatar sanderblue avatar sgsiebers avatar slizco avatar smithclay avatar timonwalkley avatar venki09 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-newrelic's Issues

Add support for key transactions REST endpoints

This currently doesn't include support for key transaction REST endpoints, it would be useful so that we could add key transactions as a data source to the terraform new relic provider!

add support for integration_provider field (Cloud Integration)

Hi,

Looks like there is no support for integration_provider field mentioned here

As result I cannot create an alert for Cloud Integration metric. e.g. for AWS Elastic Load Balancer:

    {
      "type": "infra_metric",
      "name": "ELB Healthy Host Count",
      "enabled": true,
      "filter": {
        "and": [
          {
            "is": {
              "provider.elbTag_environment": "prod"
            }
          }
        ]
      },
      "id": 6351055,
      "created_at_epoch_millis": 1532626791478,
      "updated_at_epoch_millis": 1532626791530,
      "policy_id": 287891,
      "event_type": "LoadBalancerSample",
      "select_value": "provider.healthyHostCount.Average",
      "comparison": "below",
      "critical_threshold": {
        "value": 1,
        "duration_minutes": 10,
        "time_function": "all"
      },
      "integration_provider": "Elb"
    },

Servers search

Hi, do you plan to add feature to search servers by name or labels? Because we can setup alerts only for servers which are in APMs.

Proxy support missing

No support for proxy configuration either through HTTP_PROXY environment variable or api client config.

Add support for new relic infrastructure API limit and offset parameters

I have been having sporadic issues with the Terraform New Relic provider (https://github.com/terraform-providers/terraform-provider-newrelic/issues/129) recreating resources because it doesn't seem to be able to pull state for infrastructure resources when there is a large number of those conditions.

I spoke to New Relic and they indicated this is because that Terraform provider is using this API and for the API to handle a larger number of infrastructure alert conditions, it needs to implement support for the limit and offset parameters documented here: https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/infrastructure-alert-conditions/rest-api-calls-new-relic-infrastructure-alerts#get-conditions

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.