Skip to content

feat(transports/newrelic): align encoder with TypeScript transport format#92

Merged
theogravity merged 2 commits into
mainfrom
feat/newrelic-align-encoder
May 12, 2026
Merged

feat(transports/newrelic): align encoder with TypeScript transport format#92
theogravity merged 2 commits into
mainfrom
feat/newrelic-align-encoder

Conversation

@theogravity
Copy link
Copy Markdown
Contributor

Aligns the Go New Relic transport encoder with the TypeScript transport v4 format.

Changes

  • Encoder shape: logtype/loglevel/message + flat fields → timestamp, level, log, attributes (nested)
  • Attribute validation enforced at encode time:
    • Max 255 attributes (excess dropped)
    • Max 255-char attribute names (excess dropped)
    • String values truncated at 4,094 chars
  • Reserved fields (timestamp, level, log) excluded from attributes to prevent collisions
  • Tests updated to match new format (21 tests pass)
  • Livetest verified against live New Relic API
  • Documentation updated (encoded body shape, API limits, whats-new)

Breaking change

The JSON payload sent to the New Relic Log Ingest API has changed. Consumers viewing raw logs will see the new attributes-based structure matching the TypeScript transport instead of the previous flat format.

…rmat

Update encoder to emit timestamp/level/log/attributes instead of
logtype/loglevel/message with flat fields. Adds attribute validation
(max 255 attributes, 255-char names, 4094-char values) at encode
time. Documentation and tests updated to match.
@theogravity theogravity merged commit 1cf21b4 into main May 12, 2026
13 checks passed
@theogravity theogravity deleted the feat/newrelic-align-encoder branch May 12, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant