Giter Site home page Giter Site logo

nickschuch / newrelic-client-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from newrelic/newrelic-client-go

0.0 1.0 0.0 5.73 MB

New Relic Client for the Go programming language

Home Page: https://newrelic.github.io/developer-toolkit/

License: Apache License 2.0

Makefile 1.53% Go 98.31% Shell 0.16%

newrelic-client-go's Introduction

Community Project header

newrelic-client-go

Testing Security Scan Go Report Card GoDoc License CLA assistant Release

The New Relic Client provides the building blocks for tools in the Developer Toolkit, enabling quick access to the suite of New Relic APIs. As a library, it can also be leveraged within your own custom applications.

Example

package main

import (
	"fmt"
	"os"

	log "github.com/sirupsen/logrus"

	"github.com/newrelic/newrelic-client-go/newrelic"
	"github.com/newrelic/newrelic-client-go/pkg/entities"
)

func main() {
	// Initialize the client.
	client, err := newrelic.New(newrelic.ConfigPersonalAPIKey(os.Getenv("NEW_RELIC_API_KEY")))
	if err != nil {
		log.Fatal("error initializing client:", err)
	}

	// Search the current account for entities by name and type.
	searchParams := entities.SearchEntitiesParams{
		Name: "Example entity",
		Type: entities.EntityTypes.Application,
	}

	entities, err := client.Entities.SearchEntities(searchParams)
	if err != nil {
		log.Fatal("error searching entities:", err)
	}

	fmt.Printf("%+v\n", entities)
}

Community

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices.

  • Roadmap - As part of the Developer Toolkit, the roadmap for this project follows the same RFC process
  • Issues or Enhancement Requests - Issues and enhancement requests can be submitted in the Issues tab of this repository. Please search for and review the existing open issues before submitting a new issue.
  • Contributors Guide - Contributions are welcome (and if you submit a Enhancement Request, expect to be invited to contribute it yourself ๐Ÿ˜).
  • Community discussion board - Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub.

Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at [email protected].

Development

Requirements

  • Go 1.13.0+
  • GNU Make
  • git

Building

This package does not generate any direct usable assets (it's a library). You can still run the build scripts to validate you code, and generate coverage information.

# Default target is 'build'
$ make

# Explicitly run build
$ make build

# Locally test the CI build scripts
# make build-ci

Testing

Before contributing, all linting and tests must pass.

Tests can be run directly via:

# Tests and Linting
$ make test

# Only unit tests
$ make test-unit

# Only integration tests
$ make test-integration

Integration tests

Integration tests communicate with the New Relic API, and therefore require proper account credentials to run properly. The suite makes use of secrets, which will need to be configured in the environment or else the integraiton tests will be skipped during a test run. To run the integration test suite, the following secrets will need to be configured:

NEW_RELIC_API_KEY
NEW_RELIC_ACCOUNT_ID
NEW_RELIC_INSIGHTS_INSERT_KEY
NEW_RELIC_LICENSE_KEY
NEW_RELIC_REGION

Go Version Support

We'll aim to support the latest supported release of Go, along with the previous release. This doesn't mean that building with an older version of Go will not work, but we don't intend to support a Go version in this project that is not supported by the larger Go community. Please see the Go releases page for more details.

Commit Messages

Using the following format for commit messages allows for auto-generation of the CHANGELOG:

Format:

<type>(<scope>): <subject>

Type Description Change log?
chore Maintenance type work No
docs Documentation Updates Yes
feat New Features Yes
fix Bug Fixes Yes
refactor Code Refactoring No

Scope

This refers to what part of the code is the focus of the work. For example:

General:

  • build - Work related to the build system (linting, makefiles, CI/CD, etc)
  • release - Work related to cutting a new release

Package Specific:

  • newrelic - Work related to the New Relic package
  • http - Work related to the internal/http package
  • alerts - Work related to the pkg/alerts package

Documentation

Note: This requires the repo to be in your GOPATH (godoc issue)

$ make docs

Community Support

New Relic hosts and moderates an online forum where you can interact with New Relic employees as well as other customers to get help and share best practices. Like all New Relic open source community projects, there's a related topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

https://discuss.newrelic.com/t/new-relic-one-top-nerdpack/82934

Please do not report issues with Top to New Relic Global Technical Support. Instead, visit the Explorers Hub for troubleshooting and best-practices.

Issues / Enhancement Requests

Issues and enhancement requests can be submitted in te Issues tab of this repository. Please search for and review the existing open issues before submitting a new issue.

Contributing

Contributions are welcome (and if you submit a Enhancement Request, expect to be invited to contribute it yourself ๐Ÿ˜). Please review our Contributors Guide.

Keep in mind that when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. If you'd like to execute our corporate CLA, or if you have any questions, please drop us an email at [email protected].

Open Source License

This project is distributed under the Apache 2 license.

newrelic-client-go's People

Contributors

bpecknr avatar bthemad avatar caarlos0 avatar colesnodgrass avatar ctrombley avatar davidji99 avatar jaymcgrath avatar jhunthrop avatar jhutchings1 avatar kminehart avatar msummers-nr avatar renovate-bot avatar robday-reynolds avatar sanderblue avatar sowmyajujjuri avatar zlesnr avatar

Watchers

 avatar

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.