Skip to content

Comments

feat: add metadata#50

Merged
mfiedorowicz merged 2 commits intodevelopfrom
feat-add-metadata
Nov 19, 2025
Merged

feat: add metadata#50
mfiedorowicz merged 2 commits intodevelopfrom
feat-add-metadata

Conversation

@mfiedorowicz
Copy link
Member

This pull request adds support for attaching custom metadata to ingestion requests and entities in the Diode Go SDK. Users can now provide additional context or tracking information at both the entity and request level, and this metadata is preserved across gRPC, dry run, and OTLP export flows. The documentation and test suite have been updated to demonstrate and verify these new capabilities.

Metadata support and API changes:

  • Added a new WithIngestMetadata option and supporting types to allow passing metadata (as key-value pairs) with Ingest and IngestProto calls in both GRPCClient and DryRunClient. This metadata is attached to the IngestRequest and serialized as a protobuf struct. [1] [2] [3] [4]
  • Updated the client interfaces and implementations to accept variadic options for ingest operations, ensuring backward compatibility. [1] [2]

Documentation improvements:

  • Expanded the README.md with detailed usage examples for entity-level and request-level metadata, including how metadata is handled in dry run and OTLP export scenarios. [1] [2] [3]

Testing enhancements:

  • Added comprehensive tests to verify metadata handling in Ingest, IngestProto, and dry run flows, including tests for various metadata types (primitives, arrays, nested objects, and edge cases). Ensured that metadata is correctly serialized and included in requests. [1] [2]

Internal codebase updates:

  • Imported necessary protobuf packages for struct and JSON serialization to support the new metadata functionality. [1] [2] [3]

These changes make the SDK more flexible and extensible for tracking, auditing, and enriching ingested data with custom attributes.

Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
@mfiedorowicz mfiedorowicz self-assigned this Nov 14, 2025
@github-actions github-actions bot added documentation Improvements or additions to documentation go markdown labels Nov 14, 2025
@github-actions
Copy link

github-actions bot commented Nov 14, 2025

Go test coverage

STATUS ELAPSED PACKAGE COVER PASS FAIL SKIP
🟢 PASS 0.23s github.com/netboxlabs/diode-sdk-go/cmd/diode-replay-dryrun 0.0% 0 0 0
🟢 PASS 1.40s github.com/netboxlabs/diode-sdk-go/diode 20.7% 286 0 0

Total coverage: 76.6%

@mfiedorowicz mfiedorowicz marked this pull request as ready for review November 17, 2025 08:34
Copy link
Contributor

@jajeffries jajeffries left a comment

Choose a reason for hiding this comment

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

Overall looks good, but one minor suggestion about the dry run client

Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
@mfiedorowicz mfiedorowicz merged commit ac2de3a into develop Nov 19, 2025
6 checks passed
@mfiedorowicz mfiedorowicz deleted the feat-add-metadata branch November 19, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation go markdown

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants