feat: add metadata #69
Draft
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.
This pull request introduces support for attaching request-level metadata to ingestion requests across all Diode client types (
DiodeClient,DiodeDryRunClient, andDiodeOTLPClient). 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
metadatakeyword argument to theingestmethod ofDiodeClient,DiodeDryRunClient, andDiodeOTLPClient, 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
AnyValueandKeyValuetypes, ensuring metadata is properly serialized for OTLP exports.Updated the
DiodeClientInterfaceprotocol and type hints to reflect the newmetadataargument and its type. [1] [2] [3]Documentation updates and examples:
Expanded the
README.mdwith 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.