Tags: go-coldbrew/tracing
Tags
refactor: adopt OTel semconv v1.40.0 for datastore and external spans (… …#23) * refactor: use OTel semconv v1.40.0 for datastore and external spans Datastore spans (NewDatastoreSpan, SetQuery): - store → db.system.name - collection → db.collection.name - operation → db.operation.name - query → db.query.text External spans (buildExternalSpan): - url → url.full - added server.address attribute * docs: regenerate README after semconv update * fix: gate db.query.text behind datastore check, parse server.address from URL - SetQuery: only set db.query.text for datastore spans; use generic "query" attribute for non-datastore spans to avoid semantic mismatch - buildExternalSpan: parse server.address from URL hostname when an absolute URL is provided, instead of always using the name parameter * docs: regenerate README after review fixes
feat: migrate from OpenTracing to native OpenTelemetry APIs (#20) * feat: migrate from OpenTracing to native OpenTelemetry APIs Replace all OpenTracing usage with native OTEL APIs: - tracingSpan.openSpan (opentracing.Span) → otelSpan (trace.Span) - opentracing.StartSpanFromContext → otel.Tracer().Start() - span.SetTag → span.SetAttributes(attribute.String()) - span.SetError tags → span.SetStatus(codes.Error) + RecordError() - opentracing.GlobalTracer().Inject/Extract → otel.GetTextMapPropagator() - metadataReaderWriter → metadataCarrier (propagation.TextMapCarrier) - ClientSpan returns trace.Span instead of opentracing.Span Remove opentracing-go dependency entirely. Add OTEL dependencies: go.opentelemetry.io/otel, trace, attribute, codes, propagation. Public API preserved: Span interface, NewInternalSpan, NewDatastoreSpan, NewExternalSpan, NewHTTPExternalSpan, context helpers all unchanged. NewRelic dual-reporting preserved alongside OTEL spans. * fix: typed OTEL attributes, fix metadata reuse, clean up test - SetTag now preserves value types (int, float64, bool, string) instead of stringifying everything via fmt.Sprint - GRPCTracingSpan: use fresh outgoing metadata instead of reusing inbound metadata for downstream propagation - Remove empty test assertion block - Regenerate README * fix: preserve outgoing metadata, fix test type, update doc.go - GRPCTracingSpan: preserve existing outgoing metadata instead of replacing it, avoiding loss of non-tracing headers (auth, request-id) - Fix test: use http.Header instead of map[string][]string - Update doc.go to describe OTEL (not OpenTracing), regenerate README * fix: guard nil headers in NewHTTPExternalSpan, join metadata values - NewHTTPExternalSpan: skip Inject when hdr is nil to avoid panic - metadataCarrier.Get: join multiple values with comma for W3C baggage/tracestate compatibility
chore: bump Go 1.15→1.25, upgrade newrelic and grpc (#13) * chore: bump Go 1.15→1.25, upgrade newrelic and grpc - Bump go directive to 1.25 - Bump newrelic/go-agent v3.33.0 → v3.40.1 - Bump grpc v1.64.0 → v1.75.0 * fix: use go 1.25 (not 1.25.0) and update CI workflow to Go 1.25 * fix: accept go 1.25.0 in go.mod and upgrade CI actions Go 1.26 toolchain normalizes go directive to 1.25.0; upgrade actions/checkout to v4 and actions/setup-go to v5 so CI installs a Go version that understands this format.
PreviousNext