Skip to content

Commit

Permalink
remove non-contrib packages and add aut-instrumented
Browse files Browse the repository at this point in the history
  • Loading branch information
quinna-h committed Dec 26, 2024
1 parent 6613235 commit 5583f81
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 98 deletions.
2 changes: 0 additions & 2 deletions integration_go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ require (
github.com/gocql/gocql v1.6.0
github.com/gofiber/fiber/v2 v2.52.5
github.com/gomodule/redigo v1.8.9
github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b
github.com/google/uuid v1.5.0
github.com/gorilla/mux v1.8.0
github.com/graph-gophers/graphql-go v1.5.0
github.com/graphql-go/graphql v0.8.1
github.com/graphql-go/handler v0.2.3
github.com/hashicorp/consul/api v1.24.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7
github.com/hashicorp/vault/api v1.9.2
github.com/hashicorp/vault/sdk v0.9.2
github.com/jackc/pgx/v5 v5.6.0
Expand Down
65 changes: 56 additions & 9 deletions parse_go_mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ type ModuleVersion struct {
Name string
MinVersion string
MaxVersion string
isInstrumented bool

}

func parseGoMod(filePath string) ([]ModuleVersion, error) {
Expand Down Expand Up @@ -89,16 +91,17 @@ func fetchLatestVersion(module string) (string, error) {
}

versions := strings.Fields(stdout.String())
fmt.Println("Versions:", versions)
if len(versions) < 1 {
return "", fmt.Errorf("no versions found for module: %s", module)
}

return versions[len(versions)-1], nil
}

func fetchAllLatestVersions(modules []ModuleVersion) []ModuleVersion {
func fetchAllLatestVersions(modules []ModuleVersion, instrumentedSet map[string]struct{}) []ModuleVersion {
// Concurrently fetches the latest version of each module.

var wg sync.WaitGroup
var mu sync.Mutex

Expand All @@ -108,16 +111,20 @@ func fetchAllLatestVersions(modules []ModuleVersion) []ModuleVersion {
for _, mod := range modules {
go func(mod ModuleVersion) {
defer wg.Done()
fmt.Printf("Fetching latest version for module: %s\n", mod.Name)
latestVersion, err := fetchLatestVersion(mod.Name)
if err != nil {
fmt.Printf("Error fetching latest version for %s: %v\n", mod.Name, err)
mu.Lock()
updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, "Error"})
updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, "Error", false})
mu.Unlock()
return
}
_, isInstrumented := instrumentedSet[mod.Name]

mu.Lock()
updatedModules = append(updatedModules, ModuleVersion{mod.Name, mod.MinVersion, latestVersion})
updatedModules = append(updatedModules, ModuleVersion{mod.Name,
mod.MinVersion, latestVersion, isInstrumented})
mu.Unlock()
}(mod)
}
Expand All @@ -133,25 +140,65 @@ func outputVersionsAsMarkdown(modules []ModuleVersion, filePath string) error {
}
defer file.Close()

fmt.Fprintln(file, "| Dependency | Minimum Version | Maximum Version |")
fmt.Fprintln(file, "|------------|-----------------|-----------------|")
fmt.Fprintln(file, "| Dependency | Minimum Version | Maximum Version | Auto-Instrumented |")
fmt.Fprintln(file, "|------------|-----------------|-----------------|-----------------|")
for _, mod := range modules {
fmt.Fprintf(file, "| %s | v%s | %s |\n", mod.Name, mod.MinVersion, mod.MaxVersion)
fmt.Fprintf(file, "| %s | v%s | %s | %+v\n", mod.Name, mod.MinVersion, mod.MaxVersion, mod.isInstrumented)
}
return nil
}

func main() {
goModPath := "integration_go.mod" // Modify path as needed
outputPath := "minimum_versions.md"
outputPath := "supported_versions.md"
instrumentedSet := map[string]struct{}{
"database/sql": {},
"github.com/gin-gonic/gin": {},
"github.com/go-chi/chi/v5": {},
"github.com/go-chi/chi": {},
"github.com/go-redis/redis/v7": {},
"github.com/go-redis/redis/v8": {},
"github.com/gofiber/fiber/v2": {},
"github.com/gomodule/redigo/redis": {},
"github.com/gorilla/mux": {},
"github.com/jinzhu/gorm": {},
"github.com/labstack/echo/v4": {},
"google.golang.org/grpc": {},
"gorm.io/gorm": {},
"net/http": {},
"go.mongodb.org/mongo-driver/mongo": {},
"github.com/aws-sdk-go/aws": {},
"github.com/hashicorp/vault": {},
"github.com/IBM/sarama": {},
"github.com/Shopify/sarama": {},
"k8s.io/client-go": {},
"log/slog": {},
"os": {},
"github.com/aws/aws-sdk-go-v2": {},
"github.com/redis/go-redis/v9": {},
"github.com/gocql/gocql": {},
"cloud.google.com/go/pubsub": {},
"github.com/99designs/gqlgen": {},
"github.com/redis/go-redis": {},
"github.com/graph-gophers/graphql-go": {},
"github.com/graphql-go/graphql": {},
"github.com/jackc/pgx": {},
"github.com/elastic/go-elasticsearch": {},
"github.com/twitchtv/twirp": {},
"github.com/segmentio/kafka-go": {},
"github.com/confluentinc/confluent-kafka-go/kafka": {},
"github.com/confluentinc/confluent-kafka-go/kafka/v2": {},
"github.com/julienschmidt/httprouter": {},
"github.com/sirupsen/logrus": {},
}

modules, err := parseGoMod(goModPath)
if err != nil {
fmt.Println(err)
return
}

modulesWithLatest := fetchAllLatestVersions(modules)
modulesWithLatest := fetchAllLatestVersions(modules, instrumentedSet)

err = outputVersionsAsMarkdown(modulesWithLatest, outputPath)
if err != nil {
Expand Down
172 changes: 85 additions & 87 deletions supported_versions.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,85 @@
| Dependency | Minimum Version | Maximum Version |
|------------|-----------------|-----------------|
| github.com/go-chi/chi/v5 | v5.0.10 | v5.2.0 |
| github.com/tidwall/buntdb | v1.3.0 | v1.3.2 |
| github.com/go-redis/redis/v7 | v7.4.1 | v7.4.1 |
| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 |
| github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible |
| github.com/IBM/sarama | v1.40.0 | v1.43.3 |
| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 |
| github.com/globalsign/mgo | v0.0.0-20181015135952-eeefdecb41b8 | github.com/globalsign/mgo |
| github.com/denisenkom/go-mssqldb | v0.11.0 | v0.12.3 |
| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 |
| github.com/graphql-go/handler | v0.2.3 | v0.2.4 |
| github.com/gocql/gocql | v1.6.0 | v1.7.0 |
| github.com/Shopify/sarama | v1.38.1 | v1.43.3 |
| github.com/google/pprof | v0.0.0-20230817174616-7a8ec2ada47b | github.com/google/pprof |
| github.com/go-redis/redis/v8 | v8.11.5 | v8.11.5 |
| github.com/jinzhu/gorm | v1.9.16 | v1.9.16 |
| github.com/google/uuid | v1.5.0 | v1.6.0 |
| github.com/syndtr/goleveldb | v1.0.1-0.20220721030215-126854af5e6d | v1.0.0 |
| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 |
| github.com/go-pg/pg/v10 | v10.11.1 | v10.14.0 |
| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 |
| github.com/lib/pq | v1.10.2 | v1.10.9 |
| github.com/sirupsen/logrus | v1.9.3 | v1.9.3 |
| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 |
| github.com/go-sql-driver/mysql | v1.6.0 | v1.8.1 |
| github.com/emicklei/go-restful/v3 | v3.11.0 | v3.12.1 |
| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 |
| gorm.io/driver/postgres | v1.4.6 | v1.5.11 |
| github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 |
| github.com/urfave/negroni | v1.0.0 | v1.0.0 |
| google.golang.org/protobuf | v1.33.0 | v1.36.1 |
| github.com/redis/go-redis/v9 | v9.7.0 | v9.7.0 |
| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 |
| github.com/garyburd/redigo | v1.6.4 | v1.6.4 |
| github.com/gomodule/redigo | v1.8.9 | v1.9.2 |
| go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.44.0 | v0.58.0 |
| google.golang.org/api | v0.128.0 | v0.214.0 |
| gopkg.in/jinzhu/gorm.v1 | v1.9.2 | v1.9.2 |
| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 |
| github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible |
| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 |
| github.com/mattn/go-sqlite3 | v1.14.18 | v1.14.24 |
| k8s.io/client-go | v0.23.17 | v0.33.0-alpha.0 |
| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 |
| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 |
| gorm.io/driver/mysql | v1.0.1 | v1.5.7 |
| github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible |
| gopkg.in/olivere/elastic.v5 | v5.0.84 | v5.0.86 |
| gopkg.in/olivere/elastic.v3 | v3.0.75 | v3.0.75 |
| github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 |
| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 |
| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 |
| github.com/hashicorp/go-secure-stdlib/parseutil | v0.1.7 | v0.1.8 |
| google.golang.org/grpc | v1.57.1 | v1.70.0-dev |
| github.com/go-redis/redis | v6.15.9+incompatible | v6.15.9+incompatible |
| gorm.io/driver/sqlserver | v1.4.2 | v1.5.4 |
| cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 |
| github.com/uptrace/bun | v1.1.17 | v1.2.6 |
| github.com/gorilla/mux | v1.8.0 | v1.8.1 |
| github.com/go-chi/chi | v1.5.4 | v4.1.2+incompatible |
| gorm.io/gorm | v1.25.3 | v1.25.12 |
| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 |
| github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 |
| github.com/zenazn/goji | v1.0.1 | v1.0.1 |
| github.com/miekg/dns | v1.1.55 | v1.1.62 |
| github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.20 |
| github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 |
| github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 |
| github.com/segmentio/kafka-go | v0.4.42 | v0.4.47 |
| github.com/labstack/echo | v3.3.10+incompatible | v3.3.10+incompatible |
| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 |
| github.com/graph-gophers/graphql-go | v1.5.0 | v1.5.0 |
| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 |
| github.com/graphql-go/graphql | v0.8.1 | v0.8.1 |
| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 |
| github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache |
| github.com/labstack/echo/v4 | v4.11.1 | v4.13.3 |
| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 |
| github.com/julienschmidt/httprouter | v1.3.0 | v1.3.0 |
| github.com/microsoft/go-mssqldb | v0.21.0 | v1.8.0 |
| github.com/jmoiron/sqlx | v1.3.5 | v1.4.0 |
| go.mongodb.org/mongo-driver | v1.12.1 | v1.17.1 |
| github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 |
| github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 |
| github.com/valyala/fasthttp | v1.51.0 | v1.58.0 |
| Dependency | Minimum Version | Maximum Version | Auto-Instrumented |
|------------|-----------------|-----------------|-----------------|
| github.com/go-chi/chi/v5 | v5.0.10 | v5.2.0 | true
| go.mongodb.org/mongo-driver | v1.12.1 | v1.17.1 | false
| github.com/sirupsen/logrus | v1.9.3 | v1.9.3 | true
| github.com/aws/aws-sdk-go-v2/service/dynamodb | v1.21.4 | v1.38.1 | false
| github.com/tidwall/buntdb | v1.3.0 | v1.3.2 | false
| github.com/aws/aws-sdk-go-v2/config | v1.18.21 | v1.28.7 | false
| github.com/go-pg/pg/v10 | v10.11.1 | v10.14.0 | false
| github.com/graphql-go/handler | v0.2.3 | v0.2.4 | false
| github.com/jackc/pgx/v5 | v5.6.0 | v5.7.2 | false
| github.com/denisenkom/go-mssqldb | v0.11.0 | v0.12.3 | false
| github.com/emicklei/go-restful/v3 | v3.11.0 | v3.12.1 | false
| github.com/go-sql-driver/mysql | v1.6.0 | v1.8.1 | false
| github.com/gomodule/redigo | v1.8.9 | v1.9.2 | false
| github.com/jinzhu/gorm | v1.9.16 | v1.9.16 | true
| github.com/miekg/dns | v1.1.55 | v1.1.62 | false
| github.com/gin-gonic/gin | v1.9.1 | v1.10.0 | true
| github.com/aws/aws-sdk-go-v2/service/s3 | v1.32.0 | v1.71.1 | false
| github.com/confluentinc/confluent-kafka-go | v1.9.2 | v1.9.3-RC3 | false
| github.com/go-redis/redis | v6.15.9+incompatible | v6.15.9+incompatible | false
| cloud.google.com/go/pubsub | v1.33.0 | v1.45.3 | true
| github.com/jmoiron/sqlx | v1.3.5 | v1.4.0 | false
| github.com/julienschmidt/httprouter | v1.3.0 | v1.3.0 | true
| gorm.io/driver/sqlserver | v1.4.2 | v1.5.4 | false
| github.com/aws/aws-sdk-go-v2/service/kinesis | v1.18.4 | v1.32.8 | false
| github.com/graphql-go/graphql | v0.8.1 | v0.8.1 | true
| github.com/aws/aws-sdk-go-v2 | v1.20.3 | v2.0.0-preview.4+incompatible | true
| github.com/go-redis/redis/v8 | v8.11.5 | v8.11.5 | true
| github.com/aws/aws-sdk-go | v1.44.327 | v1.55.5 | false
| github.com/go-redis/redis/v7 | v7.4.1 | v7.4.1 | true
| github.com/hashicorp/vault/sdk | v0.9.2 | v0.14.0 | false
| github.com/IBM/sarama | v1.40.0 | v1.43.3 | true
| github.com/valyala/fasthttp | v1.51.0 | v1.58.0 | false
| github.com/segmentio/kafka-go | v0.4.42 | v0.4.47 | true
| github.com/elastic/go-elasticsearch/v6 | v6.8.5 | v6.8.10 | false
| github.com/microsoft/go-mssqldb | v0.21.0 | v1.8.0 | false
| github.com/confluentinc/confluent-kafka-go/v2 | v2.2.0 | v2.6.1 | false
| github.com/bradfitz/gomemcache | v0.0.0-20230611145640-acc696258285 | github.com/bradfitz/gomemcache | false
| github.com/zenazn/goji | v1.0.1 | v1.0.1 | false
| gopkg.in/olivere/elastic.v5 | v5.0.84 | v5.0.86 | false
| github.com/garyburd/redigo | v1.6.4 | v1.6.4 | false
| github.com/aws/aws-sdk-go-v2/service/sfn | v1.19.4 | v1.34.2 | false
| github.com/redis/go-redis/v9 | v9.7.0 | v9.7.0 | true
| gorm.io/driver/postgres | v1.4.6 | v1.5.11 | false
| github.com/vektah/gqlparser/v2 | v2.5.16 | v2.5.21 | false
| github.com/99designs/gqlgen | v0.17.36 | v0.17.61 | true
| gorm.io/gorm | v1.25.3 | v1.25.12 | true
| github.com/twitchtv/twirp | v8.1.3+incompatible | v8.1.3+incompatible | true
| google.golang.org/protobuf | v1.33.0 | v1.36.1 | false
| github.com/go-chi/chi | v1.5.4 | v4.1.2+incompatible | true
| github.com/hashicorp/go-multierror | v1.1.1 | v1.1.1 | false
| k8s.io/client-go | v0.23.17 | v0.33.0-alpha.0 | true
| github.com/syndtr/goleveldb | v1.0.1-0.20220721030215-126854af5e6d | v1.0.0 | false
| github.com/hashicorp/consul/api | v1.24.0 | v1.31.0 | false
| github.com/go-redis/redis/v9 | v9.7.0 // renamed to redis/go-redis in v9 | v9.7.0 | false
| github.com/globalsign/mgo | v0.0.0-20181015135952-eeefdecb41b8 | github.com/globalsign/mgo | false
| github.com/aws/aws-sdk-go-v2/service/sns | v1.21.4 | v1.33.8 | false
| gopkg.in/jinzhu/gorm.v1 | v1.9.2 | v1.9.2 | false
| github.com/aws/aws-sdk-go-v2/service/ec2 | v1.93.2 | v1.198.1 | false
| github.com/elastic/go-elasticsearch/v8 | v8.15.0 | v8.17.0 | false
| github.com/elastic/go-elasticsearch/v7 | v7.17.10 | v7.17.10 | false
| github.com/mattn/go-sqlite3 | v1.14.18 | v1.14.24 | false
| github.com/urfave/negroni | v1.0.0 | v1.0.0 | false
| github.com/graph-gophers/graphql-go | v1.5.0 | v1.5.0 | true
| github.com/lib/pq | v1.10.2 | v1.10.9 | false
| github.com/uptrace/bun/dialect/sqlitedialect | v1.1.17 | v1.2.6 | false
| github.com/labstack/echo | v3.3.10+incompatible | v3.3.10+incompatible | false
| github.com/dimfeld/httptreemux/v5 | v5.5.0 | v5.5.0 | false
| gorm.io/driver/mysql | v1.0.1 | v1.5.7 | false
| github.com/aws/aws-sdk-go-v2/service/eventbridge | v1.20.4 | v1.36.1 | false
| gopkg.in/olivere/elastic.v3 | v3.0.75 | v3.0.75 | false
| github.com/Shopify/sarama | v1.38.1 | v1.43.3 | true
| google.golang.org/api | v0.128.0 | v0.214.0 | false
| github.com/uptrace/bun | v1.1.17 | v1.2.6 | false
| go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp | v0.44.0 | v0.58.0 | false
| google.golang.org/grpc | v1.57.1 | v1.70.0-dev | true
| github.com/gofiber/fiber/v2 | v2.52.5 | v2.52.5 | true
| github.com/emicklei/go-restful | v2.16.0+incompatible | v2.16.0+incompatible | false
| github.com/google/uuid | v1.5.0 | v1.6.0 | false
| github.com/gocql/gocql | v1.6.0 | v1.7.0 | true
| github.com/aws/aws-sdk-go-v2/service/sqs | v1.24.4 | v1.37.3 | false
| github.com/labstack/echo/v4 | v4.11.1 | v4.13.3 | true
| github.com/gorilla/mux | v1.8.0 | v1.8.1 | true
| github.com/hashicorp/vault/api | v1.9.2 | v1.15.0 | false

0 comments on commit 5583f81

Please sign in to comment.