Skip to content

Conversation

@mfiedorowicz
Copy link
Member

This pull request introduces support for attaching request-level metadata to ingestion requests across all Diode client types (DiodeClient, DiodeDryRunClient, and DiodeOTLPClient). The metadata can be used for tracking, auditing, and enriching ingestion batches, and is now documented and supported in both the Python SDK and the README. The implementation includes recursive conversion of Python types to OTLP resource attributes for the OTLP client, and updates to type hints and interfaces.

Request-level metadata support:

  • Added a metadata keyword argument to the ingest method of DiodeClient, DiodeDryRunClient, and DiodeOTLPClient, allowing users to attach arbitrary key-value metadata to an ingestion request. This metadata is included in the request payload or mapped to OTLP resource attributes as appropriate. [1] [2] [3] [4] [5] [6] [7] [8]

  • Implemented recursive type conversion for Python primitives, lists, and dictionaries to OTLP AnyValue and KeyValue types, ensuring metadata is properly serialized for OTLP exports.

  • Updated the DiodeClientInterface protocol and type hints to reflect the new metadata argument and its type. [1] [2] [3]

Documentation updates and examples:

  • Expanded the README.md with detailed sections and code examples for using entity-level and request-level metadata, including for dry run and OTLP clients. Also documented how request-level metadata appears in the output and how it can be used for tracking and auditing. [1] [2] [3]

  • Added a prerequisites section and improved documentation for TLS certificate handling and legacy certificate support. [1] [2]

These changes make it easier to track, correlate, and enrich data ingestion batches throughout the Diode pipeline, and provide clear documentation and examples for users.

Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
…asses

Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
…rious entity types

Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
@github-actions
Copy link

github-actions bot commented Nov 14, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.10.19/x64/lib/python3.10/site-packages/netboxlabs/diode/sdk
   client.py4062195%329, 390, 395, 399, 516–518, 523, 528, 533, 538, 548, 552, 556, 578, 599, 601, 675, 706, 714, 769
   exceptions.py44393%69, 82–83
TOTAL4622495% 

Tests Skipped Failures Errors Time
126 0 💤 0 ❌ 0 🔥 1.308s ⏱️

Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
@mfiedorowicz mfiedorowicz marked this pull request as ready for review November 17, 2025 08:33
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. One minor suggestion, but can go in without it

mfiedorowicz and others added 3 commits November 19, 2025 19:49
Co-authored-by: James Jeffries <jajeffries@users.noreply.github.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
@mfiedorowicz mfiedorowicz merged commit 0b0a3b4 into develop Nov 19, 2025
6 checks passed
@mfiedorowicz mfiedorowicz deleted the feat-add-metadata branch November 19, 2025 18:58
@github-actions
Copy link

🎉 This PR is included in version 1.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants