Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP & TCP integrations API #235

Merged
merged 18 commits into from
Dec 7, 2020
Merged

HTTP & TCP integrations API #235

merged 18 commits into from
Dec 7, 2020

Conversation

varas
Copy link
Contributor

@varas varas commented Nov 20, 2020

Updated HTTP API to support all integration protocols.

Updated HTTP API to support Windows.

Simple TCP socket API. For now limited to:

You can start playing around by:

  • writing JSON payload lines into TCP like nc localhost 8002 (enable with tcp_server_enabled: true)
  • posting HTTP payload like curl -d "{ "protocol_version": "4", ... }" localhost:8001/v1/data (enable with http_server_enabled: true)

@varas varas requested a review from a team November 20, 2020 17:55
This was referenced Nov 20, 2020
@coveralls
Copy link

coveralls commented Nov 20, 2020

Pull Request Test Coverage Report for Build 405526337

  • 65 of 155 (41.94%) changed or added relevant lines in 9 files are covered.
  • 9 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.03%) to 58.102%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/newrelic-infra/newrelic-infra.go 0 7 0.0%
internal/integrations/v4/integration/integration.go 9 20 45.0%
pkg/helpers/network/network_helpers.go 0 11 0.0%
pkg/plugins/plugins_linux.go 0 11 0.0%
pkg/plugins/http_server.go 15 27 55.56%
internal/socketapi/socketapi.go 35 53 66.04%
internal/plugins/linux/hostinfo.go 0 20 0.0%
Files with Coverage Reduction New Missed Lines %
cmd/newrelic-infra/newrelic-infra.go 1 7.49%
internal/integrations/v4/integration/integration.go 2 52.56%
pkg/metrics/sampler/sampler_routine.go 2 94.74%
pkg/integrations/v4/logs/cfg_watcher.go 4 67.5%
Totals Coverage Status
Change from base Build 400950830: 0.03%
Covered Lines: 11334
Relevant Lines: 19507

💛 - Coveralls

@varas varas force-pushed the feat_http-n-socket-api branch 3 times, most recently from f257b9d to cbb9000 Compare November 20, 2020 18:34
@varas varas changed the title feat http n socket api HTTP & TCP integrations API Nov 23, 2020
@varas varas added this to Ready for review in CAOS: Our Daily Bread Nov 24, 2020
cristianciutea
cristianciutea previously approved these changes Nov 26, 2020
Copy link
Contributor

@cristianciutea cristianciutea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if err != nil {
s.logger.WithField("port", s.port).WithError(err).Error("trying to listen")
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth adding the following?

Suggested change
defer listener.Close()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added along with return

@varas varas merged commit c600c61 into master Dec 7, 2020
@varas varas deleted the feat_http-n-socket-api branch December 7, 2020 09:59
@josemore josemore moved this from Ready for review to Ready For Release in CAOS: Our Daily Bread Dec 9, 2020
@josemore josemore moved this from Ready For Release to Done in CAOS: Our Daily Bread Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants