Skip to content

Conversation

@leoparente
Copy link
Contributor

@leoparente leoparente commented Oct 22, 2025

This pull request introduces a new OTLP (OpenTelemetry Protocol) client to the Diode SDK, allowing ingestion entities to be exported as OTLP log records to a gRPC endpoint. This addition is accompanied by updates to documentation, dependency management, and comprehensive tests to ensure correct behavior and error handling.

Key changes:

OTLP Client Implementation

  • Added a new DiodeOTLPClient class in client.py that serializes ingestion entities as OpenTelemetry log records and exports them to an OTLP endpoint over gRPC. This client supports TLS configuration and raises a custom OTLPClientError on export failure. ([netboxlabs/diode/sdk/client.pyR416-R644](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-d7321aa83f5274dadf12aeab1b43eecc71c8e76d32add37792a05e76eac5e280R416-R644))
  • Introduced the OTLPClientError exception in exceptions.py to provide detailed error reporting when OTLP exports fail. ([netboxlabs/diode/sdk/exceptions.pyR48-R86](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-6c7ac0ab905078101cf9319b9fa2183bd3111b865c494028e6296bc99e690a4aR48-R86))

SDK and Dependency Updates

  • Exposed DiodeOTLPClient in the SDK’s public interface (__init__.py) and added opentelemetry-proto as a required dependency in pyproject.toml. ([[1]](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-20a572f336e16fca0b78ac87298b492fcfc0b33695083181de78b801a555dba7R8-R14), [[2]](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R31))

Documentation

  • Updated README.md with a usage example and description for the new OTLP client, including details about serialization, metadata, and TLS behavior. ([README.mdR152-R168](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R152-R168))

Testing

  • Added unit tests for DiodeOTLPClient to verify successful export, error handling, and secure channel setup in test_client.py. ([tests/test_client.pyR749-R847](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-0d92063e88430a02df61616c5f16b148b64ac4539d9cb9b8d883d5a23351b110R749-R847))
  • Updated test imports to include the new client and exception. ([[1]](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-0d92063e88430a02df61616c5f16b148b64ac4539d9cb9b8d883d5a23351b110R19), [[2]](https://github.com/netboxlabs/diode-sdk-python/pull/68/files#diff-0d92063e88430a02df61616c5f16b148b64ac4539d9cb9b8d883d5a23351b110L27-R32))

@github-actions
Copy link

github-actions bot commented Oct 22, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.10.18/x64/lib/python3.10/site-packages/netboxlabs/diode/sdk
   client.py3601895%321, 382, 387, 391, 503–505, 510, 515, 520, 525, 535, 539, 543, 563, 584, 586, 700
   exceptions.py44393%69, 82–83
TOTAL4162195% 

Tests Skipped Failures Errors Time
112 0 💤 0 ❌ 0 🔥 1.624s ⏱️

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Oct 23, 2025
@leoparente leoparente changed the title feat: add Diode QueueClient feat: add Diode OTLPClient Oct 23, 2025
@leoparente leoparente changed the title feat: add Diode OTLPClient feat: add DiodeOTLPClient Oct 24, 2025
@leoparente leoparente marked this pull request as ready for review October 27, 2025 18:03
Copy link
Member

@mfiedorowicz mfiedorowicz left a comment

Choose a reason for hiding this comment

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

🚀

@leoparente leoparente merged commit b349ee4 into develop Oct 30, 2025
6 checks passed
@leoparente leoparente deleted the feat/OBS-1555-diode-queue-client branch October 30, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file markdown python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants