Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions go/core/tracing/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ type Data struct {
// SpanData can be passed to json.Marshal, whereas most of the OpenTelemetry
// types make no claims about JSON serializability.
type SpanData struct {
SpanID string `json:"spanId"`
TraceID string `json:"traceId,omitempty"`
ParentSpanID string `json:"parentSpanId,omitempty"`
StartTime Milliseconds `json:"startTime"`
EndTime Milliseconds `json:"endTime"`
Attributes map[string]any `json:"attributes,omitempty"`
DisplayName string `json:"displayName"`
Links []*Link `json:"links,omitempty"`
InstrumentationLibrary InstrumentationLibrary `json:"instrumentationLibrary,omitempty"`
SpanKind string `json:"spanKind"` // trace.SpanKind as a string
SpanID string `json:"spanId"`
TraceID string `json:"traceId,omitempty"`
ParentSpanID string `json:"parentSpanId,omitempty"`
StartTime Milliseconds `json:"startTime"`
EndTime Milliseconds `json:"endTime"`
Attributes map[string]any `json:"attributes,omitempty"`
DisplayName string `json:"displayName"`
Links []*Link `json:"links,omitempty"`
InstrumentationScope InstrumentationScope `json:"instrumentationLibrary,omitempty"` // TODO: update json tag when JS runtime gets updated
SpanKind string `json:"spanKind"` // trace.SpanKind as a string
// This bool is in a separate struct, to match the js (and presumably the OTel) formats.
SameProcessAsParentSpan BoolValue `json:"sameProcessAsParentSpan"`
Status Status `json:"status"`
Expand Down Expand Up @@ -80,9 +80,9 @@ type Link struct {
DroppedAttributesCount int `json:"droppedAttributesCount"`
}

// InstrumentationLibrary is a copy of [go.opentelemetry.io/otel/sdk/instrumentation.Library],
// InstrumentationScope is a copy of [go.opentelemetry.io/otel/sdk/instrumentation.Library],
// with added struct tags to match the javascript JSON field names.
type InstrumentationLibrary struct {
type InstrumentationScope struct {
Name string `json:"name"`
Version string `json:"version"`
SchemaURL string `json:"schemaUrl,omitempty"`
Expand Down
12 changes: 11 additions & 1 deletion go/core/tracing/trace_server_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"strings"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/instrumentation"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
otrace "go.opentelemetry.io/otel/trace"
)
Expand Down Expand Up @@ -102,7 +103,7 @@ func convertSpan(span sdktrace.ReadOnlySpan) *SpanData {
Attributes: attributesToMap(span.Attributes()),
DisplayName: span.Name(),
Links: convertLinks(span.Links()),
InstrumentationLibrary: InstrumentationLibrary(span.InstrumentationLibrary()),
InstrumentationScope: convertScope(span.InstrumentationScope()),
SpanKind: strings.ToUpper(span.SpanKind().String()),
SameProcessAsParentSpan: BoolValue{!sc.IsRemote()},
Status: convertStatus(span.Status()),
Expand All @@ -124,6 +125,15 @@ func attributesToMap(attrs []attribute.KeyValue) map[string]any {
return m
}

// convertScope converts an OpenTelemetry InstrumentationScope to an InstrumentationScope
func convertScope(s instrumentation.Scope) InstrumentationScope {
return InstrumentationScope{
Name: s.Name,
Version: s.Version,
SchemaURL: s.SchemaURL,
}
}

func convertLinks(links []sdktrace.Link) []*Link {
var cls []*Link
for _, l := range links {
Expand Down
4 changes: 2 additions & 2 deletions go/core/tracing/trace_server_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func TestConvertSpan(t *testing.T) {
Code: codes.Ok,
Description: "desc",
},
InstrumentationLibrary: instrumentation.Library{
InstrumentationScope: instrumentation.Scope{
Name: "iname",
Version: "version",
SchemaURL: "surl",
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestConvertSpan(t *testing.T) {
DroppedAttributesCount: 1,
}},
Status: Status{Code: 2, Description: "desc"},
InstrumentationLibrary: InstrumentationLibrary{
InstrumentationScope: InstrumentationScope{
Name: "iname",
Version: "version",
SchemaURL: "surl",
Expand Down
129 changes: 70 additions & 59 deletions go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,101 +8,112 @@ retract (
)

require (
cloud.google.com/go/firestore v1.16.0
cloud.google.com/go/logging v1.11.0
firebase.google.com/go/v4 v4.14.1
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.46.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.22.0
cloud.google.com/go/firestore v1.18.0
cloud.google.com/go/logging v1.13.0
firebase.google.com/go/v4 v4.15.2
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v1.27.0
github.com/anthropics/anthropic-sdk-go v0.2.0-beta.3
github.com/blues/jsonata-go v1.5.4
github.com/google/dotprompt/go v0.0.0-20250415074656-072d95deb01d
github.com/google/dotprompt/go v0.0.0-20250424065700-61c578cf43ac
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/invopop/jsonschema v0.13.0
github.com/jba/slog v0.2.0
github.com/lib/pq v1.10.9
github.com/pgvector/pgvector-go v0.3.0
github.com/weaviate/weaviate v1.26.0-rc.1
github.com/weaviate/weaviate-go-client/v4 v4.15.0
github.com/weaviate/weaviate v1.30.1
github.com/weaviate/weaviate-go-client/v5 v5.1.0
github.com/xeipuuv/gojsonschema v1.2.0
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/metric v1.29.0
go.opentelemetry.io/otel/sdk v1.29.0
go.opentelemetry.io/otel/sdk/metric v1.29.0
go.opentelemetry.io/otel/trace v1.29.0
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81
golang.org/x/tools v0.31.0
google.golang.org/api v0.197.0
google.golang.org/genai v1.1.0
go.opentelemetry.io/otel v1.35.0
go.opentelemetry.io/otel/metric v1.35.0
go.opentelemetry.io/otel/sdk v1.35.0
go.opentelemetry.io/otel/sdk/metric v1.35.0
go.opentelemetry.io/otel/trace v1.35.0
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0
golang.org/x/tools v0.32.0
google.golang.org/api v0.230.0
google.golang.org/genai v1.2.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.9.3 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/iam v1.2.0 // indirect
cloud.google.com/go/longrunning v0.6.0 // indirect
cloud.google.com/go/monitoring v1.21.0 // indirect
cloud.google.com/go/storage v1.43.0 // indirect
cloud.google.com/go/trace v1.11.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.46.0 // indirect
cel.dev/expr v0.23.1 // indirect
cloud.google.com/go v0.120.1 // indirect
cloud.google.com/go/auth v0.16.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.6.0 // indirect
cloud.google.com/go/iam v1.5.2 // indirect
cloud.google.com/go/longrunning v0.6.7 // indirect
cloud.google.com/go/monitoring v1.24.2 // indirect
cloud.google.com/go/storage v1.52.0 // indirect
cloud.google.com/go/trace v1.11.6 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect
github.com/MicahParks/keyfunc v1.9.0 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-jose/go-jose/v4 v4.1.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.21.2 // indirect
github.com/go-openapi/errors v0.22.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/loads v0.21.1 // indirect
github.com/go-openapi/spec v0.20.4 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
github.com/go-openapi/errors v0.22.1 // indirect
github.com/go-openapi/jsonpointer v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/loads v0.22.0 // indirect
github.com/go-openapi/runtime v0.24.2 // indirect
github.com/go-openapi/spec v0.21.0 // indirect
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/validate v0.21.0 // indirect
github.com/go-openapi/swag v0.23.1 // indirect
github.com/go-openapi/validate v0.24.0 // indirect
github.com/goccy/go-yaml v1.17.1 // indirect
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/google/s2a-go v0.1.9 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/mbleigh/raymond v0.0.0-20250414171441-6b3a58ab9e0a // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/time v0.6.0 // indirect
google.golang.org/appengine/v2 v2.0.2 // indirect
google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.2 // indirect
google.golang.org/protobuf v1.34.2 // indirect
github.com/zeebo/errs v1.4.0 // indirect
go.mongodb.org/mongo-driver v1.17.3 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/oauth2 v0.29.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/time v0.11.0 // indirect
google.golang.org/appengine/v2 v2.0.6 // indirect
google.golang.org/genproto v0.0.0-20250422160041-2d3770c4ea7f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250422160041-2d3770c4ea7f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250422160041-2d3770c4ea7f // indirect
google.golang.org/grpc v1.72.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
)
Loading
Loading