feat(adapters): OpenTelemetry + SQL adapter modules#10
Merged
Conversation
Deliver the first production integrations (roadmap B2) as separate modules so the core's stdlib-only module graph is unchanged. - adapters/otel: implements runtime.Observer over OpenTelemetry (spans, counters, histograms; runtime.Attr -> attribute.KeyValue). New(tp, mp) or Default() from the global providers. Verified with an in-memory span recorder (name, attributes, error status) plus noop-provider smoke tests. - adapters/sql: implements store.Store over database/sql with a portable UPDATE-then-INSERT upsert and per-dialect placeholders (SQLite/MySQL/Postgres). The caller supplies the *sql.DB, so the adapter imports no driver. Unit tests cover dialects and validation; the round-trip is env-gated on a real database. - Each adapter is its own module (require isopace v0.3.0 + replace => ../..), so external consumers ignore the replace and the core graph stays stdlib-only. - .github/workflows/adapters.yml builds/vets/tests each module independently. Both modules: gofmt clean, go vet clean, go test -race passing.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
First production integrations toward v1 (roadmap B2), delivered as separate modules so the core's stdlib-only module graph is unchanged (
go list -m allfor the core still shows zero third-party deps).adapters/otel—runtime.Observerover OpenTelemetryStartSpan/End/SetError/SetAttr),Int64Counter,Float64Histogram;runtime.Attr→attribute.KeyValue.New(tracerProvider, meterProvider)orDefault()(global providers).tracetest.SpanRecorder(asserts span name, attributes, and error status) + noop-provider smoke tests.go test -racegreen.adapters/sql—store.Storeoverdatabase/sqlON CONFLICT); per-dialect placeholders viaSQLite/MySQL/PostgresDialects.*sql.DB, so the adapter imports no driver — zero third-party deps in this module.ISOPACE_SQL_DRIVER/_DSN).go testgreen.Module hygiene
require github.com/teqpace-services/isopace v0.3.0+replace => ../... In-repo/CI builds use the working tree; external consumers use the tag. Thereplaceis ignored when the adapter is imported as a dependency..github/workflows/adapters.ymlbuilds/vets/tests each module independently (the root CI's./...does not descend into separate modules — by design, so the core license scan stays stdlib-only).Follow-ups (noted in
ROADMAP-to-v1.md)space(post-v1).