Skip to content

Commit

Permalink
Vendor dependencies, update readme/open source files & move tests/lin…
Browse files Browse the repository at this point in the history
…ting to Github actions (#60)
  • Loading branch information
jorik authored Jul 28, 2020
1 parent 6149045 commit 252f3be
Show file tree
Hide file tree
Showing 2,014 changed files with 814,325 additions and 204 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Security Scan
on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/golang@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=high
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: lint and test code
on:
push:
tags:
- v*
branches:
- main
pull_request:
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '^1.14.4'
- name: Run unit tests
run: make test
lint:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
version: v1.29
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.idea
*.log
tmp/
vendor/*/
bin/
deploy/local*.yaml
dist/
Expand Down
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ go:
- "1.13"
script:
- make
- 'if [ "$SNYK_TOKEN" != "" ]; then npm install -g snyk; fi'
- 'if [ "$SNYK_TOKEN" != "" ]; then make snyk; fi'
services:
- docker
before_deploy:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ the dest match with the original scraped instead of the renamed one.
- Watch Kubernetes objects

### Removed
- New Relic Infrastructure Agent dependency
- New Relic infrastructure agent dependency

## 0.1.0 - 2019-02-13
### Added
Expand Down
78 changes: 3 additions & 75 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,5 @@
# CONTRIBUTOR COVENANT CODE OF CONDUCT
### Hello! We're glad you've joined us.

## Our Pledge
We believe participation in our community should be a harassment free experience for everyone.

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age,
body size, disability, ethnicity, sex characteristics, gender identity and
expression, level of experience, education, socio-economic status, nationality,
personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies
when an individual is representing the project or its community in public
spaces. Examples of representing a project or community include using an
official project e-mail address, posting via an official social media account,
or acting as an appointed representative at an online or offline event.
Representation of a project may be further defined and clarified by project
maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an
incident. Further details of specific enforcement policies may be posted
separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project’s leadership.

## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
available at
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
Learn more about our guidelines and principles by reading our [Code of Conduct](https://opensource.newrelic.com/code-of-conduct/) on our Open Source Website.
140 changes: 19 additions & 121 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,132 +1,30 @@
# Contributing to Prometheus OpenMetrics Integration
# Contributing

At New Relic we welcome community code contributions to our code, and have
taken effort to make this process easy for both contributors and our development
team.
Contributions are always welcome. Before contributing please read the
[code of conduct](./CODE_OF_CONDUCT.md) and [search the issue tracker](issues); your issue may have already been discussed or fixed in `main`. To contribute,
[fork](https://help.github.com/articles/fork-a-repo/) this repository, commit your changes, and [send a Pull Request](https://help.github.com/articles/using-pull-requests/).

## How to contribute
Note that our [code of conduct](./CODE_OF_CONDUCT.md) applies to all platforms and venues related to this project; please follow it in all your interactions with the project and its participants.

- Read this CONTRIBUTING file.
- Read our [Code of Conduct](./CODE_OF_CONDUCT.md).
- Run Tests.
- Submit a PR.
- *Ensure you’ve signed the CLA, otherwise you’ll be asked to do so.*
## Feature Requests

## How to get help or ask questions
Feature requests should be submitted in the [Issue tracker](../../issues), with a description of the expected behavior & use case, where they’ll remain closed until sufficient interest, [e.g. :+1: reactions](https://help.github.com/articles/about-discussions-in-issues-and-pull-requests/), has been [shown by the community](../../issues?q=label%3A%22votes+needed%22+sort%3Areactions-%2B1-desc).
Before submitting an Issue, please search for similar ones in the
[closed issues](../../issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).

Do you have questions or are you experiencing unexpected behaviors after
modifying this Open Source Software? Please engage with the “Build on New
Relic” space in the [Explorers
Hub](https://discuss.newrelic.com/c/build-on-new-relic/Open-Source-Agents-SDKs),
New Relic’s Forum. Posts are publicly viewable by anyone, please do not include
PII or sensitive information in your forum post.
## Pull Requests

## Contributor License Agreement ("CLA")
1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
2. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
3. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you.

We'd love to get your contributions to improve Prometheus OpenMetrics
Integration! Keep in mind when you submit your pull request, you'll need to
sign the CLA via the click-through using CLA-Assistant. You only have to sign
the CLA one time per project.
## Contributor License Agreement

To execute our corporate CLA, which is required if your contribution is on
behalf of a company, or if you have any questions, please drop us an email at
[email protected].
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].

## Filing Issues & Bug Reports
For more information about CLAs, please check out Alex Russell’s excellent post,
[“Why Do I Need to Sign This?”](https://infrequently.org/2008/06/why-do-i-need-to-sign-this/).

We use GitHub issues to track public issues and bugs. If possible, please
provide a link to an example app or gist that reproduces the issue. When filing
an issue, please ensure your description is clear and includes the following
information. Be aware that GitHub issues are publicly viewable by anyone, so
please do not include personal information in your GitHub issue or in any of
your contributions, except as minimally necessary for the purpose of supporting
your issue. New Relic will process any personal data you submit through GitHub
issues in compliance with the New Relic [Privacy
Notice](https://newrelic.com/termsandconditions/privacy).
## Slack

- Project version (ex: 0.4.0)
- Custom configurations (ex: flag=true)
- Any modifications made to the project.


### A note about vulnerabilities

New Relic is committed to the privacy and security of our customers and their
data. We believe that providing coordinated disclosure by security researchers
and engaging with the security community are important means to achieve our
security goals. If you believe you have found a security vulnerability in this
project or any of New Relic's products or websites, we welcome and greatly
appreciate you reporting it to New Relic through
[HackerOne](https://hackerone.com/newrelic).

## Setting up your environment

This Open Source Software can be used in a large number of environments, all of
which have their own quirks and best practices. As such, while we are happy to
provide documentation and assistance for unmodified Open Source Software, we
cannot provide support for your specific environment or your modifications to
the code.

## PR Guidelines

Failing to comply with the following guidelines may result in your PR being
rejected or not reviewed by the maintainers until the issues are fixed:

- CI job runs and passes.
- Adheres to the spirit of our various styleguides.
- Has thorough unit test coverage.
- Appropriate documentation is included.
- PR title summarizes the change.
- PR description includes:
- A detailed summary of what changed.
- The motivation for the change.
- A link to each issue that is closed by the PR (e.g. Closes #123).

Keep in mind that these are just guidelines and may not apply in every case.

## Coding Style Guidelines

This project follows a coding style enforced using linters developed by
the Golang community.

### Running Coding Style Validation

Validating the code to see if it conforms to the project style is simple. Just
invoke:

```bash
$ make validate
```

## Testing Guidelines

This project includes a suite of unit tests with each package which should be
used to verify your changes don't break existing functionality.

### Running Tests

Running the test suite is simple. Just invoke:

```bash
$ make test
```

### Writing Tests

For most contributions it is strongly recommended to add additional tests which
exercise your changes.

This helps us efficiently incorporate your changes into our mainline codebase
and provides a safeguard that your change won't be broken by future
development.

There are some rare cases where code changes do not result in changed
functionality (e.g. a performance optimization) and new tests are not required.
In general, including tests with your pull request dramatically increase the
chances it will be accepted.

## License

By contributing to Prometheus OpenMetrics Integration, you agree that your
contributions will be licensed under the [LICENSE](./LICENSE) file in the root
directory of this source tree.
We host a public Slack with a dedicated channel for contributors and maintainers of open source projects hosted by New Relic. If you are contributing to this project, you're welcome to request access to the #oss-contributors channel in the newrelicusers.slack.com workspace. To request access, see https://newrelicusers-signup.herokuapp.com/.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019 New Relic, Inc.
Copyright 2020 New Relic

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
53 changes: 51 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
[![Build Status](https://travis-ci.org/newrelic/nri-prometheus.svg?branch=main)](https://travis-ci.org/newrelic/nri-prometheus.svg?branch=main)
[![CLA assistant](https://cla-assistant.io/readme/badge/newrelic/nri-prometheus)](https://cla-assistant.io/newrelic/nri-prometheus)

Fetch metrics in the Prometheus metrics format, inside or outside Kubernetes,
and send them to the New Relic Metrics platform.
Fetch metrics in the Prometheus metrics format, inside or outside Kubernetes, and send them to the New Relic Metrics platform.

## How to use it?

Expand Down Expand Up @@ -66,3 +65,53 @@ kubectl config get-contexts
# run the program
go run cmd/k8s-target-retriever/main.go
```

## Testing

To run the tests execute:

```bash
$ make test
```

## Support

Should you need assistance with New Relic products, you are in good hands with several support diagnostic tools and support channels.

> This [troubleshooting framework](https://discuss.newrelic.com/t/troubleshooting-frameworks/108787) steps you through common troubleshooting questions.
> New Relic offers NRDiag, [a client-side diagnostic utility](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics) that automatically detects common problems with New Relic agents. If NRDiag detects a problem, it suggests troubleshooting steps. NRDiag can also automatically attach troubleshooting data to a New Relic Support ticket.
If the issue has been confirmed as a bug or is a Feature request, please file a Github issue.

**Support Channels**

* [New Relic Documentation](https://docs.newrelic.com): Comprehensive guidance for using our platform
* [New Relic Community](https://discuss.newrelic.com): The best place to engage in troubleshooting questions
* [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications
* [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level

## Privacy

At New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise.

We define “Personal Data” as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address and email address.

Review [New Relic’s General Data Privacy Notice](https://newrelic.com/termsandconditions/privacy) for more information.

## Contributing

We encourage your contributions to improve the Prometheus integration! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].

**A note about vulnerabilities**

As noted in our [security policy](/SECURITY.md), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic).

If you would like to contribute to this project, please review [these guidelines](./CONTRIBUTING.md).

To all contributors, we thank you! Without your contribution, this project would not be what it is today.

## License
nri-prometheus is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License.
Loading

0 comments on commit 252f3be

Please sign in to comment.