Skip to content

Writing a New Integration Package

Rich Vanderwal edited this page Aug 4, 2021 · 2 revisions

Here are all the things that go into writing a new Integration Package:

Developer Setup

  • Fork the Go Agent.
  • Make sure it builds, and the v3/newrelic and v3/internal tests pass.

Research

  • Research the library, read the code, come up with different ideas of how we could instrument.
  • Discuss the candidates for instrumentation, and choose one.
  • Write a prototype spike to see if it’s a viable approach for us and our customers. If it’s not, go back to the previous step.

Development

  • Include a go.mod file
  • Supportability metric for tracking usage:
    • Add an init function similar to:
     func init() { internal.TrackUsage("integration", "datastore", "redigo") }
  • Write good unit tests
  • Godocs documentation:
    • Package level doc
    • Method/func level docs
    • Examples (either Godoc style or in the method/func doc)
  • Include a full code example
  • Use it like a customer would and fix any surprises
  • Update README integrations list
  • Add CHANGELOG entry
  • Create a simple README for the integration directory
  • Add testing to GitHub CI workflow

Datastore Specific

  • Gather the host/port for instance info metrics

Upon Release

  • Update docs site integrations list here
  • Update Angler for the new Supportability metric created here
  • Add a tag for the new integration package, eg. v3/integrations/nrredis-v7/v1.0.0