diff --git a/Dockerfile b/Dockerfile index 4cac326a3..9f4006dac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ FROM --platform=$BUILDPLATFORM golang:1.23.4-bookworm@sha256:2e838582004fab0931 RUN apt-get update && apt-get install -y curl clang gcc llvm make libbpf-dev +ARG GOPROXY +ENV GOPROXY=$GOPROXY + WORKDIR /app # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading diff --git a/Makefile b/Makefile index 69f328b2c..49ad698f2 100644 --- a/Makefile +++ b/Makefile @@ -159,7 +159,7 @@ license-header-check: exit 1; \ fi -.PHONY: fixture-nethttp fixture-gin fixture-databasesql fixture-nethttp-custom fixture-otelglobal fixture-autosdk fixture-kafka-go +.PHONY: fixture-nethttp fixture-gin fixture-databasesql fixture-nethttp-custom fixture-otelglobal fixture-autosdk fixture-kafka-go fixture-rueidis fixture-nethttp-custom: fixtures/nethttp_custom fixture-nethttp: fixtures/nethttp fixture-gin: fixtures/gin @@ -168,6 +168,7 @@ fixture-grpc: fixtures/grpc fixture-otelglobal: fixtures/otelglobal fixture-autosdk: fixtures/autosdk fixture-kafka-go: fixtures/kafka-go +fixture-rueidis: fixtures/rueidis fixtures/%: LIBRARY=$* fixtures/%: $(MAKE) docker-build diff --git a/examples/httpPlusdb/docker-compose.yaml b/examples/httpPlusdb/docker-compose.yaml index 2a99d3847..cc0aaed6c 100644 --- a/examples/httpPlusdb/docker-compose.yaml +++ b/examples/httpPlusdb/docker-compose.yaml @@ -10,6 +10,7 @@ services: depends_on: - jaeger build: + no_cache: true context: . dockerfile: ./Dockerfile pid: "host" diff --git a/examples/rueidis/Dockerfile b/examples/rueidis/Dockerfile new file mode 100644 index 000000000..19c4beb20 --- /dev/null +++ b/examples/rueidis/Dockerfile @@ -0,0 +1,7 @@ +FROM golang:1.23.4@sha256:7ea4c9dcb2b97ff8ee80a67db3d44f98c8ffa0d191399197007d8459c1453041 +WORKDIR /app +COPY ./*.go . +RUN go mod init main +RUN go mod tidy +RUN go build -o main +ENTRYPOINT ["/app/main"] diff --git a/examples/rueidis/README.md b/examples/rueidis/README.md new file mode 100644 index 000000000..d67e251f2 --- /dev/null +++ b/examples/rueidis/README.md @@ -0,0 +1,20 @@ +# Example of Auto instrumentation of HTTP server + +Server exposes an endpoint `/do.` When we hit the endpoint, it sets a random value for `test_key` in redis and then +retrieves it using rueidis client. + +For testing auto instrumentation, we can use the docker compose. + +To run the example, bring up the services using the command. + +``` +docker compose up --build +``` + +Now, you can hit roll dice server using the below command +``` +curl localhost:8081/do +``` +Every hit to the server should generate a trace that we can observe in [Jaeger UI](http://localhost:16686/) + +Example trace ![Image](jaeger.png) diff --git a/examples/rueidis/docker-compose.yaml b/examples/rueidis/docker-compose.yaml new file mode 100644 index 000000000..b52247ed0 --- /dev/null +++ b/examples/rueidis/docker-compose.yaml @@ -0,0 +1,52 @@ +networks: + default: + name: rueidis + driver: bridge + +services: + redis: + image: redis:7.2 + + app: + depends_on: + - jaeger + - redis + build: + context: . + dockerfile: ./Dockerfile + pid: "host" + ports: + - "8081:8081" + volumes: + - /proc:/host/proc + + go-auto: + depends_on: + - app + build: + context: ../.. + dockerfile: Dockerfile + privileged: true + pid: "host" + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318 + - OTEL_GO_AUTO_TARGET_EXE=/app/main + - OTEL_SERVICE_NAME=rueidis-app + - OTEL_PROPAGATORS=tracecontext,baggage + volumes: + - /proc:/host/proc + + jaeger: + image: jaegertracing/all-in-one:1.60@sha256:4fd2d70fa347d6a47e79fcb06b1c177e6079f92cba88b083153d56263082135e + ports: + - "16686:16686" + - "14268:14268" + environment: + - COLLECTOR_OTLP_ENABLED=true + - LOG_LEVEL=debug + - JAEGER_DISABLED=true + deploy: + resources: + limits: + memory: 300M + restart: unless-stopped diff --git a/examples/rueidis/go.mod b/examples/rueidis/go.mod new file mode 100644 index 000000000..8bb5c96db --- /dev/null +++ b/examples/rueidis/go.mod @@ -0,0 +1,7 @@ +module go.opentelemetry.io/auto/examples/rueidis + +go 1.23 + +require github.com/redis/rueidis v1.0.52 + +require golang.org/x/sys v0.24.0 // indirect diff --git a/examples/rueidis/go.sum b/examples/rueidis/go.sum new file mode 100644 index 000000000..9d3aefc5c --- /dev/null +++ b/examples/rueidis/go.sum @@ -0,0 +1,16 @@ +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= +github.com/redis/rueidis v1.0.52 h1:VFlucmx/QHzGD7FYlK8l+W/HYz4aK+2eIOrCVjDwwag= +github.com/redis/rueidis v1.0.52/go.mod h1:by+34b0cFXndxtYmPAHpoTHO5NkosDlBvhexoTURIxM= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/rueidis/jaeger.png b/examples/rueidis/jaeger.png new file mode 100644 index 000000000..c4af6d162 Binary files /dev/null and b/examples/rueidis/jaeger.png differ diff --git a/examples/rueidis/main.go b/examples/rueidis/main.go new file mode 100644 index 000000000..d8df87bbd --- /dev/null +++ b/examples/rueidis/main.go @@ -0,0 +1,75 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 +package main + +import ( + "context" + "encoding/json" + "fmt" + "log" + "math/rand" + "net/http" + + "github.com/redis/rueidis" +) + +const testKey = "test_key" + +type server struct { + client rueidis.Client +} + +func (s *server) Do(w http.ResponseWriter, req *http.Request) { + randomValue := fmt.Sprintf("random_value_%d", rand.Intn(1000)) + err := setKey(req.Context(), s.client, testKey, randomValue) + if err != nil { + fmt.Println(fmt.Errorf("failed to set key: %v", err)) + } + fmt.Printf("Set key '%s' with value: %s\n", testKey, randomValue) + + value, err := getKey(req.Context(), s.client, testKey) + if err != nil { + fmt.Println(fmt.Errorf("failed to get key: %v", err)) + } + fmt.Printf("Got value for key '%s': %s\n", testKey, value) + + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + _ = json.NewEncoder(w).Encode(map[string]string{"value": value}) +} + +func main() { + address := "redis:6379" + fmt.Println("Connecting to redis server...") + fmt.Println(address) + + client, err := rueidis.NewClient(rueidis.ClientOption{ + InitAddress: []string{address}, + SelectDB: 0, + }) + if err != nil { + log.Fatalf("Failed to create Redis client: %v", err) + } + defer client.Close() + + s := &server{client: client} + + http.HandleFunc("/do", s.Do) + port := ":8081" + fmt.Printf("Server starting on port %s\n", port) + log.Fatal(http.ListenAndServe(port, nil)) +} + +func setKey(ctx context.Context, client rueidis.Client, key, value string) error { + cmd := client.B().Set().Key(key).Value(value).Build() + return client.Do(ctx, cmd).Error() +} + +func getKey(ctx context.Context, client rueidis.Client, key string) (string, error) { + cmd := client.B().Get().Key(key).Build() + result := client.Do(ctx, cmd) + if result.Error() != nil { + return "", result.Error() + } + return result.ToString() +} diff --git a/internal/pkg/inject/offset_results.json b/internal/pkg/inject/offset_results.json index 608c44886..1e34d6ea0 100644 --- a/internal/pkg/inject/offset_results.json +++ b/internal/pkg/inject/offset_results.json @@ -1,4 +1,1087 @@ [ + { + "module": "github.com/redis/rueidis", + "packages": [ + { + "package": "github.com/redis/rueidis", + "structs": [ + { + "struct": "RedisResult", + "fields": [ + { + "field": "err", + "offsets": [ + { + "offset": null, + "versions": [ + "0.0.1", + "0.0.2", + "0.0.3", + "0.0.4", + "0.0.5", + "0.0.6", + "0.0.7", + "0.0.8", + "0.0.9", + "0.0.10", + "0.0.11", + "0.0.12", + "0.0.13", + "0.0.14", + "0.0.15", + "0.0.16", + "0.0.17", + "0.0.18", + "0.0.19", + "0.0.20", + "0.0.21", + "0.0.22", + "0.0.23", + "0.0.24", + "0.0.25", + "0.0.26", + "0.0.27", + "0.0.28", + "0.0.29", + "0.0.30", + "0.0.31", + "0.0.32", + "0.0.33", + "0.0.34", + "0.0.35", + "0.0.36", + "0.0.37", + "0.0.38", + "0.0.39", + "0.0.40", + "0.0.41", + "0.0.42", + "0.0.43", + "0.0.44", + "0.0.45", + "0.0.46", + "0.0.47", + "0.0.48", + "0.0.49", + "0.0.50", + "0.0.51", + "0.0.52", + "0.0.53", + "0.0.54", + "0.0.55", + "0.0.56", + "0.0.57", + "0.0.58", + "0.0.59", + "0.0.60", + "0.0.61", + "0.0.62", + "0.0.63", + "0.0.64", + "0.0.65", + "0.0.66", + "0.0.67", + "0.0.68", + "0.0.69", + "0.0.70", + "0.0.71", + "0.0.72", + "0.0.73", + "0.0.74", + "0.0.75", + "0.0.76", + "0.0.77", + "0.0.78", + "0.0.79", + "0.0.80", + "0.0.81", + "0.0.82", + "0.0.83", + "0.0.84", + "0.0.85", + "0.0.86", + "0.0.87", + "0.0.88", + "0.0.89", + "0.0.90", + "0.0.91", + "0.0.92", + "0.0.93", + "0.0.94", + "0.0.95", + "0.0.96", + "0.0.97", + "0.0.98", + "0.0.99-go1.18", + "0.0.99", + "0.0.100-go1.18", + "0.0.100", + "1.0.0-go1.18", + "1.0.0", + "1.0.1-go1.18", + "1.0.1", + "1.0.2-go1.18", + "1.0.2", + "1.0.3-go1.18", + "1.0.3", + "1.0.4-go1.18", + "1.0.4", + "1.0.5-go1.18", + "1.0.5", + "1.0.6-go1.18", + "1.0.6-go1.19", + "1.0.6", + "1.0.7-go1.18", + "1.0.7-go1.19", + "1.0.7", + "1.0.8-go1.18", + "1.0.8-go1.19", + "1.0.8", + "1.0.9-go1.18", + "1.0.9-go1.19", + "1.0.9" + ] + }, + { + "offset": 0, + "versions": [ + "1.0.10-go1.18", + "1.0.10-go1.19", + "1.0.10", + "1.0.11-go1.18", + "1.0.11-go1.19", + "1.0.11", + "1.0.12-go1.18", + "1.0.12-go1.19", + "1.0.12", + "1.0.13-go1.18", + "1.0.13-go1.19", + "1.0.13", + "1.0.14-go1.18", + "1.0.14-go1.19", + "1.0.14", + "1.0.15-go1.18", + "1.0.15-go1.19", + "1.0.15", + "1.0.16-go1.18", + "1.0.16-go1.19", + "1.0.16", + "1.0.17-go1.18", + "1.0.17-go1.19", + "1.0.17", + "1.0.18-go1.18", + "1.0.18-go1.19", + "1.0.18", + "1.0.19-go1.18", + "1.0.19-go1.19", + "1.0.19", + "1.0.20-go1.18", + "1.0.20-go1.19", + "1.0.20-pre.1", + "1.0.20-pre.2", + "1.0.20-pre.3", + "1.0.20-pre.4", + "1.0.20-pre.5", + "1.0.20", + "1.0.21-go1.18", + "1.0.21-go1.19", + "1.0.21", + "1.0.22-go1.18", + "1.0.22-go1.19", + "1.0.22-go119", + "1.0.22", + "1.0.23-go1.18", + "1.0.23-go1.19", + "1.0.23", + "1.0.24-go1.18", + "1.0.24-go1.19", + "1.0.24", + "1.0.25-go1.18", + "1.0.25-go1.19", + "1.0.25", + "1.0.26-debug438", + "1.0.26-go1.18", + "1.0.26-go1.19", + "1.0.26", + "1.0.27-go1.18", + "1.0.27-go1.19", + "1.0.27", + "1.0.28-pre", + "1.0.28-pre2", + "1.0.28-pre3", + "1.0.28-pre4", + "1.0.28-pre5", + "1.0.28", + "1.0.29", + "1.0.30", + "1.0.31-cap", + "1.0.31", + "1.0.32", + "1.0.33", + "1.0.34", + "1.0.35-dev1", + "1.0.35", + "1.0.36", + "1.0.37", + "1.0.38", + "1.0.39", + "1.0.40-alpha", + "1.0.40", + "1.0.41", + "1.0.42-alpha", + "1.0.42-alpha.2", + "1.0.42", + "1.0.43", + "1.0.44-alpha.1", + "1.0.44", + "1.0.45-alpha.1", + "1.0.45-alpha.2", + "1.0.45-alpha.3", + "1.0.45", + "1.0.46-alpha.1", + "1.0.46-alpha.2", + "1.0.46", + "1.0.47-alpha.1", + "1.0.47-alpha.2", + "1.0.47", + "1.0.48-alpha.1", + "1.0.48", + "1.0.49-alpha.1", + "1.0.49-alpha.2", + "1.0.49-alpha.3", + "1.0.49", + "1.0.50-alpha.1", + "1.0.50-alpha.2", + "1.0.50-alpha.3", + "1.0.50-alpha.4", + "1.0.50-alpha.5", + "1.0.50-alpha.6", + "1.0.50", + "1.0.51-alpha.1", + "1.0.51-debug.1", + "1.0.51", + "1.0.52-alpha.1", + "1.0.52-alpha.2", + "1.0.52-alpha.3", + "1.0.52", + "1.0.53-alpha.1", + "1.0.53" + ] + } + ] + } + ] + }, + { + "struct": "pipe", + "fields": [ + { + "field": "conn", + "offsets": [ + { + "offset": null, + "versions": [ + "0.0.1", + "0.0.2", + "0.0.3", + "0.0.4", + "0.0.5", + "0.0.6", + "0.0.7", + "0.0.8", + "0.0.9", + "0.0.10", + "0.0.11", + "0.0.12", + "0.0.13", + "0.0.14", + "0.0.15", + "0.0.16", + "0.0.17", + "0.0.18", + "0.0.19", + "0.0.20", + "0.0.21", + "0.0.22", + "0.0.23", + "0.0.24", + "0.0.25", + "0.0.26", + "0.0.27", + "0.0.28", + "0.0.29", + "0.0.30", + "0.0.31", + "0.0.32", + "0.0.33", + "0.0.34", + "0.0.35", + "0.0.36", + "0.0.37", + "0.0.38", + "0.0.39", + "0.0.40", + "0.0.41", + "0.0.42", + "0.0.43", + "0.0.44", + "0.0.45", + "0.0.46", + "0.0.47", + "0.0.48", + "0.0.49", + "0.0.50", + "0.0.51", + "0.0.52", + "0.0.53", + "0.0.54", + "0.0.55", + "0.0.56", + "0.0.57", + "0.0.58", + "0.0.59", + "0.0.60", + "0.0.61", + "0.0.62", + "0.0.63", + "0.0.64", + "0.0.65", + "0.0.66", + "0.0.67", + "0.0.68", + "0.0.69", + "0.0.70", + "0.0.71", + "0.0.72", + "0.0.73", + "0.0.74", + "0.0.75", + "0.0.76", + "0.0.77", + "0.0.78", + "0.0.79", + "0.0.80", + "0.0.81", + "0.0.82", + "0.0.83", + "0.0.84", + "0.0.85", + "0.0.86", + "0.0.87", + "0.0.88", + "0.0.89", + "0.0.90", + "0.0.91", + "0.0.92", + "0.0.93", + "0.0.94", + "0.0.95", + "0.0.96", + "0.0.97", + "0.0.98", + "0.0.99-go1.18", + "0.0.99", + "0.0.100-go1.18", + "0.0.100", + "1.0.0-go1.18", + "1.0.0", + "1.0.1-go1.18", + "1.0.1", + "1.0.2-go1.18", + "1.0.2", + "1.0.3-go1.18", + "1.0.3", + "1.0.4-go1.18", + "1.0.4", + "1.0.5-go1.18", + "1.0.5", + "1.0.6-go1.18", + "1.0.6-go1.19", + "1.0.6", + "1.0.7-go1.18", + "1.0.7-go1.19", + "1.0.7", + "1.0.8-go1.18", + "1.0.8-go1.19", + "1.0.8", + "1.0.9-go1.18", + "1.0.9-go1.19", + "1.0.9", + "1.0.10-go1.18", + "1.0.10-go1.19", + "1.0.10", + "1.0.11-go1.18", + "1.0.11-go1.19", + "1.0.11", + "1.0.12-go1.18", + "1.0.12-go1.19", + "1.0.12", + "1.0.13-go1.18", + "1.0.13-go1.19", + "1.0.13", + "1.0.14-go1.18", + "1.0.14-go1.19", + "1.0.14", + "1.0.15-go1.18", + "1.0.15-go1.19", + "1.0.15", + "1.0.16-go1.18", + "1.0.16-go1.19", + "1.0.16", + "1.0.17-go1.18", + "1.0.17-go1.19", + "1.0.17", + "1.0.18-go1.18", + "1.0.18-go1.19", + "1.0.18", + "1.0.19-go1.18", + "1.0.19-go1.19", + "1.0.19", + "1.0.20-go1.18", + "1.0.20-go1.19", + "1.0.20-pre.1", + "1.0.20-pre.2", + "1.0.20-pre.3", + "1.0.20-pre.4", + "1.0.20-pre.5", + "1.0.20", + "1.0.21-go1.18", + "1.0.21-go1.19", + "1.0.21", + "1.0.22-go1.18", + "1.0.22-go1.19", + "1.0.22-go119", + "1.0.22", + "1.0.23-go1.18", + "1.0.23-go1.19", + "1.0.23", + "1.0.24-go1.18", + "1.0.24-go1.19", + "1.0.24", + "1.0.25-go1.18", + "1.0.25-go1.19", + "1.0.25", + "1.0.26-debug438", + "1.0.26-go1.18", + "1.0.26-go1.19", + "1.0.26", + "1.0.27-go1.18", + "1.0.27-go1.19", + "1.0.27", + "1.0.28-pre", + "1.0.28-pre2", + "1.0.28-pre3", + "1.0.28-pre4", + "1.0.28-pre5", + "1.0.28" + ] + }, + { + "offset": 0, + "versions": [ + "1.0.29", + "1.0.30", + "1.0.31-cap", + "1.0.31", + "1.0.32", + "1.0.33", + "1.0.34", + "1.0.35-dev1", + "1.0.35", + "1.0.36", + "1.0.37", + "1.0.38", + "1.0.39", + "1.0.40-alpha", + "1.0.40", + "1.0.41", + "1.0.42-alpha", + "1.0.42-alpha.2", + "1.0.42", + "1.0.43", + "1.0.44-alpha.1", + "1.0.44", + "1.0.45-alpha.1", + "1.0.45-alpha.2", + "1.0.45-alpha.3", + "1.0.45", + "1.0.46-alpha.1", + "1.0.46-alpha.2", + "1.0.46", + "1.0.47-alpha.1", + "1.0.47-alpha.2", + "1.0.47", + "1.0.48-alpha.1", + "1.0.48", + "1.0.49-alpha.1", + "1.0.49-alpha.2", + "1.0.49-alpha.3", + "1.0.49", + "1.0.50-alpha.1", + "1.0.50-alpha.2", + "1.0.50-alpha.3", + "1.0.50-alpha.4", + "1.0.50-alpha.5", + "1.0.50-alpha.6", + "1.0.50", + "1.0.51-alpha.1", + "1.0.51-debug.1", + "1.0.51", + "1.0.52-alpha.1", + "1.0.52-alpha.2", + "1.0.52-alpha.3", + "1.0.52", + "1.0.53-alpha.1", + "1.0.53" + ] + } + ] + } + ] + } + ] + }, + { + "package": "github.com/redis/rueidis/internal/cmds", + "structs": [ + { + "struct": "CommandSlice", + "fields": [ + { + "field": "s", + "offsets": [ + { + "offset": null, + "versions": [ + "0.0.1", + "0.0.2", + "0.0.3", + "0.0.4", + "0.0.5", + "0.0.6", + "0.0.7", + "0.0.8", + "0.0.9", + "0.0.10", + "0.0.11", + "0.0.12", + "0.0.13", + "0.0.14", + "0.0.15", + "0.0.16", + "0.0.17", + "0.0.18", + "0.0.19", + "0.0.20", + "0.0.21", + "0.0.22", + "0.0.23", + "0.0.24", + "0.0.25", + "0.0.26", + "0.0.27", + "0.0.28", + "0.0.29", + "0.0.30", + "0.0.31", + "0.0.32", + "0.0.33", + "0.0.34", + "0.0.35", + "0.0.36", + "0.0.37", + "0.0.38", + "0.0.39", + "0.0.40", + "0.0.41", + "0.0.42", + "0.0.43", + "0.0.44", + "0.0.45", + "0.0.46", + "0.0.47", + "0.0.48", + "0.0.49", + "0.0.50", + "0.0.51", + "0.0.52", + "0.0.53", + "0.0.54", + "0.0.55", + "0.0.56", + "0.0.57", + "0.0.58", + "0.0.59", + "0.0.60", + "0.0.61", + "0.0.62", + "0.0.63", + "0.0.64", + "0.0.65", + "0.0.66", + "0.0.67", + "0.0.68", + "0.0.69", + "0.0.70", + "0.0.71", + "0.0.72", + "0.0.73", + "0.0.74", + "0.0.75", + "0.0.76", + "0.0.77", + "0.0.78", + "0.0.79", + "0.0.80", + "0.0.81", + "0.0.82", + "0.0.83", + "0.0.84", + "0.0.85", + "0.0.86", + "0.0.87", + "0.0.88", + "0.0.89", + "0.0.90", + "0.0.91", + "0.0.92", + "0.0.93", + "0.0.94", + "0.0.95", + "0.0.96", + "0.0.97", + "0.0.98", + "0.0.99-go1.18", + "0.0.99", + "0.0.100-go1.18", + "0.0.100", + "1.0.5", + "1.0.6-go1.18", + "1.0.6-go1.19", + "1.0.6", + "1.0.7-go1.18", + "1.0.7-go1.19", + "1.0.7", + "1.0.8-go1.18", + "1.0.8-go1.19", + "1.0.8", + "1.0.9-go1.18" + ] + }, + { + "offset": 0, + "versions": [ + "1.0.0-go1.18", + "1.0.0", + "1.0.1-go1.18", + "1.0.1", + "1.0.2-go1.18", + "1.0.2", + "1.0.3-go1.18", + "1.0.3", + "1.0.4-go1.18", + "1.0.4", + "1.0.5-go1.18", + "1.0.9-go1.19", + "1.0.9", + "1.0.10-go1.18", + "1.0.10-go1.19", + "1.0.10", + "1.0.11-go1.18", + "1.0.11-go1.19", + "1.0.11", + "1.0.12-go1.18", + "1.0.12-go1.19", + "1.0.12", + "1.0.13-go1.18", + "1.0.13-go1.19", + "1.0.13", + "1.0.14-go1.18", + "1.0.14-go1.19", + "1.0.14", + "1.0.15-go1.18", + "1.0.15-go1.19", + "1.0.15", + "1.0.16-go1.18", + "1.0.16-go1.19", + "1.0.16", + "1.0.17-go1.18", + "1.0.17-go1.19", + "1.0.17", + "1.0.18-go1.18", + "1.0.18-go1.19", + "1.0.18", + "1.0.19-go1.18", + "1.0.19-go1.19", + "1.0.19", + "1.0.20-go1.18", + "1.0.20-go1.19", + "1.0.20-pre.1", + "1.0.20-pre.2", + "1.0.20-pre.3", + "1.0.20-pre.4", + "1.0.20-pre.5", + "1.0.20", + "1.0.21-go1.18", + "1.0.21-go1.19", + "1.0.21", + "1.0.22-go1.18", + "1.0.22-go1.19", + "1.0.22-go119", + "1.0.22", + "1.0.23-go1.18", + "1.0.23-go1.19", + "1.0.23", + "1.0.24-go1.18", + "1.0.24-go1.19", + "1.0.24", + "1.0.25-go1.18", + "1.0.25-go1.19", + "1.0.25", + "1.0.26-debug438", + "1.0.26-go1.18", + "1.0.26-go1.19", + "1.0.26", + "1.0.27-go1.18", + "1.0.27-go1.19", + "1.0.27", + "1.0.28-pre", + "1.0.28-pre2", + "1.0.28-pre3", + "1.0.28-pre4", + "1.0.28-pre5", + "1.0.28", + "1.0.29", + "1.0.30", + "1.0.31-cap", + "1.0.31", + "1.0.32", + "1.0.33", + "1.0.34", + "1.0.35-dev1", + "1.0.35", + "1.0.36", + "1.0.37", + "1.0.38", + "1.0.39", + "1.0.40-alpha", + "1.0.40", + "1.0.41", + "1.0.42-alpha", + "1.0.42-alpha.2", + "1.0.42", + "1.0.43", + "1.0.44-alpha.1", + "1.0.44", + "1.0.45-alpha.1", + "1.0.45-alpha.2", + "1.0.45-alpha.3", + "1.0.45", + "1.0.46-alpha.1", + "1.0.46-alpha.2", + "1.0.46", + "1.0.47-alpha.1", + "1.0.47-alpha.2", + "1.0.47", + "1.0.48-alpha.1", + "1.0.48", + "1.0.49-alpha.1", + "1.0.49-alpha.2", + "1.0.49-alpha.3", + "1.0.49", + "1.0.50-alpha.1", + "1.0.50-alpha.2", + "1.0.50-alpha.3", + "1.0.50-alpha.4", + "1.0.50-alpha.5", + "1.0.50-alpha.6", + "1.0.50", + "1.0.51-alpha.1", + "1.0.51-debug.1", + "1.0.51", + "1.0.52-alpha.1", + "1.0.52-alpha.2", + "1.0.52-alpha.3", + "1.0.52", + "1.0.53-alpha.1", + "1.0.53" + ] + } + ] + } + ] + }, + { + "struct": "Completed", + "fields": [ + { + "field": "cs", + "offsets": [ + { + "offset": null, + "versions": [ + "0.0.1", + "0.0.2", + "0.0.3", + "0.0.4", + "0.0.5", + "0.0.6", + "0.0.7", + "0.0.8", + "0.0.9", + "0.0.10", + "0.0.11", + "0.0.12", + "0.0.13", + "0.0.14", + "0.0.15", + "0.0.16", + "0.0.17", + "0.0.18", + "0.0.19", + "0.0.20", + "0.0.21", + "0.0.22", + "0.0.23", + "0.0.24", + "0.0.25", + "0.0.26", + "0.0.27", + "0.0.28", + "0.0.29", + "0.0.30", + "0.0.31", + "0.0.32", + "0.0.33", + "0.0.34", + "0.0.35", + "0.0.36", + "0.0.37", + "0.0.38", + "0.0.39", + "0.0.40", + "0.0.41", + "0.0.42", + "0.0.43", + "0.0.44", + "0.0.45", + "0.0.46", + "0.0.47", + "0.0.48", + "0.0.49", + "0.0.50", + "0.0.51", + "0.0.52", + "0.0.53", + "0.0.54", + "0.0.55", + "0.0.56", + "0.0.57", + "0.0.58", + "0.0.59", + "0.0.60", + "0.0.61", + "0.0.62", + "0.0.63", + "0.0.64", + "0.0.65", + "0.0.66", + "0.0.67", + "0.0.68", + "0.0.69", + "0.0.70", + "0.0.71", + "0.0.72", + "0.0.73", + "0.0.74", + "0.0.75", + "0.0.76", + "0.0.77", + "0.0.78", + "0.0.79", + "0.0.80", + "0.0.81", + "0.0.82", + "0.0.83", + "0.0.84", + "0.0.85", + "0.0.86", + "0.0.87", + "0.0.88", + "0.0.89", + "0.0.90", + "0.0.91", + "0.0.92", + "0.0.93", + "0.0.94", + "0.0.95", + "0.0.96", + "0.0.97", + "0.0.98", + "0.0.99-go1.18", + "0.0.99", + "0.0.100-go1.18", + "0.0.100", + "1.0.5", + "1.0.6-go1.18", + "1.0.6-go1.19", + "1.0.6", + "1.0.7-go1.18", + "1.0.7-go1.19", + "1.0.7", + "1.0.8-go1.18", + "1.0.8-go1.19", + "1.0.8", + "1.0.9-go1.18" + ] + }, + { + "offset": 0, + "versions": [ + "1.0.0-go1.18", + "1.0.0", + "1.0.1-go1.18", + "1.0.1", + "1.0.2-go1.18", + "1.0.2", + "1.0.3-go1.18", + "1.0.3", + "1.0.4-go1.18", + "1.0.4", + "1.0.5-go1.18", + "1.0.9-go1.19", + "1.0.9", + "1.0.10-go1.18", + "1.0.10-go1.19", + "1.0.10", + "1.0.11-go1.18", + "1.0.11-go1.19", + "1.0.11", + "1.0.12-go1.18", + "1.0.12-go1.19", + "1.0.12", + "1.0.13-go1.18", + "1.0.13-go1.19", + "1.0.13", + "1.0.14-go1.18", + "1.0.14-go1.19", + "1.0.14", + "1.0.15-go1.18", + "1.0.15-go1.19", + "1.0.15", + "1.0.16-go1.18", + "1.0.16-go1.19", + "1.0.16", + "1.0.17-go1.18", + "1.0.17-go1.19", + "1.0.17", + "1.0.18-go1.18", + "1.0.18-go1.19", + "1.0.18", + "1.0.19-go1.18", + "1.0.19-go1.19", + "1.0.19", + "1.0.20-go1.18", + "1.0.20-go1.19", + "1.0.20-pre.1", + "1.0.20-pre.2", + "1.0.20-pre.3", + "1.0.20-pre.4", + "1.0.20-pre.5", + "1.0.20", + "1.0.21-go1.18", + "1.0.21-go1.19", + "1.0.21", + "1.0.22-go1.18", + "1.0.22-go1.19", + "1.0.22-go119", + "1.0.22", + "1.0.23-go1.18", + "1.0.23-go1.19", + "1.0.23", + "1.0.24-go1.18", + "1.0.24-go1.19", + "1.0.24", + "1.0.25-go1.18", + "1.0.25-go1.19", + "1.0.25", + "1.0.26-debug438", + "1.0.26-go1.18", + "1.0.26-go1.19", + "1.0.26", + "1.0.27-go1.18", + "1.0.27-go1.19", + "1.0.27", + "1.0.28-pre", + "1.0.28-pre2", + "1.0.28-pre3", + "1.0.28-pre4", + "1.0.28-pre5", + "1.0.28", + "1.0.29", + "1.0.30", + "1.0.31-cap", + "1.0.31", + "1.0.32", + "1.0.33", + "1.0.34", + "1.0.35-dev1", + "1.0.35", + "1.0.36", + "1.0.37", + "1.0.38", + "1.0.39", + "1.0.40-alpha", + "1.0.40", + "1.0.41", + "1.0.42-alpha", + "1.0.42-alpha.2", + "1.0.42", + "1.0.43", + "1.0.44-alpha.1", + "1.0.44", + "1.0.45-alpha.1", + "1.0.45-alpha.2", + "1.0.45-alpha.3", + "1.0.45", + "1.0.46-alpha.1", + "1.0.46-alpha.2", + "1.0.46", + "1.0.47-alpha.1", + "1.0.47-alpha.2", + "1.0.47", + "1.0.48-alpha.1", + "1.0.48", + "1.0.49-alpha.1", + "1.0.49-alpha.2", + "1.0.49-alpha.3", + "1.0.49", + "1.0.50-alpha.1", + "1.0.50-alpha.2", + "1.0.50-alpha.3", + "1.0.50-alpha.4", + "1.0.50-alpha.5", + "1.0.50-alpha.6", + "1.0.50", + "1.0.51-alpha.1", + "1.0.51-debug.1", + "1.0.51", + "1.0.52-alpha.1", + "1.0.52-alpha.2", + "1.0.52-alpha.3", + "1.0.52", + "1.0.53-alpha.1", + "1.0.53" + ] + } + ] + } + ] + } + ] + } + ] + }, { "module": "github.com/segmentio/kafka-go", "packages": [ @@ -942,7 +2025,8 @@ "1.30.0", "1.31.0", "1.32.0", - "1.33.0" + "1.33.0", + "1.34.0" ] } ] @@ -1041,7 +2125,8 @@ "1.30.0", "1.31.0", "1.32.0", - "1.33.0" + "1.33.0", + "1.34.0" ] } ] @@ -1140,7 +2225,8 @@ "1.30.0", "1.31.0", "1.32.0", - "1.33.0" + "1.33.0", + "1.34.0" ] } ] @@ -1244,7 +2330,8 @@ "1.30.0", "1.31.0", "1.32.0", - "1.33.0" + "1.33.0", + "1.34.0" ] } ] @@ -1348,7 +2435,8 @@ "1.30.0", "1.31.0", "1.32.0", - "1.33.0" + "1.33.0", + "1.34.0" ] } ] @@ -1442,7 +2530,8 @@ "1.30.0", "1.31.0", "1.32.0", - "1.33.0" + "1.33.0", + "1.34.0" ] } ] @@ -1536,7 +2625,8 @@ "1.30.0", "1.31.0", "1.32.0", - "1.33.0" + "1.33.0", + "1.34.0" ] } ] @@ -1876,14 +2966,26 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } ] - }, + } + ] + } + ] + }, + { + "package": "google.golang.org/grpc", + "structs": [ + { + "struct": "ClientConn", + "fields": [ { - "field": "Message", + "field": "target", "offsets": [ { "offset": null, @@ -1909,13 +3011,28 @@ "1.7.2", "1.7.3", "1.7.4", - "1.7.5", - "1.64.0" + "1.7.5" ] }, { - "offset": 8, + "offset": 24, "versions": [ + "1.8.0", + "1.8.2", + "1.9.0", + "1.9.1", + "1.9.2", + "1.10.0", + "1.10.1", + "1.11.0", + "1.11.1", + "1.11.2", + "1.11.3", + "1.12.0", + "1.12.1", + "1.12.2", + "1.13.0", + "1.14.0", "1.15.0", "1.16.0", "1.17.0", @@ -1961,30 +3078,9 @@ "1.33.0-dev", "1.33.0", "1.33.1", - "1.34.0-dev" - ] - }, - { - "offset": 48, - "versions": [ - "1.8.0", - "1.8.2", - "1.9.0", - "1.9.1", - "1.9.2", - "1.10.0", - "1.10.1", - "1.11.0", - "1.11.1", - "1.11.2", - "1.11.3", - "1.12.0", - "1.12.1", - "1.12.2", - "1.13.0", - "1.14.0", "1.33.2", "1.33.3", + "1.34.0-dev", "1.34.0", "1.34.1", "1.34.2", @@ -2073,6 +3169,7 @@ "1.63.1", "1.63.2", "1.63.3", + "1.64.0", "1.64.1", "1.65.0-dev", "1.65.0", @@ -2094,7 +3191,9 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } @@ -2105,13 +3204,13 @@ ] }, { - "package": "google.golang.org/grpc", + "package": "google.golang.org/grpc/internal/status", "structs": [ { - "struct": "ClientConn", + "struct": "Error", "fields": [ { - "field": "target", + "field": "s", "offsets": [ { "offset": null, @@ -2137,12 +3236,7 @@ "1.7.2", "1.7.3", "1.7.4", - "1.7.5" - ] - }, - { - "offset": 24, - "versions": [ + "1.7.5", "1.8.0", "1.8.2", "1.9.0", @@ -2225,7 +3319,12 @@ "1.39.0-dev", "1.39.0", "1.39.1", - "1.40.0-dev", + "1.40.0-dev" + ] + }, + { + "offset": 0, + "versions": [ "1.40.0", "1.40.1", "1.41.0-dev", @@ -2317,21 +3416,18 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } ] } ] - } - ] - }, - { - "package": "google.golang.org/grpc/internal/status", - "structs": [ + }, { - "struct": "Error", + "struct": "Status", "fields": [ { "field": "s", @@ -2407,7 +3503,12 @@ "1.28.0-pre", "1.28.0", "1.28.1", - "1.29.0-dev", + "1.29.0-dev" + ] + }, + { + "offset": 0, + "versions": [ "1.29.0", "1.29.1", "1.30.0-dev", @@ -2443,12 +3544,7 @@ "1.39.0-dev", "1.39.0", "1.39.1", - "1.40.0-dev" - ] - }, - { - "offset": 0, - "versions": [ + "1.40.0-dev", "1.40.0", "1.40.1", "1.41.0-dev", @@ -2540,19 +3636,26 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } ] } ] - }, + } + ] + }, + { + "package": "google.golang.org/grpc/internal/transport", + "structs": [ { - "struct": "Status", + "struct": "ServerStream", "fields": [ { - "field": "s", + "field": "Stream", "offsets": [ { "offset": null, @@ -2625,12 +3728,7 @@ "1.28.0-pre", "1.28.0", "1.28.1", - "1.29.0-dev" - ] - }, - { - "offset": 0, - "versions": [ + "1.29.0-dev", "1.29.0", "1.29.1", "1.30.0-dev", @@ -2755,245 +3853,29 @@ "1.68.0", "1.68.1", "1.68.2", - "1.69.0-dev", + "1.69.0-dev" + ] + }, + { + "offset": 0, + "versions": [ "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } ] } ] - } - ] - }, - { - "package": "google.golang.org/grpc/internal/transport", - "structs": [ + }, { - "struct": "ServerStream", + "struct": "Stream", "fields": [ { - "field": "Stream", - "offsets": [ - { - "offset": null, - "versions": [ - "1.0.0", - "1.0.1-GA", - "1.0.2", - "1.0.3", - "1.0.4", - "1.0.5", - "1.2.0", - "1.2.1", - "1.3.0", - "1.4.0", - "1.4.1", - "1.4.2", - "1.5.0", - "1.5.1", - "1.5.2", - "1.6.0", - "1.7.0", - "1.7.1", - "1.7.2", - "1.7.3", - "1.7.4", - "1.7.5", - "1.8.0", - "1.8.2", - "1.9.0", - "1.9.1", - "1.9.2", - "1.10.0", - "1.10.1", - "1.11.0", - "1.11.1", - "1.11.2", - "1.11.3", - "1.12.0", - "1.12.1", - "1.12.2", - "1.13.0", - "1.14.0", - "1.15.0", - "1.16.0", - "1.17.0", - "1.18.0", - "1.18.1", - "1.19.0", - "1.19.1", - "1.20.0", - "1.20.1", - "1.21.0", - "1.21.1", - "1.21.2", - "1.21.3", - "1.21.4", - "1.22.0", - "1.22.1", - "1.22.2", - "1.22.3", - "1.23.0", - "1.23.1", - "1.24.0", - "1.25.0", - "1.25.1", - "1.26.0", - "1.27.0-pre", - "1.27.0", - "1.27.1", - "1.28.0-pre", - "1.28.0", - "1.28.1", - "1.29.0-dev", - "1.29.0", - "1.29.1", - "1.30.0-dev", - "1.30.0-dev.1", - "1.30.0", - "1.30.1", - "1.31.0-dev", - "1.31.0", - "1.31.1", - "1.32.0-dev", - "1.32.0", - "1.33.0-dev", - "1.33.0", - "1.33.1", - "1.33.2", - "1.33.3", - "1.34.0-dev", - "1.34.0", - "1.34.1", - "1.34.2", - "1.35.0-dev", - "1.35.0", - "1.35.1", - "1.36.0-dev", - "1.36.0", - "1.36.1", - "1.37.0-dev", - "1.37.0", - "1.37.1", - "1.38.0-dev", - "1.38.0", - "1.38.1", - "1.39.0-dev", - "1.39.0", - "1.39.1", - "1.40.0-dev", - "1.40.0", - "1.40.1", - "1.41.0-dev", - "1.41.0", - "1.41.1", - "1.42.0-dev", - "1.42.0", - "1.43.0-dev", - "1.43.0", - "1.44.0-dev", - "1.44.0", - "1.45.0-dev", - "1.45.0", - "1.46.0-dev", - "1.46.0", - "1.46.1", - "1.46.2", - "1.47.0-dev", - "1.47.0", - "1.48.0-dev", - "1.48.0", - "1.49.0-dev", - "1.49.0", - "1.50.0-dev", - "1.50.0", - "1.50.1", - "1.51.0-dev", - "1.51.0", - "1.52.0-dev", - "1.52.0", - "1.52.1", - "1.52.3", - "1.53.0-dev", - "1.53.0", - "1.54.0", - "1.54.1", - "1.55.0-dev", - "1.55.0", - "1.55.1", - "1.56.0-dev", - "1.56.0", - "1.56.1", - "1.56.2", - "1.56.3", - "1.57.0-dev", - "1.57.0", - "1.57.1", - "1.57.2", - "1.58.0-dev", - "1.58.0", - "1.58.1", - "1.58.2", - "1.58.3", - "1.59.0-dev", - "1.59.0", - "1.60.0-dev", - "1.60.0", - "1.60.1", - "1.61.0-dev", - "1.61.0", - "1.61.1", - "1.61.2", - "1.62.0", - "1.62.1", - "1.62.2", - "1.63.0", - "1.63.1", - "1.63.2", - "1.63.3", - "1.64.0", - "1.64.1", - "1.65.0-dev", - "1.65.0", - "1.65.1", - "1.66.0-dev", - "1.66.0", - "1.66.1", - "1.66.2", - "1.66.3", - "1.67.0-dev", - "1.67.0", - "1.67.1", - "1.67.2", - "1.67.3", - "1.68.0-dev", - "1.68.0", - "1.68.1", - "1.68.2", - "1.69.0-dev" - ] - }, - { - "offset": 0, - "versions": [ - "1.69.0", - "1.69.2", - "1.70.0-dev", - "1.71.0-dev" - ] - } - ] - } - ] - }, - { - "struct": "Stream", - "fields": [ - { - "field": "ctx", + "field": "ctx", "offsets": [ { "offset": null, @@ -3042,7 +3924,9 @@ "versions": [ "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] }, @@ -3427,7 +4311,9 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } @@ -3483,7 +4369,9 @@ "versions": [ "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] }, @@ -3878,7 +4766,9 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } @@ -4091,7 +4981,9 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } @@ -4339,7 +5231,9 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } @@ -4557,7 +5451,9 @@ "1.69.0-dev", "1.69.0", "1.69.2", + "1.69.4", "1.70.0-dev", + "1.70.0", "1.71.0-dev" ] } @@ -4637,175 +5533,721 @@ "1.22.3", "1.23.0", "1.23.1", - "1.24.0", - "1.25.0", - "1.25.1", - "1.26.0", - "1.27.0-pre", - "1.27.0", - "1.27.1", - "1.28.0-pre", - "1.28.0", - "1.28.1", - "1.29.0-dev", - "1.29.0", - "1.29.1", - "1.30.0-dev", - "1.30.0-dev.1", - "1.30.0", - "1.30.1", - "1.31.0-dev", - "1.31.0", - "1.31.1", - "1.32.0-dev", - "1.32.0", - "1.33.0-dev", - "1.33.0", - "1.33.1", - "1.33.2", - "1.33.3", - "1.34.0-dev", - "1.34.0", - "1.34.1", - "1.34.2", - "1.35.0-dev", - "1.35.0", - "1.35.1", - "1.36.0-dev", - "1.36.0", - "1.36.1", - "1.37.0-dev", - "1.37.0", - "1.37.1", - "1.38.0-dev", - "1.38.0", - "1.38.1", - "1.39.0-dev", - "1.39.0", - "1.39.1", - "1.40.0-dev", - "1.40.0", - "1.40.1", - "1.41.0-dev", - "1.41.0", - "1.41.1", - "1.42.0-dev", - "1.42.0", - "1.43.0-dev", - "1.43.0", - "1.44.0-dev", - "1.44.0", - "1.45.0-dev", - "1.45.0", - "1.46.0-dev", - "1.46.0", - "1.46.1", - "1.46.2", - "1.47.0-dev", - "1.47.0", - "1.48.0-dev", - "1.48.0", - "1.49.0-dev", - "1.49.0", - "1.50.0-dev", - "1.50.0", - "1.50.1", - "1.51.0-dev", - "1.51.0", - "1.52.0-dev", - "1.52.0", - "1.52.1", - "1.52.3", - "1.53.0-dev", - "1.53.0", - "1.54.0", - "1.54.1", - "1.55.0-dev", - "1.55.0", - "1.55.1", - "1.56.0-dev", - "1.56.0", - "1.56.1", - "1.56.2", - "1.56.3", - "1.57.0-dev", - "1.57.0", - "1.57.1", - "1.57.2", - "1.58.0-dev", - "1.58.0", - "1.58.1", - "1.58.2", - "1.58.3", - "1.59.0-dev", - "1.59.0", - "1.60.0-dev" - ] - }, - { - "offset": 16, - "versions": [ - "1.60.0", - "1.60.1", - "1.61.0-dev", - "1.61.0", - "1.61.1", - "1.61.2", - "1.62.0", - "1.62.1", - "1.62.2", - "1.63.0", - "1.63.1", - "1.63.2", - "1.63.3", - "1.64.0", - "1.64.1", - "1.65.0-dev", - "1.65.0", - "1.65.1", - "1.66.0-dev", - "1.66.0", - "1.66.1", - "1.66.2", - "1.66.3", - "1.67.0-dev", - "1.67.0", - "1.67.1", - "1.67.2", - "1.67.3", - "1.68.0-dev", - "1.68.0", - "1.68.1", - "1.68.2", - "1.69.0-dev", - "1.69.0", - "1.69.2", - "1.70.0-dev", - "1.71.0-dev" + "1.24.0", + "1.25.0", + "1.25.1", + "1.26.0", + "1.27.0-pre", + "1.27.0", + "1.27.1", + "1.28.0-pre", + "1.28.0", + "1.28.1", + "1.29.0-dev", + "1.29.0", + "1.29.1", + "1.30.0-dev", + "1.30.0-dev.1", + "1.30.0", + "1.30.1", + "1.31.0-dev", + "1.31.0", + "1.31.1", + "1.32.0-dev", + "1.32.0", + "1.33.0-dev", + "1.33.0", + "1.33.1", + "1.33.2", + "1.33.3", + "1.34.0-dev", + "1.34.0", + "1.34.1", + "1.34.2", + "1.35.0-dev", + "1.35.0", + "1.35.1", + "1.36.0-dev", + "1.36.0", + "1.36.1", + "1.37.0-dev", + "1.37.0", + "1.37.1", + "1.38.0-dev", + "1.38.0", + "1.38.1", + "1.39.0-dev", + "1.39.0", + "1.39.1", + "1.40.0-dev", + "1.40.0", + "1.40.1", + "1.41.0-dev", + "1.41.0", + "1.41.1", + "1.42.0-dev", + "1.42.0", + "1.43.0-dev", + "1.43.0", + "1.44.0-dev", + "1.44.0", + "1.45.0-dev", + "1.45.0", + "1.46.0-dev", + "1.46.0", + "1.46.1", + "1.46.2", + "1.47.0-dev", + "1.47.0", + "1.48.0-dev", + "1.48.0", + "1.49.0-dev", + "1.49.0", + "1.50.0-dev", + "1.50.0", + "1.50.1", + "1.51.0-dev", + "1.51.0", + "1.52.0-dev", + "1.52.0", + "1.52.1", + "1.52.3", + "1.53.0-dev", + "1.53.0", + "1.54.0", + "1.54.1", + "1.55.0-dev", + "1.55.0", + "1.55.1", + "1.56.0-dev", + "1.56.0", + "1.56.1", + "1.56.2", + "1.56.3", + "1.57.0-dev", + "1.57.0", + "1.57.1", + "1.57.2", + "1.58.0-dev", + "1.58.0", + "1.58.1", + "1.58.2", + "1.58.3", + "1.59.0-dev", + "1.59.0", + "1.60.0-dev" + ] + }, + { + "offset": 16, + "versions": [ + "1.60.0", + "1.60.1", + "1.61.0-dev", + "1.61.0", + "1.61.1", + "1.61.2", + "1.62.0", + "1.62.1", + "1.62.2", + "1.63.0", + "1.63.1", + "1.63.2", + "1.63.3", + "1.64.0", + "1.64.1", + "1.65.0-dev", + "1.65.0", + "1.65.1", + "1.66.0-dev", + "1.66.0", + "1.66.1", + "1.66.2", + "1.66.3", + "1.67.0-dev", + "1.67.0", + "1.67.1", + "1.67.2", + "1.67.3", + "1.68.0-dev", + "1.68.0", + "1.68.1", + "1.68.2", + "1.69.0-dev", + "1.69.0", + "1.69.2", + "1.69.4", + "1.70.0-dev", + "1.70.0", + "1.71.0-dev" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "module": "std", + "packages": [ + { + "package": "bufio", + "structs": [ + { + "struct": "Writer", + "fields": [ + { + "field": "buf", + "offsets": [ + { + "offset": 16, + "versions": [ + "1.12.0", + "1.12.1", + "1.12.2", + "1.12.3", + "1.12.4", + "1.12.5", + "1.12.6", + "1.12.7", + "1.12.8", + "1.12.9", + "1.12.10", + "1.12.11", + "1.12.12", + "1.12.13", + "1.12.14", + "1.12.15", + "1.12.16", + "1.12.17", + "1.13.0", + "1.13.1", + "1.13.2", + "1.13.3", + "1.13.4", + "1.13.5", + "1.13.6", + "1.13.7", + "1.13.8", + "1.13.9", + "1.13.10", + "1.13.11", + "1.13.12", + "1.13.13", + "1.13.14", + "1.13.15", + "1.14.0", + "1.14.1", + "1.14.2", + "1.14.3", + "1.14.4", + "1.14.5", + "1.14.6", + "1.14.7", + "1.14.8", + "1.14.9", + "1.14.10", + "1.14.11", + "1.14.12", + "1.14.13", + "1.14.14", + "1.14.15", + "1.15.0", + "1.15.1", + "1.15.2", + "1.15.3", + "1.15.4", + "1.15.5", + "1.15.6", + "1.15.7", + "1.15.8", + "1.15.9", + "1.15.10", + "1.15.11", + "1.15.12", + "1.15.13", + "1.15.14", + "1.15.15", + "1.16.0", + "1.16.1", + "1.16.2", + "1.16.3", + "1.16.4", + "1.16.5", + "1.16.6", + "1.16.7", + "1.16.8", + "1.16.9", + "1.16.10", + "1.16.11", + "1.16.12", + "1.16.13", + "1.16.14", + "1.16.15", + "1.17.0", + "1.17.1", + "1.17.2", + "1.17.3", + "1.17.4", + "1.17.5", + "1.17.6", + "1.17.7", + "1.17.8", + "1.17.9", + "1.17.10", + "1.17.11", + "1.17.12", + "1.17.13", + "1.18.0", + "1.18.1", + "1.18.2", + "1.18.3", + "1.18.4", + "1.18.5", + "1.18.6", + "1.18.7", + "1.18.8", + "1.18.9", + "1.18.10", + "1.19.0", + "1.19.1", + "1.19.2", + "1.19.3", + "1.19.4", + "1.19.5", + "1.19.6", + "1.19.7", + "1.19.8", + "1.19.9", + "1.19.10", + "1.19.11", + "1.19.12", + "1.19.13", + "1.20.0", + "1.20.1", + "1.20.2", + "1.20.3", + "1.20.4", + "1.20.5", + "1.20.6", + "1.20.7", + "1.20.8", + "1.20.9", + "1.20.10", + "1.20.11", + "1.20.12", + "1.20.13", + "1.20.14", + "1.21.0", + "1.21.1", + "1.21.2", + "1.21.3", + "1.21.4", + "1.21.5", + "1.21.6", + "1.21.7", + "1.21.8", + "1.21.9", + "1.21.10", + "1.21.11", + "1.21.12", + "1.21.13", + "1.22.0", + "1.22.1", + "1.22.2", + "1.22.3", + "1.22.4", + "1.22.5", + "1.22.6", + "1.22.7", + "1.22.8", + "1.22.9", + "1.22.10", + "1.22.11", + "1.23.0", + "1.23.1", + "1.23.2", + "1.23.3", + "1.23.4", + "1.23.5" + ] + } + ] + }, + { + "field": "n", + "offsets": [ + { + "offset": 40, + "versions": [ + "1.12.0", + "1.12.1", + "1.12.2", + "1.12.3", + "1.12.4", + "1.12.5", + "1.12.6", + "1.12.7", + "1.12.8", + "1.12.9", + "1.12.10", + "1.12.11", + "1.12.12", + "1.12.13", + "1.12.14", + "1.12.15", + "1.12.16", + "1.12.17", + "1.13.0", + "1.13.1", + "1.13.2", + "1.13.3", + "1.13.4", + "1.13.5", + "1.13.6", + "1.13.7", + "1.13.8", + "1.13.9", + "1.13.10", + "1.13.11", + "1.13.12", + "1.13.13", + "1.13.14", + "1.13.15", + "1.14.0", + "1.14.1", + "1.14.2", + "1.14.3", + "1.14.4", + "1.14.5", + "1.14.6", + "1.14.7", + "1.14.8", + "1.14.9", + "1.14.10", + "1.14.11", + "1.14.12", + "1.14.13", + "1.14.14", + "1.14.15", + "1.15.0", + "1.15.1", + "1.15.2", + "1.15.3", + "1.15.4", + "1.15.5", + "1.15.6", + "1.15.7", + "1.15.8", + "1.15.9", + "1.15.10", + "1.15.11", + "1.15.12", + "1.15.13", + "1.15.14", + "1.15.15", + "1.16.0", + "1.16.1", + "1.16.2", + "1.16.3", + "1.16.4", + "1.16.5", + "1.16.6", + "1.16.7", + "1.16.8", + "1.16.9", + "1.16.10", + "1.16.11", + "1.16.12", + "1.16.13", + "1.16.14", + "1.16.15", + "1.17.0", + "1.17.1", + "1.17.2", + "1.17.3", + "1.17.4", + "1.17.5", + "1.17.6", + "1.17.7", + "1.17.8", + "1.17.9", + "1.17.10", + "1.17.11", + "1.17.12", + "1.17.13", + "1.18.0", + "1.18.1", + "1.18.2", + "1.18.3", + "1.18.4", + "1.18.5", + "1.18.6", + "1.18.7", + "1.18.8", + "1.18.9", + "1.18.10", + "1.19.0", + "1.19.1", + "1.19.2", + "1.19.3", + "1.19.4", + "1.19.5", + "1.19.6", + "1.19.7", + "1.19.8", + "1.19.9", + "1.19.10", + "1.19.11", + "1.19.12", + "1.19.13", + "1.20.0", + "1.20.1", + "1.20.2", + "1.20.3", + "1.20.4", + "1.20.5", + "1.20.6", + "1.20.7", + "1.20.8", + "1.20.9", + "1.20.10", + "1.20.11", + "1.20.12", + "1.20.13", + "1.20.14", + "1.21.0", + "1.21.1", + "1.21.2", + "1.21.3", + "1.21.4", + "1.21.5", + "1.21.6", + "1.21.7", + "1.21.8", + "1.21.9", + "1.21.10", + "1.21.11", + "1.21.12", + "1.21.13", + "1.22.0", + "1.22.1", + "1.22.2", + "1.22.3", + "1.22.4", + "1.22.5", + "1.22.6", + "1.22.7", + "1.22.8", + "1.22.9", + "1.22.10", + "1.22.11", + "1.23.0", + "1.23.1", + "1.23.2", + "1.23.3", + "1.23.4", + "1.23.5" + ] + } + ] + } + ] + } + ] + }, + { + "package": "net", + "structs": [ + { + "struct": "TCPAddr", + "fields": [ + { + "field": "IP", + "offsets": [ + { + "offset": 0, + "versions": [ + "1.12.0", + "1.12.1", + "1.12.2", + "1.12.3", + "1.12.4", + "1.12.5", + "1.12.6", + "1.12.7", + "1.12.8", + "1.12.9", + "1.12.10", + "1.12.11", + "1.12.12", + "1.12.13", + "1.12.14", + "1.12.15", + "1.12.16", + "1.12.17", + "1.13.0", + "1.13.1", + "1.13.2", + "1.13.3", + "1.13.4", + "1.13.5", + "1.13.6", + "1.13.7", + "1.13.8", + "1.13.9", + "1.13.10", + "1.13.11", + "1.13.12", + "1.13.13", + "1.13.14", + "1.13.15", + "1.14.0", + "1.14.1", + "1.14.2", + "1.14.3", + "1.14.4", + "1.14.5", + "1.14.6", + "1.14.7", + "1.14.8", + "1.14.9", + "1.14.10", + "1.14.11", + "1.14.12", + "1.14.13", + "1.14.14", + "1.14.15", + "1.15.0", + "1.15.1", + "1.15.2", + "1.15.3", + "1.15.4", + "1.15.5", + "1.15.6", + "1.15.7", + "1.15.8", + "1.15.9", + "1.15.10", + "1.15.11", + "1.15.12", + "1.15.13", + "1.15.14", + "1.15.15", + "1.16.0", + "1.16.1", + "1.16.2", + "1.16.3", + "1.16.4", + "1.16.5", + "1.16.6", + "1.16.7", + "1.16.8", + "1.16.9", + "1.16.10", + "1.16.11", + "1.16.12", + "1.16.13", + "1.16.14", + "1.16.15", + "1.17.0", + "1.17.1", + "1.17.2", + "1.17.3", + "1.17.4", + "1.17.5", + "1.17.6", + "1.17.7", + "1.17.8", + "1.17.9", + "1.17.10", + "1.17.11", + "1.17.12", + "1.17.13", + "1.18.0", + "1.18.1", + "1.18.2", + "1.18.3", + "1.18.4", + "1.18.5", + "1.18.6", + "1.18.7", + "1.18.8", + "1.18.9", + "1.18.10", + "1.19.0", + "1.19.1", + "1.19.2", + "1.19.3", + "1.19.4", + "1.19.5", + "1.19.6", + "1.19.7", + "1.19.8", + "1.19.9", + "1.19.10", + "1.19.11", + "1.19.12", + "1.19.13", + "1.20.0", + "1.20.1", + "1.20.2", + "1.20.3", + "1.20.4", + "1.20.5", + "1.20.6", + "1.20.7", + "1.20.8", + "1.20.9", + "1.20.10", + "1.20.11", + "1.20.12", + "1.20.13", + "1.20.14", + "1.21.0", + "1.21.1", + "1.21.2", + "1.21.3", + "1.21.4", + "1.21.5", + "1.21.6", + "1.21.7", + "1.21.8", + "1.21.9", + "1.21.10", + "1.21.11", + "1.21.12", + "1.21.13", + "1.22.0", + "1.22.1", + "1.22.2", + "1.22.3", + "1.22.4", + "1.22.5", + "1.22.6", + "1.22.7", + "1.22.8", + "1.22.9", + "1.22.10", + "1.22.11", + "1.23.0", + "1.23.1", + "1.23.2", + "1.23.3", + "1.23.4", + "1.23.5" ] } ] - } - ] - } - ] - } - ] - }, - { - "module": "std", - "packages": [ - { - "package": "bufio", - "structs": [ - { - "struct": "Writer", - "fields": [ + }, { - "field": "buf", + "field": "Port", "offsets": [ { - "offset": 16, + "offset": 24, "versions": [ "1.12.0", "1.12.1", @@ -4968,20 +6410,27 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] - }, + } + ] + }, + { + "struct": "TCPConn", + "fields": [ { - "field": "n", + "field": "conn", "offsets": [ { - "offset": 40, + "offset": 0, "versions": [ "1.12.0", "1.12.1", @@ -5144,27 +6593,24 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] } ] - } - ] - }, - { - "package": "net", - "structs": [ + }, { - "struct": "TCPAddr", + "struct": "conn", "fields": [ { - "field": "IP", + "field": "fd", "offsets": [ { "offset": 0, @@ -5330,20 +6776,27 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] - }, + } + ] + }, + { + "struct": "netFD", + "fields": [ { - "field": "Port", + "field": "raddr", "offsets": [ { - "offset": 24, + "offset": 112, "versions": [ "1.12.0", "1.12.1", @@ -5506,11 +6959,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -5692,11 +7147,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -5868,11 +7325,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -6044,11 +7503,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -6220,11 +7681,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -6396,11 +7859,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -6572,11 +8037,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -6748,11 +8215,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -6923,7 +8392,8 @@ "1.22.7", "1.22.8", "1.22.9", - "1.22.10" + "1.22.10", + "1.22.11" ] }, { @@ -6933,7 +8403,8 @@ "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -7109,7 +8580,8 @@ "1.22.7", "1.22.8", "1.22.9", - "1.22.10" + "1.22.10", + "1.22.11" ] }, { @@ -7119,7 +8591,8 @@ "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -7296,11 +8769,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -7482,11 +8957,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -7663,11 +9140,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -7844,11 +9323,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -8035,11 +9516,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -8211,11 +9694,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -8387,11 +9872,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -8568,11 +10055,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -8744,11 +10233,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -8920,11 +10411,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -9101,11 +10594,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -9277,11 +10772,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -9453,11 +10950,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -9629,11 +11128,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -9805,11 +11306,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -9986,11 +11489,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -10171,7 +11676,8 @@ "1.22.7", "1.22.8", "1.22.9", - "1.22.10" + "1.22.10", + "1.22.11" ] }, { @@ -10181,7 +11687,8 @@ "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] @@ -10358,11 +11865,13 @@ "1.22.8", "1.22.9", "1.22.10", + "1.22.11", "1.23.0", "1.23.1", "1.23.2", "1.23.3", - "1.23.4" + "1.23.4", + "1.23.5" ] } ] diff --git a/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf/probe.bpf.c b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf/probe.bpf.c new file mode 100644 index 000000000..4674c6686 --- /dev/null +++ b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf/probe.bpf.c @@ -0,0 +1,143 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +#include "arguments.h" +#include "trace/span_context.h" +#include "go_context.h" +#include "go_types.h" +#include "uprobe.h" +#include "trace/start_span.h" +#include "go_net.h" + +char __license[] SEC("license") = "Dual MIT/GPL"; + +#define MAX_CONCURRENT 56 // todo: tune +#define MAX_OPERATION_NAME_SIZE 20 + +typedef struct tcp_addr { + u8 ip[16]; + u64 port; +} tcp_addr_t; + +struct rueidis_completed_command_t { + BASE_SPAN_PROPERTIES + char operation_name[MAX_OPERATION_NAME_SIZE]; + net_addr_t local_addr; +}; + +struct { + __uint(type, BPF_MAP_TYPE_HASH); + __type(key, void*); + __type(value, struct rueidis_completed_command_t); + __uint(max_entries, MAX_CONCURRENT); +} redis_completed_events SEC(".maps"); + +volatile const u64 pipe_conn_pos; +volatile const u64 tcp_conn_conn_pos; +volatile const u64 conn_fd_pos; +volatile const u64 fd_raddr_pos; +volatile const u64 tcp_addr_ip_pos; +volatile const u64 tcp_addr_port_pos; +volatile const u64 completed_cs_pos; +volatile const u64 cs_s_pos; +volatile const u64 result_error_pos; + +const u64 max_opration_length = MAX_OPERATION_NAME_SIZE; + +// This instrumentation attaches uprobe to the following function: +// func (m *pipe) Do(ctx context.Context, cmd Completed) (resp RedisResult) +SEC("uprobe/pipe_Do") +int uprobe_pipe_Do(struct pt_regs *ctx) { + int cmd_cs_ptr_pos = 4; // passed in $rdi + struct go_iface go_context = {0}; + get_Go_context(ctx, 2, 0, true, &go_context); + + void *key = get_consistent_key(ctx, go_context.data); + void *redisReq_ptr = bpf_map_lookup_elem(&redis_completed_events, &key); + if (redisReq_ptr != NULL) { + bpf_printk("uprobe/pipe_Do already tracked with the current context"); + return 0; + } + + struct rueidis_completed_command_t redisReq = {}; + redisReq.start_time = bpf_ktime_get_ns(); + + start_span_params_t start_span_params = { + .ctx = ctx, + .go_context = &go_context, + .psc = &redisReq.psc, + .sc = &redisReq.sc, + .get_parent_span_context_fn = NULL, + .get_parent_span_context_arg = NULL, + }; + start_span(&start_span_params); + + + // read network peer data. located at pipe.conn.conn.fd.raddr + void *pipe_ptr = get_argument(ctx, 1); + // todo: check pipe not having conn scenario for older version + + void *tcp_conn_ptr = 0; + bpf_probe_read_user(&tcp_conn_ptr, sizeof(tcp_conn_ptr), get_go_interface_instance(pipe_ptr + pipe_conn_pos)); + + + void *fd_ptr = 0; + bpf_probe_read_user(&fd_ptr, sizeof(fd_ptr), (void *)(tcp_conn_ptr + tcp_conn_conn_pos + conn_fd_pos)); + + void *tcp_addr_ptr = 0; + bpf_probe_read_user(&tcp_addr_ptr, sizeof(tcp_addr_ptr), get_go_interface_instance(fd_ptr + fd_raddr_pos)); + + get_tcp_net_addr_from_tcp_addr(ctx, &redisReq.local_addr, (void *)(tcp_addr_ptr)); + // port still has issues. its type conversion with golang controller though. + + // read redis command's operation from cmd.cs[0] + void *cs_ptr = get_argument(ctx, cmd_cs_ptr_pos); + if (cs_ptr == 0) { + goto done; + } + + struct go_slice cs = {0}; + bpf_probe_read(&cs, sizeof(cs), cs_ptr); + + if (!get_go_string_from_user_ptr(cs.array, &redisReq.operation_name, max_opration_length)) { + bpf_printk("uprobe/pipe_Do command from Completed.cs.s"); + } + + // todo: get full query text + + done: + + bpf_map_update_elem(&redis_completed_events, &key, &redisReq, 0); + start_tracking_span(go_context.data, &redisReq.sc); + + return 0; +} + + +// This instrumentation attaches uretprobe to the following function: +// func (m *pipe) Do(ctx context.Context, cmd Completed) (resp RedisResult) +SEC("uprobe/pipe_Do") +int uprobe_pipe_Do_Returns(struct pt_regs *ctx) { + u64 end_time = bpf_ktime_get_ns(); + + struct go_iface go_context = {0}; + get_Go_context(ctx, 3, 0, true, &go_context); + + void *key = get_consistent_key(ctx, go_context.data); + struct rueidis_completed_command_t *redisReq = bpf_map_lookup_elem(&redis_completed_events, &key); + + if (redisReq == NULL) { + bpf_printk("event is NULL in ret probe"); + return 0; + } + + // todo: check if error happened + + done: + redisReq->end_time = bpf_ktime_get_ns(); + output_span_event(ctx, redisReq, sizeof(*redisReq), &redisReq->sc); + stop_tracking_span(&redisReq->sc, &redisReq->psc); + + bpf_map_delete_elem(&redis_completed_events, &key); + return 0; +} diff --git a/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf_arm64_bpfel.go b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf_arm64_bpfel.go new file mode 100644 index 000000000..eb585174b --- /dev/null +++ b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf_arm64_bpfel.go @@ -0,0 +1,212 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build arm64 + +package rueidis + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type bpfRueidisCompletedCommandT struct { + StartTime uint64 + EndTime uint64 + Sc bpfSpanContext + Psc bpfSpanContext + OperationName [20]int8 + LocalAddr struct { + Ip [16]uint8 + Port uint32 + } +} + +type bpfSliceArrayBuff struct{ Buff [1024]uint8 } + +type bpfSpanContext struct { + TraceID [16]uint8 + SpanID [8]uint8 + TraceFlags uint8 + Padding [7]uint8 +} + +// loadBpf returns the embedded CollectionSpec for bpf. +func loadBpf() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_BpfBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load bpf: %w", err) + } + + return spec, err +} + +// loadBpfObjects loads bpf and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *bpfObjects +// *bpfPrograms +// *bpfMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadBpfObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadBpf() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// bpfSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfSpecs struct { + bpfProgramSpecs + bpfMapSpecs + bpfVariableSpecs +} + +// bpfProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfProgramSpecs struct { + UprobePipeDo *ebpf.ProgramSpec `ebpf:"uprobe_pipe_Do"` + UprobePipeDoReturns *ebpf.ProgramSpec `ebpf:"uprobe_pipe_Do_Returns"` +} + +// bpfMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfMapSpecs struct { + AllocMap *ebpf.MapSpec `ebpf:"alloc_map"` + Events *ebpf.MapSpec `ebpf:"events"` + GoContextToSc *ebpf.MapSpec `ebpf:"go_context_to_sc"` + ProbeActiveSamplerMap *ebpf.MapSpec `ebpf:"probe_active_sampler_map"` + RedisCompletedEvents *ebpf.MapSpec `ebpf:"redis_completed_events"` + SamplersConfigMap *ebpf.MapSpec `ebpf:"samplers_config_map"` + SliceArrayBuffMap *ebpf.MapSpec `ebpf:"slice_array_buff_map"` + TrackedSpansBySc *ebpf.MapSpec `ebpf:"tracked_spans_by_sc"` +} + +// bpfVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfVariableSpecs struct { + TCPAddrIP_offset *ebpf.VariableSpec `ebpf:"TCPAddr_IP_offset"` + TCPAddrPortOffset *ebpf.VariableSpec `ebpf:"TCPAddr_Port_offset"` + CompletedCsPos *ebpf.VariableSpec `ebpf:"completed_cs_pos"` + ConnFdPos *ebpf.VariableSpec `ebpf:"conn_fd_pos"` + CsS_pos *ebpf.VariableSpec `ebpf:"cs_s_pos"` + EndAddr *ebpf.VariableSpec `ebpf:"end_addr"` + FdRaddrPos *ebpf.VariableSpec `ebpf:"fd_raddr_pos"` + Hex *ebpf.VariableSpec `ebpf:"hex"` + IsRegistersAbi *ebpf.VariableSpec `ebpf:"is_registers_abi"` + MaxOprationLength *ebpf.VariableSpec `ebpf:"max_opration_length"` + PipeConnPos *ebpf.VariableSpec `ebpf:"pipe_conn_pos"` + ResultErrorPos *ebpf.VariableSpec `ebpf:"result_error_pos"` + StartAddr *ebpf.VariableSpec `ebpf:"start_addr"` + TcpAddrIpPos *ebpf.VariableSpec `ebpf:"tcp_addr_ip_pos"` + TcpAddrPortPos *ebpf.VariableSpec `ebpf:"tcp_addr_port_pos"` + TcpConnConnPos *ebpf.VariableSpec `ebpf:"tcp_conn_conn_pos"` + TotalCpus *ebpf.VariableSpec `ebpf:"total_cpus"` +} + +// bpfObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfObjects struct { + bpfPrograms + bpfMaps + bpfVariables +} + +func (o *bpfObjects) Close() error { + return _BpfClose( + &o.bpfPrograms, + &o.bpfMaps, + ) +} + +// bpfMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfMaps struct { + AllocMap *ebpf.Map `ebpf:"alloc_map"` + Events *ebpf.Map `ebpf:"events"` + GoContextToSc *ebpf.Map `ebpf:"go_context_to_sc"` + ProbeActiveSamplerMap *ebpf.Map `ebpf:"probe_active_sampler_map"` + RedisCompletedEvents *ebpf.Map `ebpf:"redis_completed_events"` + SamplersConfigMap *ebpf.Map `ebpf:"samplers_config_map"` + SliceArrayBuffMap *ebpf.Map `ebpf:"slice_array_buff_map"` + TrackedSpansBySc *ebpf.Map `ebpf:"tracked_spans_by_sc"` +} + +func (m *bpfMaps) Close() error { + return _BpfClose( + m.AllocMap, + m.Events, + m.GoContextToSc, + m.ProbeActiveSamplerMap, + m.RedisCompletedEvents, + m.SamplersConfigMap, + m.SliceArrayBuffMap, + m.TrackedSpansBySc, + ) +} + +// bpfVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfVariables struct { + TCPAddrIP_offset *ebpf.Variable `ebpf:"TCPAddr_IP_offset"` + TCPAddrPortOffset *ebpf.Variable `ebpf:"TCPAddr_Port_offset"` + CompletedCsPos *ebpf.Variable `ebpf:"completed_cs_pos"` + ConnFdPos *ebpf.Variable `ebpf:"conn_fd_pos"` + CsS_pos *ebpf.Variable `ebpf:"cs_s_pos"` + EndAddr *ebpf.Variable `ebpf:"end_addr"` + FdRaddrPos *ebpf.Variable `ebpf:"fd_raddr_pos"` + Hex *ebpf.Variable `ebpf:"hex"` + IsRegistersAbi *ebpf.Variable `ebpf:"is_registers_abi"` + MaxOprationLength *ebpf.Variable `ebpf:"max_opration_length"` + PipeConnPos *ebpf.Variable `ebpf:"pipe_conn_pos"` + ResultErrorPos *ebpf.Variable `ebpf:"result_error_pos"` + StartAddr *ebpf.Variable `ebpf:"start_addr"` + TcpAddrIpPos *ebpf.Variable `ebpf:"tcp_addr_ip_pos"` + TcpAddrPortPos *ebpf.Variable `ebpf:"tcp_addr_port_pos"` + TcpConnConnPos *ebpf.Variable `ebpf:"tcp_conn_conn_pos"` + TotalCpus *ebpf.Variable `ebpf:"total_cpus"` +} + +// bpfPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfPrograms struct { + UprobePipeDo *ebpf.Program `ebpf:"uprobe_pipe_Do"` + UprobePipeDoReturns *ebpf.Program `ebpf:"uprobe_pipe_Do_Returns"` +} + +func (p *bpfPrograms) Close() error { + return _BpfClose( + p.UprobePipeDo, + p.UprobePipeDoReturns, + ) +} + +func _BpfClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed bpf_arm64_bpfel.o +var _BpfBytes []byte diff --git a/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf_x86_bpfel.go b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf_x86_bpfel.go new file mode 100644 index 000000000..f728f142e --- /dev/null +++ b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/bpf_x86_bpfel.go @@ -0,0 +1,212 @@ +// Code generated by bpf2go; DO NOT EDIT. +//go:build 386 || amd64 + +package rueidis + +import ( + "bytes" + _ "embed" + "fmt" + "io" + + "github.com/cilium/ebpf" +) + +type bpfRueidisCompletedCommandT struct { + StartTime uint64 + EndTime uint64 + Sc bpfSpanContext + Psc bpfSpanContext + OperationName [20]int8 + LocalAddr struct { + Ip [16]uint8 + Port uint32 + } +} + +type bpfSliceArrayBuff struct{ Buff [1024]uint8 } + +type bpfSpanContext struct { + TraceID [16]uint8 + SpanID [8]uint8 + TraceFlags uint8 + Padding [7]uint8 +} + +// loadBpf returns the embedded CollectionSpec for bpf. +func loadBpf() (*ebpf.CollectionSpec, error) { + reader := bytes.NewReader(_BpfBytes) + spec, err := ebpf.LoadCollectionSpecFromReader(reader) + if err != nil { + return nil, fmt.Errorf("can't load bpf: %w", err) + } + + return spec, err +} + +// loadBpfObjects loads bpf and converts it into a struct. +// +// The following types are suitable as obj argument: +// +// *bpfObjects +// *bpfPrograms +// *bpfMaps +// +// See ebpf.CollectionSpec.LoadAndAssign documentation for details. +func loadBpfObjects(obj interface{}, opts *ebpf.CollectionOptions) error { + spec, err := loadBpf() + if err != nil { + return err + } + + return spec.LoadAndAssign(obj, opts) +} + +// bpfSpecs contains maps and programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfSpecs struct { + bpfProgramSpecs + bpfMapSpecs + bpfVariableSpecs +} + +// bpfProgramSpecs contains programs before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfProgramSpecs struct { + UprobePipeDo *ebpf.ProgramSpec `ebpf:"uprobe_pipe_Do"` + UprobePipeDoReturns *ebpf.ProgramSpec `ebpf:"uprobe_pipe_Do_Returns"` +} + +// bpfMapSpecs contains maps before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfMapSpecs struct { + AllocMap *ebpf.MapSpec `ebpf:"alloc_map"` + Events *ebpf.MapSpec `ebpf:"events"` + GoContextToSc *ebpf.MapSpec `ebpf:"go_context_to_sc"` + ProbeActiveSamplerMap *ebpf.MapSpec `ebpf:"probe_active_sampler_map"` + RedisCompletedEvents *ebpf.MapSpec `ebpf:"redis_completed_events"` + SamplersConfigMap *ebpf.MapSpec `ebpf:"samplers_config_map"` + SliceArrayBuffMap *ebpf.MapSpec `ebpf:"slice_array_buff_map"` + TrackedSpansBySc *ebpf.MapSpec `ebpf:"tracked_spans_by_sc"` +} + +// bpfVariableSpecs contains global variables before they are loaded into the kernel. +// +// It can be passed ebpf.CollectionSpec.Assign. +type bpfVariableSpecs struct { + TCPAddrIP_offset *ebpf.VariableSpec `ebpf:"TCPAddr_IP_offset"` + TCPAddrPortOffset *ebpf.VariableSpec `ebpf:"TCPAddr_Port_offset"` + CompletedCsPos *ebpf.VariableSpec `ebpf:"completed_cs_pos"` + ConnFdPos *ebpf.VariableSpec `ebpf:"conn_fd_pos"` + CsS_pos *ebpf.VariableSpec `ebpf:"cs_s_pos"` + EndAddr *ebpf.VariableSpec `ebpf:"end_addr"` + FdRaddrPos *ebpf.VariableSpec `ebpf:"fd_raddr_pos"` + Hex *ebpf.VariableSpec `ebpf:"hex"` + IsRegistersAbi *ebpf.VariableSpec `ebpf:"is_registers_abi"` + MaxOprationLength *ebpf.VariableSpec `ebpf:"max_opration_length"` + PipeConnPos *ebpf.VariableSpec `ebpf:"pipe_conn_pos"` + ResultErrorPos *ebpf.VariableSpec `ebpf:"result_error_pos"` + StartAddr *ebpf.VariableSpec `ebpf:"start_addr"` + TcpAddrIpPos *ebpf.VariableSpec `ebpf:"tcp_addr_ip_pos"` + TcpAddrPortPos *ebpf.VariableSpec `ebpf:"tcp_addr_port_pos"` + TcpConnConnPos *ebpf.VariableSpec `ebpf:"tcp_conn_conn_pos"` + TotalCpus *ebpf.VariableSpec `ebpf:"total_cpus"` +} + +// bpfObjects contains all objects after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfObjects struct { + bpfPrograms + bpfMaps + bpfVariables +} + +func (o *bpfObjects) Close() error { + return _BpfClose( + &o.bpfPrograms, + &o.bpfMaps, + ) +} + +// bpfMaps contains all maps after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfMaps struct { + AllocMap *ebpf.Map `ebpf:"alloc_map"` + Events *ebpf.Map `ebpf:"events"` + GoContextToSc *ebpf.Map `ebpf:"go_context_to_sc"` + ProbeActiveSamplerMap *ebpf.Map `ebpf:"probe_active_sampler_map"` + RedisCompletedEvents *ebpf.Map `ebpf:"redis_completed_events"` + SamplersConfigMap *ebpf.Map `ebpf:"samplers_config_map"` + SliceArrayBuffMap *ebpf.Map `ebpf:"slice_array_buff_map"` + TrackedSpansBySc *ebpf.Map `ebpf:"tracked_spans_by_sc"` +} + +func (m *bpfMaps) Close() error { + return _BpfClose( + m.AllocMap, + m.Events, + m.GoContextToSc, + m.ProbeActiveSamplerMap, + m.RedisCompletedEvents, + m.SamplersConfigMap, + m.SliceArrayBuffMap, + m.TrackedSpansBySc, + ) +} + +// bpfVariables contains all global variables after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfVariables struct { + TCPAddrIP_offset *ebpf.Variable `ebpf:"TCPAddr_IP_offset"` + TCPAddrPortOffset *ebpf.Variable `ebpf:"TCPAddr_Port_offset"` + CompletedCsPos *ebpf.Variable `ebpf:"completed_cs_pos"` + ConnFdPos *ebpf.Variable `ebpf:"conn_fd_pos"` + CsS_pos *ebpf.Variable `ebpf:"cs_s_pos"` + EndAddr *ebpf.Variable `ebpf:"end_addr"` + FdRaddrPos *ebpf.Variable `ebpf:"fd_raddr_pos"` + Hex *ebpf.Variable `ebpf:"hex"` + IsRegistersAbi *ebpf.Variable `ebpf:"is_registers_abi"` + MaxOprationLength *ebpf.Variable `ebpf:"max_opration_length"` + PipeConnPos *ebpf.Variable `ebpf:"pipe_conn_pos"` + ResultErrorPos *ebpf.Variable `ebpf:"result_error_pos"` + StartAddr *ebpf.Variable `ebpf:"start_addr"` + TcpAddrIpPos *ebpf.Variable `ebpf:"tcp_addr_ip_pos"` + TcpAddrPortPos *ebpf.Variable `ebpf:"tcp_addr_port_pos"` + TcpConnConnPos *ebpf.Variable `ebpf:"tcp_conn_conn_pos"` + TotalCpus *ebpf.Variable `ebpf:"total_cpus"` +} + +// bpfPrograms contains all programs after they have been loaded into the kernel. +// +// It can be passed to loadBpfObjects or ebpf.CollectionSpec.LoadAndAssign. +type bpfPrograms struct { + UprobePipeDo *ebpf.Program `ebpf:"uprobe_pipe_Do"` + UprobePipeDoReturns *ebpf.Program `ebpf:"uprobe_pipe_Do_Returns"` +} + +func (p *bpfPrograms) Close() error { + return _BpfClose( + p.UprobePipeDo, + p.UprobePipeDoReturns, + ) +} + +func _BpfClose(closers ...io.Closer) error { + for _, closer := range closers { + if err := closer.Close(); err != nil { + return err + } + } + return nil +} + +// Do not access this directly. +// +//go:embed bpf_x86_bpfel.o +var _BpfBytes []byte diff --git a/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/probe.go b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/probe.go new file mode 100644 index 000000000..dc6f7c999 --- /dev/null +++ b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/probe.go @@ -0,0 +1,178 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rueidis + +import ( + "fmt" + "log/slog" + "net" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/otel/attribute" + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" + "go.opentelemetry.io/otel/trace" + "golang.org/x/sys/unix" + + "go.opentelemetry.io/auto/internal/pkg/instrumentation/context" + "go.opentelemetry.io/auto/internal/pkg/instrumentation/probe" + "go.opentelemetry.io/auto/internal/pkg/instrumentation/utils" + "go.opentelemetry.io/auto/internal/pkg/structfield" +) + +//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -target amd64,arm64 bpf ./bpf/probe.bpf.c + +const ( + pkg = "github.com/redis/rueidis" +) + +var v4InV6Prefix = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff} + +func New(logger *slog.Logger, version string) probe.Probe { + id := probe.ID{ + SpanKind: trace.SpanKindClient, + InstrumentedPkg: pkg, + } + + uprobes := []*probe.Uprobe{ + { + Sym: "github.com/redis/rueidis.(*pipe).Do", + EntryProbe: "uprobe_pipe_Do", + ReturnProbe: "uprobe_pipe_Do_Returns", + PackageConstrainsts: []probe.PackageConstrainst{ + { + Package: "github.com/redis/rueidis", + FailureMode: probe.FailureModeIgnore, + }, + }, + }, + } + + // todo: does redis support distributed tracing? if yes, add propagation + + return &probe.SpanProducer[bpfObjects, event]{ + Base: probe.Base[bpfObjects, event]{ + ID: id, + Logger: logger, + Consts: []probe.Const{ + probe.RegistersABIConst{}, + probe.AllocationConst{}, + // to extract peer address data + probe.StructFieldConst{ + Key: "pipe_conn_pos", + Val: structfield.NewID(pkg, pkg, "pipe", "conn"), + }, + probe.StructFieldConst{ + Key: "tcp_conn_conn_pos", + Val: structfield.NewID("std", "net", "TCPConn", "conn"), + }, + probe.StructFieldConst{ + Key: "conn_fd_pos", + Val: structfield.NewID("std", "net", "conn", "fd"), + }, + probe.StructFieldConst{ + Key: "fd_raddr_pos", + Val: structfield.NewID("std", "net", "netFD", "raddr"), + }, + probe.StructFieldConst{ + Key: "tcp_addr_ip_pos", + Val: structfield.NewID("std", "net", "TCPAddr", "IP"), + }, + probe.StructFieldConst{ + Key: "tcp_addr_port_pos", + Val: structfield.NewID("std", "net", "TCPAddr", "Port"), + }, + // to extract command data + probe.StructFieldConst{ + Key: "completed_cs_pos", + Val: structfield.NewID(pkg, fmt.Sprintf("%s/%s", pkg, "internal/cmds"), "Completed", "cs"), + }, + probe.StructFieldConst{ + Key: "cs_s_pos", + Val: structfield.NewID(pkg, fmt.Sprintf("%s/%s", pkg, "internal/cmds"), "CommandSlice", "s"), + }, + // to extract response data + probe.StructFieldConst{ + Key: "result_error_pos", + Val: structfield.NewID(pkg, pkg, "RedisResult", "err"), + }, + }, + Uprobes: uprobes, + SpecFn: loadBpf, + }, + Version: version, + SchemaURL: semconv.SchemaURL, + ProcessFn: processFn, + } +} + +// event represents a kafka message received by the consumer. +type event struct { + context.BaseSpanProperties + + OperationName [20]byte + LocalAddr NetAddr +} + +type NetAddr struct { + IP [16]uint8 + Port int32 +} + +func processFn(e *event) ptrace.SpanSlice { + spans := ptrace.NewSpanSlice() + span := spans.AppendEmpty() + span.SetKind(ptrace.SpanKindClient) + span.SetStartTimestamp(utils.BootOffsetToTimestamp(e.StartTime)) + span.SetEndTimestamp(utils.BootOffsetToTimestamp(e.EndTime)) + span.SetTraceID(pcommon.TraceID(e.SpanContext.TraceID)) + span.SetSpanID(pcommon.SpanID(e.SpanContext.SpanID)) + span.SetFlags(uint32(trace.FlagsSampled)) + + operation := unix.ByteSliceToString(e.OperationName[:]) + span.SetName(fmt.Sprintf("%s %s", "cache", operation)) + + attrs := []attribute.KeyValue{} + + ip := parseU8SliceToIP(e.LocalAddr.IP) + + attrs = append(attrs, semconv.ServerAddress(ip.String())) + attrs = append(attrs, semconv.DBOperationName(operation)) + attrs = append(attrs, semconv.DBSystemRedis) + + // document: https://opentelemetry.io/docs/specs/semconv/database/redis/ + // span.Attributes().PutStr("db.namespace", "redis") // todo: hard to get as its set at the beginning of connection + // span.Attributes().PutStr("db.collection.name", "redis") // todo: maybe for zget, hget, mget and stuff? + // span.Attributes().PutStr("db.response.status_code", "redis") // todo + // span.Attributes().PutStr("error.type", "redis") // todo: later + // span.Attributes().PutStr("db.query.text", "redis") // todo + + utils.Attributes(span.Attributes(), attrs...) + + if e.ParentSpanContext.SpanID.IsValid() { + span.SetParentSpanID(pcommon.SpanID(e.ParentSpanContext.SpanID)) + } + + return spans +} + +func parseU8SliceToIP(raw [16]uint8) net.IP { + ip := make(net.IP, len(raw)) + copy(ip, raw[:]) + + if isZeros(raw[4:16]) { + copy(ip[12:16], raw[0:4]) + copy(ip[0:12], v4InV6Prefix) + } + return ip +} + +func isZeros(p net.IP) bool { + for i := 0; i < len(p); i++ { + if p[i] != 0 { + return false + } + } + return true +} diff --git a/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/probe_test.go b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/probe_test.go new file mode 100644 index 000000000..145f7c1bc --- /dev/null +++ b/internal/pkg/instrumentation/bpf/github.com/redis/rueidis/probe_test.go @@ -0,0 +1,79 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rueidis + +import ( + "testing" + "time" + + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/otel/trace" + + "go.opentelemetry.io/auto/internal/pkg/instrumentation/context" + "go.opentelemetry.io/auto/internal/pkg/instrumentation/utils" + + "github.com/stretchr/testify/assert" + + semconv "go.opentelemetry.io/otel/semconv/v1.26.0" +) + +func TestProbeConvertEvent(t *testing.T) { + start := time.Unix(0, time.Now().UnixNano()) // No wall clock. + end := start.Add(1 * time.Second) + + startOffset := utils.TimeToBootOffset(start) + endOffset := utils.TimeToBootOffset(end) + + traceID := trace.TraceID{1} + spanID := trace.SpanID{1} + + testCases := []struct { + name string + event *event + expected ptrace.SpanSlice + }{ + { + name: "basic get test", + event: &event{ + BaseSpanProperties: context.BaseSpanProperties{ + StartTime: startOffset, + EndTime: endOffset, + SpanContext: context.EBPFSpanContext{TraceID: traceID, SpanID: spanID}, + }, + OperationName: [20]byte{0x47, 0x45, 0x54}, + LocalAddr: NetAddr{ + IP: [16]uint8{172, 20, 0, 3}, + Port: 6379, + }, + }, + expected: func() ptrace.SpanSlice { + spans := ptrace.NewSpanSlice() + span := spans.AppendEmpty() + span.SetName("cache GET") + span.SetKind(ptrace.SpanKindClient) + span.SetStartTimestamp(utils.BootOffsetToTimestamp(startOffset)) + span.SetEndTimestamp(utils.BootOffsetToTimestamp(endOffset)) + span.SetTraceID(pcommon.TraceID(traceID)) + span.SetSpanID(pcommon.SpanID(spanID)) + span.SetFlags(uint32(trace.FlagsSampled)) + utils.Attributes( + span.Attributes(), + semconv.ServerAddress("172.20.0.3"), + semconv.DBOperationName("GET"), + semconv.DBSystemRedis, + ) + + return spans + }(), + }, + } + + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + out := processFn(tt.event) + assert.Equal(t, tt.expected, out) + }) + } +} diff --git a/internal/pkg/instrumentation/manager.go b/internal/pkg/instrumentation/manager.go index 8fcf9e3f2..1d6afa3de 100644 --- a/internal/pkg/instrumentation/manager.go +++ b/internal/pkg/instrumentation/manager.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/otel/trace" dbSql "go.opentelemetry.io/auto/internal/pkg/instrumentation/bpf/database/sql" + rueidisProbe "go.opentelemetry.io/auto/internal/pkg/instrumentation/bpf/github.com/redis/rueidis" kafkaConsumer "go.opentelemetry.io/auto/internal/pkg/instrumentation/bpf/github.com/segmentio/kafka-go/consumer" kafkaProducer "go.opentelemetry.io/auto/internal/pkg/instrumentation/bpf/github.com/segmentio/kafka-go/producer" autosdk "go.opentelemetry.io/auto/internal/pkg/instrumentation/bpf/go.opentelemetry.io/auto/sdk" @@ -420,6 +421,7 @@ func (m *Manager) availableProbes() []probe.Probe { kafkaProducer.New(m.logger, m.version), kafkaConsumer.New(m.logger, m.version), autosdk.New(m.logger), + rueidisProbe.New(m.logger, m.version), } if m.globalImpl { diff --git a/internal/tools/inspect/cmd/offsetgen/main.go b/internal/tools/inspect/cmd/offsetgen/main.go index 17f841f8a..b879e23c5 100644 --- a/internal/tools/inspect/cmd/offsetgen/main.go +++ b/internal/tools/inspect/cmd/offsetgen/main.go @@ -75,6 +75,11 @@ func manifests() ([]inspect.Manifest, error) { return nil, fmt.Errorf("failed to get \"github.com/segmentio/kafka-go\" versions: %w", err) } + rueidisVers, err := PkgVersions("github.com/redis/rueidis") + if err != nil { + return nil, fmt.Errorf("failed to get \"github.com/redis/rueidis\" versions: %w", err) + } + ren := func(src string) inspect.Renderer { return inspect.NewRenderer(logger, src, inspect.DefaultFS) } @@ -125,6 +130,9 @@ func manifests() ([]inspect.Manifest, error) { structfield.NewID("std", "bufio", "Writer", "n"), structfield.NewID("std", "net", "TCPAddr", "IP"), structfield.NewID("std", "net", "TCPAddr", "Port"), + structfield.NewID("std", "net", "netFD", "raddr"), + structfield.NewID("std", "net", "conn", "fd"), + structfield.NewID("std", "net", "TCPConn", "conn"), }, }, { @@ -192,6 +200,18 @@ func manifests() ([]inspect.Manifest, error) { structfield.NewID("github.com/segmentio/kafka-go", "github.com/segmentio/kafka-go", "Conn", "clientID"), }, }, + { + Application: inspect.Application{ + Renderer: ren("templates/github.com/redis/rueidis/*.tmpl"), + Versions: rueidisVers, + }, + StructFields: []structfield.ID{ + structfield.NewID("github.com/redis/rueidis", "github.com/redis/rueidis/internal/cmds", "Completed", "cs"), + structfield.NewID("github.com/redis/rueidis", "github.com/redis/rueidis/internal/cmds", "CommandSlice", "s"), + structfield.NewID("github.com/redis/rueidis", "github.com/redis/rueidis", "RedisResult", "err"), + structfield.NewID("github.com/redis/rueidis", "github.com/redis/rueidis", "pipe", "conn"), + }, + }, }, nil } diff --git a/internal/tools/inspect/render.go b/internal/tools/inspect/render.go index 8280a9758..ef316272a 100644 --- a/internal/tools/inspect/render.go +++ b/internal/tools/inspect/render.go @@ -19,6 +19,7 @@ import ( //go:embed templates/runtime/*.tmpl //go:embed templates/go.opentelemetry.io/otel/traceglobal/*.tmpl //go:embed templates/github.com/segmentio/kafka-go/*.tmpl +//go:embed templates/github.com/redis/rueidis/*.tmpl var DefaultFS embed.FS // Renderer renders templates from an fs.FS. diff --git a/internal/tools/inspect/templates/github.com/redis/rueidis/go.mod.tmpl b/internal/tools/inspect/templates/github.com/redis/rueidis/go.mod.tmpl new file mode 100644 index 000000000..f88c45b6a --- /dev/null +++ b/internal/tools/inspect/templates/github.com/redis/rueidis/go.mod.tmpl @@ -0,0 +1,7 @@ +module grpcapp + +go 1.12 + +require github.com/redis/rueidis {{ .Version }} + +require golang.org/x/sys v0.17.0 // indirect diff --git a/internal/tools/inspect/templates/github.com/redis/rueidis/main.go.tmpl b/internal/tools/inspect/templates/github.com/redis/rueidis/main.go.tmpl new file mode 100644 index 000000000..cacb0fcff --- /dev/null +++ b/internal/tools/inspect/templates/github.com/redis/rueidis/main.go.tmpl @@ -0,0 +1,7 @@ +package main + +import ( + _ "github.com/redis/rueidis" +) + +func main() {}