feat(transports/newrelic): add New Relic transport#90
Merged
Conversation
monorel-Release: transports/axiom v1.0.0 monorel-PreRelease: false Co-authored-by: monorel-bot[automation] <monorel-bot@users.noreply.github.com>
Wrap transports/http with New Relic-specific encoding,
site-aware URL derivation, and Api-Key header management.
Supports US and EU sites, on-prem URL overrides, and all
standard loglayer features (fields, metadata, groups,
level filtering, error handling).
- transports/newrelic: New Relic Log Ingest API transport
- Site-aware intake URL (US, EU)
- Configurable on-prem URL override
- Non-https URL rejection (with AllowInsecureURL opt-out)
- License key redaction in String() and JSON output
- Build-tagged live test against real intake API
- JSON-array encoder (logtype, timestamp, loglevel, message)
- Level mapping: panic/fatal → critical, rest → passthrough
- ErrLicenseKeyRequired, ErrInsecureURL,
ErrHTTPOverrideForbidden sentinels
- docs: New Relic transport docs page
- docs: Remove live test sections from transport docs
- docs: Clarify sub-module versioning guidance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a New Relic transport that wraps
transports/httpwith New Relic Log Ingest API specific defaults: JSON-array encoding (logtype, timestamp, loglevel, message), site-aware intake URL derivation, andApi-Keyheader management.New Module
go.loglayer.dev/transports/newrelictransports/http,github.com/goccy/go-json(as the core dependency)Features
SiteUS(default) andSiteEUwith correct intake URL derivationConfig.URLoverrides site-derived URLBuild()rejectshttp://URLs by default (opt-out viaConfig.AllowInsecureURL)Config.String()masks the key;json:"-"tag prevents JSON leakBatchSizeof 100 stays under 1MB per POST (documented in transport docs)Sentinel Errors
ErrLicenseKeyRequired— empty license keyErrInsecureURL— non-https URL withoutAllowInsecureURLErrHTTPOverrideForbidden—Config.HTTP.URLorConfig.HTTP.Encoderset by callerDocumentation
New
docs/src/transports/newrelic.mdpage covering installation, usage, configuration, and API limits. Also removes "Live Test" sections from datadog.md and otellog.md transport docs (development artifacts don't belong in user-facing docs).Docs Rules Update
.claude/rules/documentation.mdprohibiting "Live Test" sections in transport/plugin docs/v2suffix on module path initially)Testing
//go:build livetest) verified against real New Relic US intake APIChangeset
.changeset/calm-ivy.md:transports/newrelic:major→v1.0.0