Skip to content

feat(OBS-2873): add gRPC client keepalive configuration#90

Merged
jajeffries merged 4 commits into
developfrom
feat/OBS-2873-grpc-timeouts
May 15, 2026
Merged

feat(OBS-2873): add gRPC client keepalive configuration#90
jajeffries merged 4 commits into
developfrom
feat/OBS-2873-grpc-timeouts

Conversation

@jajeffries
Copy link
Copy Markdown
Contributor

@jajeffries jajeffries commented May 13, 2026

Summary

This change adds HTTP/2 keepalive channel options for DiodeClient (ingester) so idle connections to the Diode API are less likely to be reset by intermediaries.

DiodeOTLPClient targets arbitrary OTLP collectors and therefore uses user-agent-only gRPC channel options (no keepalive / max_pings_without_data): many collectors enforce strict ping limits and can GOAWAY idle exporters otherwise.

What changed

  • _diode_ingest_grpc_channel_options: grpc.primary_user_agent plus grpc.keepalive_time_ms, grpc.keepalive_timeout_ms, grpc.keepalive_permit_without_calls, and grpc.http2.max_pings_without_data (parity with netbox-assurance-plugin reconciler client where that stack talks to Diode-tolerant servers, ENGHLP-1220).
  • _otlp_grpc_channel_options: grpc.primary_user_agent only for OTLP.
  • DiodeClient uses the ingester helper; DiodeOTLPClient uses the OTLP helper; proxy and SSL-related options are unchanged.
  • Tests cover ingester options via _diode_ingest_grpc_channel_options and assert OTLP channels exclude keepalive.

How tested

  • pytest (full suite).

Extend shared channel options with keepalive time/timeout, permit pings
without calls, and max_pings_without_data parity with netbox-assurance-plugin.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jajeffries
Copy link
Copy Markdown
Contributor Author

@codex review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/netboxlabs/diode/sdk
   chunking.py33197%112
   client.py5173693%197–198, 217–219, 222–225, 511, 577, 582, 586, 669–674, 719–721, 751, 755, 759, 781, 802, 804, 878, 909, 917, 959, 995, 1010–1011, 1018–1019
   exceptions.py44393%69, 82–83
TOTAL6094093% 

Tests Skipped Failures Errors Time
186 0 💤 0 ❌ 0 🔥 2.784s ⏱️

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b23457faf1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread netboxlabs/diode/sdk/client.py Outdated
Codex/Copilot review: OTLP exporters target arbitrary collectors; aggressive
HTTP/2 keepalive can provoke GOAWAY on idle connections. Restrict keepalive
plus max_pings_without_data to DiodeClient only; OTLP keeps user-agent-only
options plus existing proxy/ssl behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jajeffries jajeffries marked this pull request as ready for review May 13, 2026 12:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e0a8d4732

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread netboxlabs/diode/sdk/client.py Outdated
Comment thread tests/test_client.py Outdated
Reformat OTLP/ingester helper docstrings for D213/D403 and reorder
test_client imports for I001.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread netboxlabs/diode/sdk/client.py Outdated
Co-authored-by: Micah Parks <66095735+MicahParks@users.noreply.github.com>
@jajeffries jajeffries merged commit 4ef357e into develop May 15, 2026
6 checks passed
@jajeffries jajeffries deleted the feat/OBS-2873-grpc-timeouts branch May 15, 2026 08:20
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.12.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.

2 participants