Repository navigation
Add kernel_telemetry_destination resource - #119
Merged
Merged
Conversation
sjmiller609
marked this pull request as ready for review
October 20, 2026 14:26
yummybomb
approved these changes
Oct 20, 2026
yummybomb
left a comment
There was a problem hiding this comment.
lgtm, the changes look pretty good:
Non Blocking Nits:
- ID-shaped names fail only at apply. The API rejects names matching ^[a-z0-9]{24}$, and the provider has no matching validator.
- Import by name fails after import. The API's GET accepts a name, and Read then fails on the ID mismatch. kernel_project does the same thing, with the same "imported by name, re-import by ID" message.
- 409s get no hint. Rename returns 409 while a managed auth connection selects the destination by name. Delete returns 409 in more cases than I listed: browser sessions still bound to it, a managed auth connection still selecting it, or a managed auth login using it still in progress.
Contributor
Author
|
thanks @yummybomb
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a
kernel_telemetry_destinationresource so the org-level OTLP export destinations that browser sessions send telemetry to can be managed in Terraform alongside projects.name,endpoint, optionaldescription, optional sensitiveheadersmap; computedid. Import by canonical ID.nulls. Re-spelling a header name (authorization→Authorization) does not delete it.consecutive_failures,last_export_at,last_error*) are left out to avoid drift.kernel-go-sdkv0.76.0 → v0.99.0. This is the earliest tag whose telemetry destination API matches the current one. Later tags removeProxyNewParamsTypeDatacenter, which existing tests use.Testing
go test -short ./...,go vet ./..., gofmt,terraform fmt -check,scripts/check-examples.sh,scripts/check-docs.sh, andscripts/check-markdown-links.shall pass locally.TestAccTelemetryDestinationLifecyclepassed against the staging API. It covers: create with headers; update name, endpoint, description and headers with a stable ID; remove all headers; header names verified through the API; no-drift plan; import; destroy with 404 verification.dev_overrides: apply, no-drift plan, a header added out of band was detected and removed on the next apply, import into empty state, destroy.Note
Medium Risk
New resource manages sensitive OTLP headers and org-scoped credentials (403 if API key is project-bound); SDK bump may affect other provider code paths, though existing acceptance passed on staging.
Overview
Adds
kernel_telemetry_destination, a new org-scoped managed resource for OTLP export endpoints (name,endpoint, optionaldescription, sensitiveheaders), with import by canonical ID. Browser sessions can reference these destinations for telemetry export.The provider wires
TelemetryDestinationServicethroughkernelclient, registers the resource, and bumpskernel-go-sdkfrom v0.76.0 to v0.99.0. Header handling is tailored to Kernel’s API: values are never returned, so state keeps configured values while reconciling header names case-insensitively; updates patch only changed headers and send explicitnulls to remove dropped keys.Acceptance CI gains a seventh matrix job for
./internal/resources/telemetrydestination, with cleanup helpers, docs, and an example. Runtime delivery-health fields are intentionally omitted to avoid drift.Reviewed by Cursor Bugbot for commit a99e4bf. Bugbot is set up for automated code reviews on this repo. Configure here.