From 3e1df6ea69e490adc8ed354b56e7b6aec7507b03 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Mon, 30 Sep 2024 07:42:31 -0700 Subject: [PATCH 01/17] Add local e2e test runner --- go.mod | 28 ++++++- go.sum | 82 +++++++++++++++++++- internal/test/runner/main.go | 140 +++++++++++++++++++++++++++++++++++ 3 files changed, 246 insertions(+), 4 deletions(-) create mode 100644 internal/test/runner/main.go diff --git a/go.mod b/go.mod index fce2d0a8e..876410548 100644 --- a/go.mod +++ b/go.mod @@ -18,8 +18,10 @@ retract ( ) require ( + github.com/MrAlias/collex v0.0.5-alpha github.com/cilium/ebpf v0.17.1 github.com/hashicorp/go-version v1.7.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.10.0 github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 @@ -39,23 +41,43 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.11 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.1.2 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.61.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/confmap v1.21.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/exporter v0.115.0 // indirect + go.opentelemetry.io/collector/extension v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect go.opentelemetry.io/contrib/bridges/prometheus v0.58.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.9.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.9.0 // indirect @@ -73,9 +95,11 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.33.0 // indirect go.opentelemetry.io/proto/otlp v1.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect google.golang.org/protobuf v1.36.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/go.sum b/go.sum index a3cad8ef3..1de134d94 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/MrAlias/collex v0.0.5-alpha h1:TCtwyrWgr7SCH9HAP3+oO/noee5Upot2VR5RS1vX+dE= +github.com/MrAlias/collex v0.0.5-alpha/go.mod h1:IowxHLoDBQs1hFD2L2MXpzannTxjLLkibqf8hVIZ3cQ= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= @@ -7,8 +9,9 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cilium/ebpf v0.17.1 h1:G8mzU81R2JA1nE5/8SRubzqvBMmAmri2VL8BIZPWvV0= github.com/cilium/ebpf v0.17.1/go.mod h1:vay2FaYSmIlv3r8dNACd4mW/OCaZLJKJOo+IHBvCIO8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -16,6 +19,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= @@ -29,6 +34,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3Ar github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/jsimonetti/rtnetlink/v2 v2.0.1 h1:xda7qaHDSVOsADNouv7ukSuicKZO7GgVUCXxpaIEIlM= @@ -39,6 +46,12 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.1.2 h1:I2rtLRqXRy1p01m/utEtpZSSA6dcJbgGVuE27kW2PzQ= +github.com/knadh/koanf/v2 v2.1.2/go.mod h1:Gphfaen0q1Fc1HTgJgSTC4oRX9R2R5ErYMZJy8fLJBo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -49,6 +62,10 @@ github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/ github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw= github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -56,10 +73,21 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0 h1:sVfc/ND4/Bp+r1U3zCucxz4U4kG0D4DpHnkJh8SCcxs= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0/go.mod h1:X32RUqZJR51cpTFxrnNvRQaS9zRW3BA8+ul+CzlvGUU= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.115.0 h1:cmSOl8dexYz8/ZQGSYyGmeNgo3bxxDFuWQQ+XazbmL8= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.115.0/go.mod h1:qP0oNxkFOJqFZY6uGFJarhWziI+aqsov/0IRJkL85vg= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.115.0 h1:OmwyS3i+UFENIQizvmeC9kBtT1Rdchbeo0Ksl8ZNcGQ= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.115.0/go.mod h1:Z3VC/J++bjSNkzOJ2yDbBUBxA+nYi7Juk3p1dCsiKE4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 h1:MuyDWyVoCty8HyP2CAYoRZXwINiThHovcC1Bj3+H8lk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0/go.mod h1:asekVnrdzYsMJBaJtIyXOt8p07l1x0xs8X3h00sZyf0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= @@ -80,8 +108,54 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/debugexporter v0.112.0 h1:Suz/1SdAyeY+UPKJDt9RuWGxUOu8p2P6bhuon00VhGU= +go.opentelemetry.io/collector/exporter/debugexporter v0.112.0/go.mod h1:DVhlqmbajKH3JjJuW727d7FUkkLhyY/QcaL1xn9NREk= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= go.opentelemetry.io/collector/pdata v1.22.0 h1:3yhjL46NLdTMoP8rkkcE9B0pzjf2973crn0KKhX5UrI= go.opentelemetry.io/collector/pdata v1.22.0/go.mod h1:nLLf6uDg8Kn5g3WNZwGyu8+kf77SwOqQvMTb5AXEbEY= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= go.opentelemetry.io/contrib/bridges/prometheus v0.58.0 h1:gQFwWiqm4JUvOjpdmyU0di+2pVQ8QNpk1Ak/54Y6NcY= go.opentelemetry.io/contrib/bridges/prometheus v0.58.0/go.mod h1:CNyFi9PuvHtEJNmMFHaXZMuA4XmgRXIqpFcHdqzLvVU= go.opentelemetry.io/contrib/exporters/autoexport v0.58.0 h1:qVsDVgZd/bC6ZKDOHSjILpm0T/BWvASC9cQU3GYga78= @@ -128,6 +202,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -174,5 +250,7 @@ google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= 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/internal/test/runner/main.go b/internal/test/runner/main.go new file mode 100644 index 000000000..3aad8246c --- /dev/null +++ b/internal/test/runner/main.go @@ -0,0 +1,140 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "context" + "flag" + "log/slog" + "os" + "os/exec" + "os/signal" + "syscall" + + "github.com/MrAlias/collex" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" + "go.opentelemetry.io/otel/sdk/trace" + + "go.opentelemetry.io/auto" +) + +func main() { + logLevel := flag.String("log-level", "debug", `logging level ("debug", "info", "warn", "error")`) + binPath := flag.String("bin", "", "Path to the target binary") + flag.Parse() + + logger := newLogger(*logLevel) + + if *binPath == "" { + logger.Error("Missing target binary. Please provide a target binary path using the -bin flag") + os.Exit(1) + } + + // Trap Ctrl+C and SIGTERM and call cancel on the context. + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + + app := App{logger: logger} + if err := app.Run(ctx, *binPath); err != nil { + logger.Error("failed to run", "error", err) + os.Exit(1) + } +} + +func newLogger(lvlStr string) *slog.Logger { + levelVar := new(slog.LevelVar) // Default value of info. + opts := &slog.HandlerOptions{AddSource: true, Level: levelVar} + h := slog.NewJSONHandler(os.Stderr, opts) + logger := slog.New(h) + + if lvlStr == "" { + return logger + } + + var level slog.Level + if err := level.UnmarshalText([]byte(lvlStr)); err != nil { + logger.Error("failed to parse log level", "error", err, "log-level", lvlStr) + } else { + levelVar.Set(level) + } + + return logger +} + +type App struct { + logger *slog.Logger +} + +func (a *App) Run(ctx context.Context, binPath string) error { + exp, err := a.newExporter(ctx) + if err != nil { + return err + } + + cmd := exec.Command(binPath) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + + if err := cmd.Start(); err != nil { + return err + } + + loadedIndicator := make(chan struct{}) + inst, err := auto.NewInstrumentation( + ctx, + auto.WithTraceExporter(exp), + auto.WithPID(cmd.Process.Pid), + auto.WithServiceName("testing"), + auto.WithGlobal(), + auto.WithLoadedIndicator(loadedIndicator), + auto.WithLogger(a.logger), + ) + if err != nil { + return err + } + + errCh := make(chan error, 1) + go func() { + errCh <- inst.Run(ctx) + close(errCh) + }() + + select { + case <-ctx.Done(): + return ctx.Err() + case <-loadedIndicator: + } + + var sig os.Signal = syscall.SIGCONT + a.logger.Debug("sending signal to target") + cmd.Process.Signal(sig) + a.logger.Debug("sent signal to target") + + done := make(chan struct{}) + go func() { + cmd.Wait() + close(done) + }() + + select { + case <-ctx.Done(): + return ctx.Err() + case err := <-errCh: + return err + case <-done: + } + + return inst.Close() +} + +func (a *App) newExporter(ctx context.Context) (trace.SpanExporter, error) { + f := fileexporter.NewFactory() + factory, err := collex.NewFactory(f, nil) + if err != nil { + return nil, err + } + c := f.CreateDefaultConfig().(*fileexporter.Config) + c.Path = "traces.json" + return factory.SpanExporter(ctx, c) +} From 2c997376e1678bbef988a9e5934c3c937fdbb4e8 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Mon, 30 Sep 2024 07:43:44 -0700 Subject: [PATCH 02/17] Update autosdk to wait for signal --- internal/test/e2e/autosdk/main.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/internal/test/e2e/autosdk/main.go b/internal/test/e2e/autosdk/main.go index 31dd02886..dc369e354 100644 --- a/internal/test/e2e/autosdk/main.go +++ b/internal/test/e2e/autosdk/main.go @@ -8,6 +8,7 @@ import ( "errors" "os" "os/signal" + "syscall" "time" "go.opentelemetry.io/otel/attribute" @@ -76,8 +77,18 @@ func sig(ctx context.Context) <-chan msg { } func main() { - // give time for auto-instrumentation to start up - time.Sleep(5 * time.Second) + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGCONT) + + // Wait for auto-instrumentation. + select { + case <-ctx.Done(): + os.Exit(1) + case <-sigChan: + } provider := sdk.TracerProvider() tracer := provider.Tracer( @@ -87,9 +98,6 @@ func main() { ) app := app{tracer: tracer} - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) - defer stop() - ctx, span := tracer.Start(ctx, "main", trace.WithTimestamp(y2k)) err := app.Run(ctx, "Alice", true, sig(ctx)) @@ -104,7 +112,4 @@ func main() { } span.End(trace.WithTimestamp(y2k.Add(5 * time.Second))) - - // give time for auto-instrumentation to report signal - time.Sleep(5 * time.Second) } From 64aa22860ddb7e2f751873b57ed9b2262fbe8978 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Mon, 30 Sep 2024 07:47:25 -0700 Subject: [PATCH 03/17] Add output configuration --- internal/test/runner/main.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/test/runner/main.go b/internal/test/runner/main.go index 3aad8246c..f430bcf4b 100644 --- a/internal/test/runner/main.go +++ b/internal/test/runner/main.go @@ -22,6 +22,7 @@ import ( func main() { logLevel := flag.String("log-level", "debug", `logging level ("debug", "info", "warn", "error")`) binPath := flag.String("bin", "", "Path to the target binary") + outPath := flag.String("out", "traces.json", "Path to out generated traces") flag.Parse() logger := newLogger(*logLevel) @@ -36,7 +37,7 @@ func main() { defer stop() app := App{logger: logger} - if err := app.Run(ctx, *binPath); err != nil { + if err := app.Run(ctx, *binPath, *outPath); err != nil { logger.Error("failed to run", "error", err) os.Exit(1) } @@ -66,8 +67,8 @@ type App struct { logger *slog.Logger } -func (a *App) Run(ctx context.Context, binPath string) error { - exp, err := a.newExporter(ctx) +func (a *App) Run(ctx context.Context, binPath, outPath string) error { + exp, err := a.newExporter(ctx, outPath) if err != nil { return err } @@ -128,13 +129,13 @@ func (a *App) Run(ctx context.Context, binPath string) error { return inst.Close() } -func (a *App) newExporter(ctx context.Context) (trace.SpanExporter, error) { +func (a *App) newExporter(ctx context.Context, outPath string) (trace.SpanExporter, error) { f := fileexporter.NewFactory() factory, err := collex.NewFactory(f, nil) if err != nil { return nil, err } c := f.CreateDefaultConfig().(*fileexporter.Config) - c.Path = "traces.json" + c.Path = outPath return factory.SpanExporter(ctx, c) } From c1f739b9ea9cb1c90cbd1c917f228ac1f187fa8a Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 24 Oct 2024 14:25:57 -0700 Subject: [PATCH 04/17] Add docker build --- internal/test/runner/Dockerfile | 6 ++ internal/test/runner/build.sh | 114 ++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 internal/test/runner/Dockerfile create mode 100755 internal/test/runner/build.sh diff --git a/internal/test/runner/Dockerfile b/internal/test/runner/Dockerfile new file mode 100644 index 000000000..dd6ab7a26 --- /dev/null +++ b/internal/test/runner/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:1.23 +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/runner +COPY . /usr/src/go.opentelemetry.io/auto/ +RUN go build -v -o /usr/local/bin/runner ./... +ENTRYPOINT ["runner"] + diff --git a/internal/test/runner/build.sh b/internal/test/runner/build.sh new file mode 100755 index 000000000..c06b00da6 --- /dev/null +++ b/internal/test/runner/build.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash + +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +usage() { + local progname + progname="$( basename "$0" )" + + cat <<-EOF + Usage: $progname [OPTIONS] + + Builds the runner docker image. + + OPTIONS: + -t --tag Docker tag to use ["runner"] + -h --help Show this help message +EOF +} + +parse_opts() { + # Make sure getopts starts at the beginning + OPTIND=1 + + local deliminator option + local arg= + + # Translate --gnu-long-options to -g (short options) + for arg + do + deliminator="" + case "$arg" in + --tag) + args="${args}-d " + ;; + --help) + args="${args}-h " + ;; + *) + [[ "${arg:0:1}" == "-" ]] || deliminator='"' + args="${args}${deliminator}${arg}${deliminator} " + ;; + esac + done + + # Reset the positional parameters to start parsing short options + eval set -- "$args" + + while getopts ":t:h" option + do + case "$option" in + t) + readonly TAG="$OPTARG" + ;; + h) + usage + exit 0 + ;; + *) + echo "Invalid option: -${option}" >&2 + usage + exit 1 + ;; + esac + done + + # Default values + [ -z "${TAG}" ] \ + && readonly TAG="runner" + + return 0 +} + +build() { + local root_dir="$1" + local local_dir="$2" + local dockerfile="${local_dir}/Dockerfile" + local tag_arg + + if [ ! -f "$dockerfile" ]; then + echo "Dockerfile does not exist: $dockerfile" + return 1 + fi + + if [ ! -d "$root_dir" ]; then + echo "Project root directory does not exist: $root_dir" + return 1 + fi + + if [ -n "$TAG" ]; then + tag_arg=("-t" "$TAG") + fi + + (cd "$root_dir" && docker build "${tag_arg[@]}" -f "$dockerfile" .) + return 0 +} + +main() { + local root_dir script_dir + + # Check dependencies + hash git 2>/dev/null\ + || { echo >&2 "Required git client not found"; exit 1; } + hash docker 2>/dev/null\ + || { echo >&2 "Required docker client not found"; exit 1; } + + parse_opts "$@" + + root_dir=$( git rev-parse --show-toplevel ) + script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + build "$root_dir" "$script_dir" +} + +main "$@" From 62263da910ef92e300a52bb0f519ef5ee72af7f6 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Thu, 5 Dec 2024 14:30:19 -0800 Subject: [PATCH 05/17] Run autosdk integration test with docker-compose --- .gitignore | 2 + Makefile | 8 + go.mod | 24 -- go.sum | 76 ----- internal/test/e2e/autosdk/Dockerfile | 5 +- internal/test/e2e/autosdk/compose.yaml | 53 ++++ internal/test/runner/Dockerfile | 6 - internal/tools/collector/Dockerfile | 14 + internal/tools/collector/main.go | 255 +++++++++++++++ internal/tools/go.mod | 142 ++++++++- internal/tools/go.sum | 293 ++++++++++++++++-- internal/tools/runner/Dockerfile | 8 + internal/tools/runner/Dockerfile.dockerignore | 14 + internal/{test => tools}/runner/build.sh | 0 internal/{test => tools}/runner/main.go | 43 +-- 15 files changed, 766 insertions(+), 177 deletions(-) create mode 100644 internal/test/e2e/autosdk/compose.yaml delete mode 100644 internal/test/runner/Dockerfile create mode 100644 internal/tools/collector/Dockerfile create mode 100644 internal/tools/collector/main.go create mode 100644 internal/tools/runner/Dockerfile create mode 100644 internal/tools/runner/Dockerfile.dockerignore rename internal/{test => tools}/runner/build.sh (100%) rename internal/{test => tools}/runner/main.go (71%) diff --git a/.gitignore b/.gitignore index e7c8b6498..6f754f789 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,5 @@ examples/kafka-go/producer/producer examples/kafka-go/consumer/consumer go.work* + +internal/test/e2e/autosdk/autosdk diff --git a/Makefile b/Makefile index 4094fb139..4978333d4 100644 --- a/Makefile +++ b/Makefile @@ -159,6 +159,14 @@ license-header-check: exit 1; \ fi +.PHONY: e2e-autosdk +e2e-autosdk: e2e/internal/test/e2e/autosdk +e2e/%: DIR=$* +e2e/%: + @: > $(DIR)/traces-orig.json # Truncate or ensure ownership. + @(cd $(DIR) && docker-compose up) + @bats $(DIR)/verify.bats + .PHONY: fixture-nethttp fixture-gin fixture-databasesql fixture-nethttp-custom fixture-otelglobal fixture-autosdk fixture-kafka-go fixture-nethttp-custom: fixtures/nethttp_custom fixture-nethttp: fixtures/nethttp diff --git a/go.mod b/go.mod index 876410548..3b3e940aa 100644 --- a/go.mod +++ b/go.mod @@ -18,10 +18,8 @@ retract ( ) require ( - github.com/MrAlias/collex v0.0.5-alpha github.com/cilium/ebpf v0.17.1 github.com/hashicorp/go-version v1.7.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.10.0 github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 @@ -44,40 +42,20 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.2 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.61.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/collector/component v0.115.0 // indirect - go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect - go.opentelemetry.io/collector/confmap v1.21.0 // indirect - go.opentelemetry.io/collector/consumer v1.21.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect - go.opentelemetry.io/collector/exporter v0.115.0 // indirect - go.opentelemetry.io/collector/extension v0.115.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect - go.opentelemetry.io/collector/featuregate v1.21.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect - go.opentelemetry.io/collector/pipeline v0.115.0 // indirect go.opentelemetry.io/contrib/bridges/prometheus v0.58.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.9.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.9.0 // indirect @@ -95,11 +73,9 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.33.0 // indirect go.opentelemetry.io/proto/otlp v1.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect google.golang.org/protobuf v1.36.0 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect ) diff --git a/go.sum b/go.sum index 1de134d94..4048a5cd5 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -github.com/MrAlias/collex v0.0.5-alpha h1:TCtwyrWgr7SCH9HAP3+oO/noee5Upot2VR5RS1vX+dE= -github.com/MrAlias/collex v0.0.5-alpha/go.mod h1:IowxHLoDBQs1hFD2L2MXpzannTxjLLkibqf8hVIZ3cQ= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= @@ -19,8 +17,6 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= -github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= -github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= @@ -34,8 +30,6 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3Ar github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= github.com/jsimonetti/rtnetlink/v2 v2.0.1 h1:xda7qaHDSVOsADNouv7ukSuicKZO7GgVUCXxpaIEIlM= @@ -46,12 +40,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.2 h1:I2rtLRqXRy1p01m/utEtpZSSA6dcJbgGVuE27kW2PzQ= -github.com/knadh/koanf/v2 v2.1.2/go.mod h1:Gphfaen0q1Fc1HTgJgSTC4oRX9R2R5ErYMZJy8fLJBo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -62,10 +50,6 @@ github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/ github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw= github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -73,16 +57,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0 h1:sVfc/ND4/Bp+r1U3zCucxz4U4kG0D4DpHnkJh8SCcxs= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0/go.mod h1:X32RUqZJR51cpTFxrnNvRQaS9zRW3BA8+ul+CzlvGUU= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.115.0 h1:cmSOl8dexYz8/ZQGSYyGmeNgo3bxxDFuWQQ+XazbmL8= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.115.0/go.mod h1:qP0oNxkFOJqFZY6uGFJarhWziI+aqsov/0IRJkL85vg= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.115.0 h1:OmwyS3i+UFENIQizvmeC9kBtT1Rdchbeo0Ksl8ZNcGQ= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.115.0/go.mod h1:Z3VC/J++bjSNkzOJ2yDbBUBxA+nYi7Juk3p1dCsiKE4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 h1:MuyDWyVoCty8HyP2CAYoRZXwINiThHovcC1Bj3+H8lk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0/go.mod h1:asekVnrdzYsMJBaJtIyXOt8p07l1x0xs8X3h00sZyf0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -108,54 +82,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= -go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= -go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= -go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= -go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= -go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= -go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= -go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= -go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= -go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= -go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= -go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= -go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= -go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= -go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= -go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= -go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= -go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= -go.opentelemetry.io/collector/exporter/debugexporter v0.112.0 h1:Suz/1SdAyeY+UPKJDt9RuWGxUOu8p2P6bhuon00VhGU= -go.opentelemetry.io/collector/exporter/debugexporter v0.112.0/go.mod h1:DVhlqmbajKH3JjJuW727d7FUkkLhyY/QcaL1xn9NREk= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= -go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= -go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= -go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= -go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= -go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= -go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= -go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= -go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= -go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= -go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= go.opentelemetry.io/collector/pdata v1.22.0 h1:3yhjL46NLdTMoP8rkkcE9B0pzjf2973crn0KKhX5UrI= go.opentelemetry.io/collector/pdata v1.22.0/go.mod h1:nLLf6uDg8Kn5g3WNZwGyu8+kf77SwOqQvMTb5AXEbEY= -go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= -go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= -go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= -go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= -go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= -go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= -go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= -go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= -go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= -go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= go.opentelemetry.io/contrib/bridges/prometheus v0.58.0 h1:gQFwWiqm4JUvOjpdmyU0di+2pVQ8QNpk1Ak/54Y6NcY= go.opentelemetry.io/contrib/bridges/prometheus v0.58.0/go.mod h1:CNyFi9PuvHtEJNmMFHaXZMuA4XmgRXIqpFcHdqzLvVU= go.opentelemetry.io/contrib/exporters/autoexport v0.58.0 h1:qVsDVgZd/bC6ZKDOHSjILpm0T/BWvASC9cQU3GYga78= @@ -202,8 +130,6 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -250,7 +176,5 @@ google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= 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/internal/test/e2e/autosdk/Dockerfile b/internal/test/e2e/autosdk/Dockerfile index 2a10f03ea..48567f2b1 100644 --- a/internal/test/e2e/autosdk/Dockerfile +++ b/internal/test/e2e/autosdk/Dockerfile @@ -1,4 +1,7 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 + +FROM ${BASE_IMAGE} + # Make sure this dir exists. WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/autosdk diff --git a/internal/test/e2e/autosdk/compose.yaml b/internal/test/e2e/autosdk/compose.yaml new file mode 100644 index 000000000..d2af311c3 --- /dev/null +++ b/internal/test/e2e/autosdk/compose.yaml @@ -0,0 +1,53 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + autosdk: + build: + context: ../../../../ + dockerfile: internal/test/e2e/autosdk/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + image: e2e-autosdk:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-autosdk:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + depends_on: + autosdk: + condition: service_completed_successfully + collector: + condition: service_healthy + command: -bin=/sample-app/main + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" diff --git a/internal/test/runner/Dockerfile b/internal/test/runner/Dockerfile deleted file mode 100644 index dd6ab7a26..000000000 --- a/internal/test/runner/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM golang:1.23 -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/runner -COPY . /usr/src/go.opentelemetry.io/auto/ -RUN go build -v -o /usr/local/bin/runner ./... -ENTRYPOINT ["runner"] - diff --git a/internal/tools/collector/Dockerfile b/internal/tools/collector/Dockerfile new file mode 100644 index 000000000..24ebd3297 --- /dev/null +++ b/internal/tools/collector/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.23 AS builder + +RUN apt-get update && apt-get install -y curl + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/tools/collector + +COPY . . +RUN go mod init go.opentelemetry.io/auto/internal/tools/collector && go mod tidy +RUN go build -o /usr/local/bin/collector ./... + +EXPOSE 4318 +EXPOSE 8080 +EXPOSE 13133 +ENTRYPOINT ["/usr/local/bin/collector"] diff --git a/internal/tools/collector/main.go b/internal/tools/collector/main.go new file mode 100644 index 000000000..0b4b9639e --- /dev/null +++ b/internal/tools/collector/main.go @@ -0,0 +1,255 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "context" + "errors" + "flag" + "fmt" + "net/http" + "os" + "os/signal" + "sync" + + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension" + "github.com/sagikazarmark/slog-shim" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" + fileprovider "go.opentelemetry.io/collector/confmap/provider/fileprovider" + "go.opentelemetry.io/collector/confmap/provider/yamlprovider" + "go.opentelemetry.io/collector/connector" + forwardconnector "go.opentelemetry.io/collector/connector/forwardconnector" + "go.opentelemetry.io/collector/exporter" + debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" + "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/otelcol" + "go.opentelemetry.io/collector/receiver" + otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" +) + +const ( + defaultListenAddr = ":8080" + shutdownPath = "/shutdown" +) + +const config = ` +extensions: + health_check: + endpoint: 0.0.0.0:13133 + +receivers: + otlp: + protocols: + http: + endpoint: 0.0.0.0:4318 + +exporters: + debug: {} + file/trace: + path: %s + rotation: + +service: + extensions: + - health_check + telemetry: + logs: + level: "debug" + pipelines: + traces: + receivers: + - otlp + exporters: + - file/trace + - debug +` + +func main() { + logLevel := flag.String("log-level", "debug", `logging level ("debug", "info", "warn", "error")`) + listen := flag.String("addr", defaultListenAddr, `Address to listen for shutdown signal on.`) + outPath := flag.String("out", "traces-orig.json", "Path to output generated traces") + flag.Parse() + + logger := newLogger(*logLevel) + + logger.Debug("flags", "log-level", *logLevel, "addr", *listen, "out", *outPath) + + ctx, cancel := context.WithCancel(context.Background()) + // Trap Ctrl+C and SIGTERM and call cancel on the context. + ctx, stop := signal.NotifyContext(ctx, os.Interrupt) + defer stop() + + configYaml := fmt.Sprintf(config, *outPath) + logger.Debug("built config", "config", configYaml) + coll := Collector{logger: logger} + if err := coll.Start(ctx, configYaml); err != nil { + logger.Error("failed to start collector", "error", err) + os.Exit(1) + } + + *listen = getEnv("SHUTDOWN_SERVER_ADDR", ":8080") + + // Start the HTTP server for shutdown endpoint + go startHTTPServer(*listen, cancel, logger) + + // Wait for the context to be canceled + <-ctx.Done() + + coll.Stop() +} + +func newLogger(lvlStr string) *slog.Logger { + levelVar := new(slog.LevelVar) // Default value of info. + opts := &slog.HandlerOptions{AddSource: true, Level: levelVar} + h := slog.NewJSONHandler(os.Stderr, opts) + logger := slog.New(h) + + if lvlStr == "" { + return logger + } + + var level slog.Level + if err := level.UnmarshalText([]byte(lvlStr)); err != nil { + logger.Error("failed to parse log level", "error", err, "log-level", lvlStr) + } else { + levelVar.Set(level) + } + + return logger +} + +type Collector struct { + logger *slog.Logger + + collMu sync.Mutex + coll *otelcol.Collector +} + +func (c *Collector) Start(ctx context.Context, configYaml string) error { + c.collMu.Lock() + defer c.collMu.Unlock() + + c.logger.Debug("starting collector") + + info := component.BuildInfo{ + Command: "otel-wrapper", + Description: "Custom OpenTelemetry Collector Wrapper", + Version: "0.0.1", + } + + uri := "yaml:" + configYaml + set := otelcol.CollectorSettings{ + BuildInfo: info, + Factories: components, + ConfigProviderSettings: otelcol.ConfigProviderSettings{ + ResolverSettings: confmap.ResolverSettings{ + URIs: []string{uri}, + ProviderFactories: []confmap.ProviderFactory{ + fileprovider.NewFactory(), + yamlprovider.NewFactory(), + }, + }, + }, + } + + // Initialize the OpenTelemetry Collector + var err error + c.coll, err = otelcol.NewCollector(set) + if err != nil { + c.coll = nil + return err + } + + // Start the OpenTelemetry Collector + go func() { + err := c.coll.Run(ctx) + if err != nil { + c.logger.Error("failed to run the collector", "error", err) + } + }() + c.logger.Info("collector started") + return nil +} + +func (c *Collector) Stop() { + c.logger.Info("stopping collector") + c.collMu.Lock() + defer c.collMu.Unlock() + + if c.coll == nil { + return + } + + c.coll.Shutdown() + c.logger.Info("collector stopped") + c.coll = nil +} + +func startHTTPServer(addr string, cancel context.CancelFunc, logger *slog.Logger) { + http.HandleFunc(shutdownPath, func(w http.ResponseWriter, r *http.Request) { + logger.Info("shutdown endpoint hit") + cancel() + w.WriteHeader(http.StatusOK) + w.Write([]byte("Shutting down collector...")) + }) + + logger.Info("starting shutdown HTTP server", "addr", addr) + if err := http.ListenAndServe(addr, nil); err != nil && !errors.Is(err, http.ErrServerClosed) { + logger.Error("failed to start HTTP server", "error", err) + } +} + +func getEnv(key, defaultValue string) string { + if value, exists := os.LookupEnv(key); exists { + return value + } + return defaultValue +} + +func components() (otelcol.Factories, error) { + var err error + factories := otelcol.Factories{} + + factories.Extensions, err = extension.MakeFactoryMap( + healthcheckextension.NewFactory(), + ) + if err != nil { + return otelcol.Factories{}, err + } + factories.ExtensionModules = make(map[component.Type]string, len(factories.Extensions)) + factories.ExtensionModules[healthcheckextension.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0" + + factories.Receivers, err = receiver.MakeFactoryMap( + otlpreceiver.NewFactory(), + ) + if err != nil { + return otelcol.Factories{}, err + } + factories.ReceiverModules = make(map[component.Type]string, len(factories.Receivers)) + factories.ReceiverModules[otlpreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0" + + factories.Exporters, err = exporter.MakeFactoryMap( + debugexporter.NewFactory(), + fileexporter.NewFactory(), + ) + if err != nil { + return otelcol.Factories{}, err + } + factories.ExporterModules = make(map[component.Type]string, len(factories.Exporters)) + factories.ExporterModules[debugexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/debugexporter v0.115.0" + factories.ExporterModules[fileexporter.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0" + + factories.Connectors, err = connector.MakeFactoryMap( + forwardconnector.NewFactory(), + ) + if err != nil { + return otelcol.Factories{}, err + } + factories.ConnectorModules = make(map[component.Type]string, len(factories.Connectors)) + factories.ConnectorModules[forwardconnector.NewFactory().Type()] = "go.opentelemetry.io/collector/connector/forwardconnector v0.115.0" + + return factories, nil +} diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 11ccf6b30..7324f0179 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -7,9 +7,25 @@ require ( github.com/golangci/golangci-lint v1.62.2 github.com/google/go-licenses/v2 v2.0.0-alpha.1 github.com/hashicorp/go-version v1.7.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + github.com/sagikazarmark/slog-shim v0.1.0 go.opentelemetry.io/auto v0.7.0-alpha go.opentelemetry.io/build-tools/dbotconf v0.15.0 go.opentelemetry.io/build-tools/multimod v0.15.0 + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/confmap v1.21.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 + go.opentelemetry.io/collector/connector v0.115.0 + go.opentelemetry.io/collector/connector/forwardconnector v0.115.0 + go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 + go.opentelemetry.io/collector/extension v0.115.0 + go.opentelemetry.io/collector/otelcol v0.115.0 + go.opentelemetry.io/collector/receiver v0.115.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 golang.org/x/sync v0.10.0 ) @@ -46,11 +62,13 @@ require ( github.com/butuzov/mirror v1.3.0 // indirect github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect - github.com/ckaznocha/intrange v0.3.0 // indirect - github.com/cloudflare/circl v1.5.0 // indirect + github.com/cilium/ebpf v0.17.1 // indirect + github.com/ckaznocha/intrange v0.2.1 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/containerd/log v0.1.0 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/cyphar/filepath-securejoin v0.3.6 // indirect @@ -60,6 +78,7 @@ require ( github.com/distribution/reference v0.6.0 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect + github.com/ebitengine/purego v0.8.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.18.0 // indirect @@ -75,6 +94,7 @@ require ( github.com/go-git/go-git/v5 v5.12.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.2.0 // indirect @@ -87,7 +107,8 @@ require ( github.com/gobwas/glob v0.2.3 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/go-printf-func-name v0.1.0 // indirect github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect @@ -98,23 +119,31 @@ require ( github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/licenseclassifier/v2 v2.0.0 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.5.0 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jgautheron/goconst v1.7.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect - github.com/jjti/go-spancheck v0.6.4 // indirect + github.com/jjti/go-spancheck v0.6.2 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/julz/importas v0.1.0 // indirect github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/kisielk/errcheck v1.8.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.1.2 // indirect github.com/kulti/thelper v0.6.3 // indirect github.com/kunwardeep/paralleltest v1.0.10 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect @@ -123,6 +152,7 @@ require ( github.com/ldez/grignotin v0.6.0 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect github.com/leonklingele/grouper v1.1.2 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/macabu/inamedparam v0.1.3 // indirect github.com/magiconair/properties v1.8.9 // indirect github.com/maratori/testableexamples v1.0.0 // indirect @@ -132,26 +162,35 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mgechev/revive v1.5.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/moricho/tparallel v0.3.2 // indirect github.com/morikuni/aec v1.0.0 // indirect + github.com/mostynb/go-grpc-compression v1.2.3 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.18.3 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect github.com/otiai10/copy v1.14.0 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.7.0 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.61.0 // indirect @@ -164,17 +203,18 @@ require ( github.com/raeperd/recvcheck v0.1.2 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect + github.com/rs/cors v1.11.1 // indirect github.com/ryancurrah/gomodguard v1.3.5 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect - github.com/sagikazarmark/locafero v0.6.0 // indirect - github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect github.com/securego/gosec/v2 v2.21.4 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/sivchari/tenv v1.12.1 // indirect @@ -196,7 +236,9 @@ require ( github.com/tetafro/godot v1.4.18 // indirect github.com/timakin/bodyclose v0.0.0-20241017074824-adbc21e6bf36 // indirect github.com/timonwong/loggercheck v0.10.1 // indirect - github.com/tomarrell/wrapcheck/v2 v2.10.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect @@ -204,40 +246,112 @@ require ( github.com/uudashr/iface v1.3.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xen0n/gosmopolitan v1.2.2 // indirect + github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.3.0 // indirect github.com/ykadowak/zerologlint v0.1.5 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.13.0 // indirect go-simpler.org/sloglint v0.7.2 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/build-tools v0.15.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect + go.opentelemetry.io/collector v0.115.0 // indirect + go.opentelemetry.io/collector/client v1.21.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect + go.opentelemetry.io/collector/component/componenttest v0.115.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.115.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect + go.opentelemetry.io/collector/config/configgrpc v0.115.0 // indirect + go.opentelemetry.io/collector/config/confighttp v0.115.0 // indirect + go.opentelemetry.io/collector/config/confignet v1.21.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect + go.opentelemetry.io/collector/config/internal v0.115.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/connector/connectortest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 // indirect + go.opentelemetry.io/collector/extension/extensiontest v0.115.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect + go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 // indirect + go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 // indirect + go.opentelemetry.io/collector/pdata v1.22.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processortest v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect + go.opentelemetry.io/collector/service v0.115.0 // indirect + go.opentelemetry.io/contrib/bridges/otelzap v0.8.0 // indirect + go.opentelemetry.io/contrib/bridges/prometheus v0.58.0 // indirect + go.opentelemetry.io/contrib/config v0.10.0 // indirect + go.opentelemetry.io/contrib/exporters/autoexport v0.58.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.31.0 // indirect go.opentelemetry.io/otel v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.9.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.9.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.55.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.9.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0 // indirect + go.opentelemetry.io/otel/log v0.9.0 // indirect go.opentelemetry.io/otel/metric v1.33.0 // indirect + go.opentelemetry.io/otel/sdk v1.33.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.9.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.33.0 // indirect go.opentelemetry.io/otel/trace v1.33.0 // indirect + go.opentelemetry.io/proto/otlp v1.4.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect + golang.org/x/arch v0.12.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect - golang.org/x/exp/typeparams v0.0.0-20241217172543-b2144cdd0a67 // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/tools v0.28.0 // indirect + golang.org/x/tools v0.27.0 // indirect + gonum.org/v1/gonum v0.15.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect + google.golang.org/grpc v1.69.2 // indirect google.golang.org/protobuf v1.36.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect honnef.co/go/tools v0.5.1 // indirect - k8s.io/klog/v2 v2.130.1 // indirect + k8s.io/klog/v2 v2.90.1 // indirect mvdan.cc/gofumpt v0.7.0 // indirect - mvdan.cc/unparam v0.0.0-20240917084806-57a3b4290ba3 // indirect + mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect ) replace go.opentelemetry.io/auto => ../../ diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 0f51f0b51..b0d7893a8 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -84,11 +84,13 @@ github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iy github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= -github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= -github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= +github.com/cilium/ebpf v0.17.1 h1:G8mzU81R2JA1nE5/8SRubzqvBMmAmri2VL8BIZPWvV0= +github.com/cilium/ebpf v0.17.1/go.mod h1:vay2FaYSmIlv3r8dNACd4mW/OCaZLJKJOo+IHBvCIO8= +github.com/ckaznocha/intrange v0.2.1 h1:M07spnNEQoALOJhwrImSrJLaxwuiQK+hA2DeajBlwYk= +github.com/ckaznocha/intrange v0.2.1/go.mod h1:7NEhVyf8fzZO5Ds7CRaqPEm52Ut83hsTiL5zbER/HYk= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys= -github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= @@ -113,6 +115,8 @@ github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/ebitengine/purego v0.8.1 h1:sdRKd6plj7KYW33EH5As6YKfe8m9zbN9JMrOjNVF/BE= +github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -151,11 +155,14 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= @@ -191,8 +198,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= -github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -203,6 +210,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUPPyAKJuzv8pEJU= @@ -238,6 +249,7 @@ github.com/google/go-licenses/v2 v2.0.0-alpha.1 h1:2EMzW/1PWYvgOxBXsWl7b350vI0c/ github.com/google/go-licenses/v2 v2.0.0-alpha.1/go.mod h1:HlMUpsa+mbs8EqdlY0BDfCn0ZK7Y7NQoRCGYhNoox64= github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk= github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/licenseclassifier/v2 v2.0.0 h1:1Y57HHILNf4m0ABuMVb6xk4vAJYEUO0gDxNpog0pyeA= github.com/google/licenseclassifier/v2 v2.0.0/go.mod h1:cOjbdH0kyC9R22sdQbYsFkto4NGCAc+ZSwbeThazEtM= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= @@ -260,13 +272,15 @@ github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3 github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.5.0 h1:Dq4wT1DdTwTGCQQv3rl3IvD5Ld0E6HiY+3Zh0sUGqw8= -github.com/gostaticanalysis/testutil v0.5.0/go.mod h1:OLQSbuM6zw2EvCcXTz1lVq5unyoNft372msDY0nY5Hs= +github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= +github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= @@ -279,8 +293,14 @@ github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5 github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jjti/go-spancheck v0.6.4 h1:Tl7gQpYf4/TMU7AT84MN83/6PutY21Nb9fuQjFTpRRc= -github.com/jjti/go-spancheck v0.6.4/go.mod h1:yAEYdKJ2lRkDA8g7X+oKUHXOWVAXSBJRv04OhF+QUjk= +github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= +github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= +github.com/josharian/native v1.1.0 h1:uuaP0hAbW7Y4l0ZRQ6C9zfb7Mg1mbFKry/xzDAfmtLA= +github.com/josharian/native v1.1.0/go.mod h1:7X/raswPFr05uY3HiLlYeyQntB6OO7E/d2Cu7qoaN2w= +github.com/jsimonetti/rtnetlink/v2 v2.0.1 h1:xda7qaHDSVOsADNouv7ukSuicKZO7GgVUCXxpaIEIlM= +github.com/jsimonetti/rtnetlink/v2 v2.0.1/go.mod h1:7MoNYNbb3UaDHtF8udiJo/RH6VsTKP1pqKLUTVCvToE= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= @@ -295,6 +315,12 @@ github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LX github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.1.2 h1:I2rtLRqXRy1p01m/utEtpZSSA6dcJbgGVuE27kW2PzQ= +github.com/knadh/koanf/v2 v2.1.2/go.mod h1:Gphfaen0q1Fc1HTgJgSTC4oRX9R2R5ErYMZJy8fLJBo= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -306,6 +332,8 @@ github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= github.com/lasiar/canonicalheader v1.1.2 h1:vZ5uqwvDbyJCnMhmFYimgMZnJMjwljN5VGY0VKbMXb4= @@ -318,6 +346,8 @@ github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSio github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= @@ -338,20 +368,35 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mdlayher/netlink v1.7.2 h1:/UtM3ofJap7Vl4QWCPDGXY8d3GIY2UGSDbK+QWmY8/g= +github.com/mdlayher/netlink v1.7.2/go.mod h1:xraEF7uJbxLhc5fpHL4cPe221LI2bdttWlU+ZGLfQSw= +github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U= +github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA= github.com/mgechev/revive v1.5.1 h1:hE+QPeq0/wIzJwOphdVyUJ82njdd8Khp4fUIHGZHW3M= github.com/mgechev/revive v1.5.1/go.mod h1:lC9AhkJIBs5zwx8wkudyHrU+IJkrEKmpCmGMnIJPk4o= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= +github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= @@ -368,6 +413,20 @@ github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4 github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0 h1:sVfc/ND4/Bp+r1U3zCucxz4U4kG0D4DpHnkJh8SCcxs= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.115.0/go.mod h1:X32RUqZJR51cpTFxrnNvRQaS9zRW3BA8+ul+CzlvGUU= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.115.0 h1:cmSOl8dexYz8/ZQGSYyGmeNgo3bxxDFuWQQ+XazbmL8= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.115.0/go.mod h1:qP0oNxkFOJqFZY6uGFJarhWziI+aqsov/0IRJkL85vg= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.115.0 h1:OmwyS3i+UFENIQizvmeC9kBtT1Rdchbeo0Ksl8ZNcGQ= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension v0.115.0/go.mod h1:Z3VC/J++bjSNkzOJ2yDbBUBxA+nYi7Juk3p1dCsiKE4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 h1:51D/x3xIAnWgVrY0lgdU+b+yb2aWd72uDqu9GhjRcNI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0/go.mod h1:nLau1YUdjhtLrk4jXLPb2l9riQ1Ap4xytTLl7MBedBg= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 h1:vRQQFD4YpasQFUAdF030UWtaflSYFXK542bfWMGhOK0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0/go.mod h1:BZ7DT+0VkKR7P3I9PGEDfVa0GdB0ty41eEcejIUXF9A= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 h1:MuyDWyVoCty8HyP2CAYoRZXwINiThHovcC1Bj3+H8lk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0/go.mod h1:asekVnrdzYsMJBaJtIyXOt8p07l1x0xs8X3h00sZyf0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -383,6 +442,8 @@ github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -392,6 +453,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polyfloyd/go-errorlint v1.7.0 h1:Zp6lzCK4hpBDj8y8a237YK4EPrMXQWvOe3nGoH4pFrU= github.com/polyfloyd/go-errorlint v1.7.0/go.mod h1:dGWKu85mGHnegQ2SWpEybFityCg3j7ZbwsVUxAOk9gY= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= @@ -420,17 +483,19 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= -github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= -github.com/sagikazarmark/locafero v0.6.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/sanposhiho/wastedassign/v2 v2.1.0 h1:crurBF7fJKIORrV85u9UUpePDYGWnwvv3+A96WvwXT0= -github.com/sanposhiho/wastedassign/v2 v2.1.0/go.mod h1:+oSmSC+9bQ+VUAxA66nBb0Z7N8CK7mscKTDYC6aIek4= +github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= +github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= @@ -444,6 +509,8 @@ github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +github.com/shirou/gopsutil/v4 v4.24.11 h1:WaU9xqGFKvFfsUv94SXcUPD7rCkU0vr/asVdQOBZNj8= +github.com/shirou/gopsutil/v4 v4.24.11/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -505,8 +572,12 @@ github.com/timakin/bodyclose v0.0.0-20241017074824-adbc21e6bf36 h1:BLrrwIAzisfgA github.com/timakin/bodyclose v0.0.0-20241017074824-adbc21e6bf36/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg= github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= -github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= -github.com/tomarrell/wrapcheck/v2 v2.10.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= +github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= +github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= @@ -521,6 +592,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= +github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 h1:zzrxE1FKn5ryBNl9eKOeqQ58Y/Qpo3Q9QNxKHX5uzzQ= +github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= @@ -534,6 +607,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= @@ -552,18 +627,170 @@ go.opentelemetry.io/build-tools/dbotconf v0.15.0 h1:VlWoAs/BhFOtNhaxxXP9Sx6YNDlw go.opentelemetry.io/build-tools/dbotconf v0.15.0/go.mod h1:KQj881ir+UqD9ePApyDbnz6+uG6sI20U5kxyHnD/n70= go.opentelemetry.io/build-tools/multimod v0.15.0 h1:mF4+7rf0uW06VhentAI9puZZoTKa9I9s7IXGgLSTD+E= go.opentelemetry.io/build-tools/multimod v0.15.0/go.mod h1:ovMzngj19/DmEFJSUsplyj0aVaYxbMf5o2eeK/+Pzqw= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/collector v0.115.0 h1:qUZ0bTeNBudMxNQ7FJKS//TxTjeJ7tfU/z22mcFavWU= +go.opentelemetry.io/collector v0.115.0/go.mod h1:66qx0xKnVvdwq60e1DEfb4e+zmM9szhPsv2hxZ/Mpj4= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/configgrpc v0.115.0 h1:gZzXSFe6hB3RUcEeAYqk1yT+TBa+X9tp6/1x29Yg2yk= +go.opentelemetry.io/collector/config/configgrpc v0.115.0/go.mod h1:107lRZ5LdQPMdGJGd4m1GhyKxyH0az2cUOqrJgTEN8E= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/confignet v1.21.0 h1:PeQ5YrMnfftysFL/WVaSrjPOWjD6DfeABY50pf9CZxU= +go.opentelemetry.io/collector/config/confignet v1.21.0/go.mod h1:ZppUH1hgUJOubawEsxsQ9MzEYFytqo2GnVSS7d4CVxc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 h1:+zukkM+3l426iGoJkXTpLB2Z8QnZFu26TkGPjh5Rn/4= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0/go.mod h1:BXBpQhF3n4CNLYO2n/mWZPd2U9ekpbLXLRGZrun1VfI= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 h1:P3Q9RytCMY76ORPCnkkjOa4fkuFqmZiQRor+F/nPlYE= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0/go.mod h1:xhYhHK3yLQ78tsoaKPIGUfFulgy961ImOe2gATH3RQc= +go.opentelemetry.io/collector/connector v0.115.0 h1:4Kkm3HQFzNT1eliMOB8FbIn+PLMRJ2qQku5Vmy3V8Ko= +go.opentelemetry.io/collector/connector v0.115.0/go.mod h1:+ByuAmYLrYHoKh9B+LGqUc0N2kXcN2l8Dea8Mp6brZ8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 h1:aW1f4Az0I+QJyImFccNWAXqik80bnNu27aQqi2hFfD8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0/go.mod h1:lmynB1CucydOsHa8RSSBh5roUZPfuiv65imXhtNzClM= +go.opentelemetry.io/collector/connector/connectortest v0.115.0 h1:GjtourFr0MJmlbtEPAZ/1BZCxkNAeJ0aMTlrxwftJ0k= +go.opentelemetry.io/collector/connector/connectortest v0.115.0/go.mod h1:f3KQXXNlh/XuV8elmnuVVyfY92dJCAovz10gD72OH0k= +go.opentelemetry.io/collector/connector/forwardconnector v0.115.0 h1:8qpQJa2fSusEYAfnMTFwQi4Om8y1N440G6OkZ+zhap4= +go.opentelemetry.io/collector/connector/forwardconnector v0.115.0/go.mod h1:4z+iBKXypSYjup0SLShe3kJ57qRGXALOIHJ4o+ANMo0= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 h1:gaIhzpaGFWauiyznrQ3f++TbcdXxA5rpsX3L9uGjMM8= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0/go.mod h1:7oXvuGBSawS5bc413lh1KEMcXkqBcrCqZQahOdnE24U= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 h1:gb9VMQhcbvYqp0SJ4Hp8R9XqOLNLsoTgNJCPKpNEaVc= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0/go.mod h1:H/HS1UJlcZPNBbOcrsGZc2sPdQDHtbOjHOxMtJkmlcU= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 h1:fetbc740pODH6JW+H49SW0hiAJwQE+/B0SbuIlaY2rg= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0/go.mod h1:oEKZ/d5BeaCK6Made9iwaeqmlT4lRbJSlW9nhIn/TwM= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0 h1:OZe7dKbZ01qodSpZU0ZYzI6zpmmzJ3UvfdBSFAbSgDw= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0/go.mod h1:fk9WCXP0x91Q64Z8HZKWTHh9PWtgoWE1KXe3n2Bff3U= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 h1:/g25Hp5aoCNKdDjIb3Fc7XRglO8yaBRFLO/IUNPnqNI= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0/go.mod h1:EQx7ETiy330O6q05S2KRZsRNDg0aQEeJmVl7Ipx+Fcw= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 h1:zYrZZocc7n0ZuDyXNkIaX0P0qk2fjMQj7NegwBJZA4k= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0/go.mod h1:OaXwNHF3MAcInBzCXrhXbTNHfIi9b7YGhXjtCFZqxNY= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 h1:6DRiSECeApFq6Jj5ug77rG53R6FzJEZBfygkyMEXdpg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0/go.mod h1:vgQf5HQdmLQqpDHpDq2S3nTRoUuKtRcZpRTsy+UiwYw= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 h1:9TL6T6ALqDpumUJ0tYIuPIg5LGo4r6eoqlNArYX116o= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0/go.mod h1:SgBLKMh11bOTPR1bdDZbi5MlqsoDBBFI3uBIwnei+0k= +go.opentelemetry.io/collector/otelcol v0.115.0 h1:wZhFGrSCZcTQ4qw4ePjI2PaSrOCejoQKAjprKD/xavs= +go.opentelemetry.io/collector/otelcol v0.115.0/go.mod h1:iK8DPvaizirIYKDl1zZG7DDYUj6GkkH4KHifVVM88vk= +go.opentelemetry.io/collector/pdata v1.22.0 h1:3yhjL46NLdTMoP8rkkcE9B0pzjf2973crn0KKhX5UrI= +go.opentelemetry.io/collector/pdata v1.22.0/go.mod h1:nLLf6uDg8Kn5g3WNZwGyu8+kf77SwOqQvMTb5AXEbEY= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 h1:3l9ruCAOrssTUDnyChKNzHWOdTtfThnYaoPZ1/+5sD0= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0/go.mod h1:2Myg+law/5lcezo9PhhZ0wjCaLYdGK24s1jDWbSW9VY= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 h1:NqMWsGuVy6y6VKTaPeJS7NZ9KAxhE/xyGUC7GaLYm/o= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0/go.mod h1:9ituzngnjsh/YvO+Phayq9BTk/nw0rgK5ZVvX1oxULk= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= +go.opentelemetry.io/collector/service v0.115.0 h1:k4GAOiI5tZgB2QKgwA6c3TeAVr7QL/ft5cOQbzUr8Iw= +go.opentelemetry.io/collector/service v0.115.0/go.mod h1:DKde9LMhNebdREecDSsqiTFLI2wRc+IoV4/wGxU6goY= +go.opentelemetry.io/contrib/bridges/otelzap v0.8.0 h1:4jqXEd0FGULFBy1bF1ledBePc0Ssu8YVddTgr8BXDTc= +go.opentelemetry.io/contrib/bridges/otelzap v0.8.0/go.mod h1:nrDogEQCtEOQ4jAiN4uHIE0BqicDF9bMyepgK1pIbP4= +go.opentelemetry.io/contrib/bridges/prometheus v0.58.0 h1:gQFwWiqm4JUvOjpdmyU0di+2pVQ8QNpk1Ak/54Y6NcY= +go.opentelemetry.io/contrib/bridges/prometheus v0.58.0/go.mod h1:CNyFi9PuvHtEJNmMFHaXZMuA4XmgRXIqpFcHdqzLvVU= +go.opentelemetry.io/contrib/config v0.10.0 h1:2JknAzMaYjxrHkTnZh3eOme/Y2P5eHE2SWfhfV6Xd6c= +go.opentelemetry.io/contrib/config v0.10.0/go.mod h1:aND2M6/KfNkntI5cyvHriR/zvZgPf8j9yETdSmvpfmc= +go.opentelemetry.io/contrib/exporters/autoexport v0.58.0 h1:qVsDVgZd/bC6ZKDOHSjILpm0T/BWvASC9cQU3GYga78= +go.opentelemetry.io/contrib/exporters/autoexport v0.58.0/go.mod h1:bAv7mY+5qTsFPFaRpr75vDOocX09I36QH4Rg0slEG/U= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 h1:yMkBS9yViCc7U7yeLzJPM2XizlfdVvBRSmsQDWu6qc0= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0/go.mod h1:n8MR6/liuGB5EmTETUBeU5ZgqMOlqKRxUaqPQBOANZ8= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= +go.opentelemetry.io/contrib/propagators/b3 v1.31.0 h1:PQPXYscmwbCp76QDvO4hMngF2j8Bx/OTV86laEl8uqo= +go.opentelemetry.io/contrib/propagators/b3 v1.31.0/go.mod h1:jbqfV8wDdqSDrAYxVpXQnpM0XFMq2FtDesblJ7blOwQ= +go.opentelemetry.io/contrib/zpages v0.56.0 h1:W7vP6s3juzL5KiHpr41zLNmsJ0QAZudYu8ay0zGAoko= +go.opentelemetry.io/contrib/zpages v0.56.0/go.mod h1:IxPRP4TYHw9jLeaEOSDIiA9zmyJNZNO6sbW55iMvSXs= go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.9.0 h1:gA2gh+3B3NDvRFP30Ufh7CC3TtJRbUSf2TTD0LbCagw= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.9.0/go.mod h1:smRTR+02OtrVGjvWE1sQxhuazozKc/BXvvqqnmOxy+s= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.9.0 h1:Za0Z/j9Gf3Z9DKQ1choU9xI2noCxlkcyFFP2Ob3miEQ= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.9.0/go.mod h1:jMRB8N75meTNjDFQyJBA/2Z9en21CsxwMctn08NHY6c= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.33.0 h1:7F29RDmnlqk6B5d+sUqemt8TBfDqxryYW5gX6L74RFA= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.33.0/go.mod h1:ZiGDq7xwDMKmWDrN1XsXAj0iC7hns+2DhxBFSncNHSE= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.33.0 h1:bSjzTvsXZbLSWU8hnZXcKmEVaJjjnandxD0PxThhVU8= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.33.0/go.mod h1:aj2rilHL8WjXY1I5V+ra+z8FELtk681deydgYT8ikxU= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0/go.mod h1:cpgtDBaqD/6ok/UG0jT15/uKjAY8mRA53diogHBg3UI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 h1:5pojmb1U1AogINhN3SurB+zm/nIcusopeBNp42f45QM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0/go.mod h1:57gTHJSE5S1tqg+EKsLPlTWhpHMsWlVmer+LA926XiA= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 h1:wpMfgF8E1rkrT1Z6meFh1NDtownE9Ii3n3X2GJYjsaU= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0/go.mod h1:wAy0T/dUbs468uOlkT31xjvqQgEVXv58BRFWEgn5v/0= +go.opentelemetry.io/otel/exporters/prometheus v0.55.0 h1:sSPw658Lk2NWAv74lkD3B/RSDb+xRFx46GjkrL3VUZo= +go.opentelemetry.io/otel/exporters/prometheus v0.55.0/go.mod h1:nC00vyCmQixoeaxF6KNyP42II/RHa9UdruK02qBmHvI= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.9.0 h1:iI15wfQb5ZtAVTdS5WROxpYmw6Kjez3hT9SuzXhrgGQ= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.9.0/go.mod h1:yepwlNzVVxHWR5ugHIrll+euPQPq4pvysHTDr/daV9o= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0 h1:FiOTYABOX4tdzi8A0+mtzcsTmi6WBOxk66u0f1Mj9Gs= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0/go.mod h1:xyo5rS8DgzV0Jtsht+LCEMwyiDbjpsxBpWETwFRF0/4= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0 h1:W5AWUn/IVe8RFb5pZx1Uh9Laf/4+Qmm4kJL5zPuvR+0= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0/go.mod h1:mzKxJywMNBdEX8TSJais3NnsVZUaJ+bAy6UxPTng2vk= +go.opentelemetry.io/otel/log v0.9.0 h1:0OiWRefqJ2QszpCiqwGO0u9ajMPe17q6IscQvvp3czY= +go.opentelemetry.io/otel/log v0.9.0/go.mod h1:WPP4OJ+RBkQ416jrFCQFuFKtXKD6mOoYCQm6ykK8VaU= go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM= go.opentelemetry.io/otel/sdk v1.33.0/go.mod h1:A1Q5oi7/9XaMlIWzPSxLRWOI8nG3FnzHJNbiENQuihM= +go.opentelemetry.io/otel/sdk/log v0.9.0 h1:YPCi6W1Eg0vwT/XJWsv2/PaQ2nyAJYuF7UUjQSBe3bc= +go.opentelemetry.io/otel/sdk/log v0.9.0/go.mod h1:y0HdrOz7OkXQBuc2yjiqnEHc+CRKeVhRE3hx4RwTmV4= +go.opentelemetry.io/otel/sdk/metric v1.33.0 h1:Gs5VK9/WUJhNXZgn8MR6ITatvAmKeIuCtNbsP3JkNqU= +go.opentelemetry.io/otel/sdk/metric v1.33.0/go.mod h1:dL5ykHZmm1B1nVRk9dDjChwDmt81MjVp3gLkQRwKf/Q= go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg= @@ -576,6 +803,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= +golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -586,12 +815,12 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= -golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20241217172543-b2144cdd0a67 h1:aOkGQa5iWYZjkoBaUQ8KyQfznXDSSumUfxSlEWSnmIM= -golang.org/x/exp/typeparams v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f h1:WTyX8eCCyfdqiPYkRGm0MqElSfYFH3yR1+rl/mct9sA= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -649,10 +878,12 @@ golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -670,6 +901,7 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= @@ -727,18 +959,19 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= -golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= +golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= +golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= +gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb h1:B7GIB7sr443wZ/EAEl7VZjmh1V6qzkt5V+RYcUYtS1U= google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:E5//3O5ZIG2l71Xnt+P/CYUY8Bxs8E7WMoZ9tlcMbAY= google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb h1:3oy2tynMOP1QbTC0MsNNAV+Se8M2Bd0A5+x1QHyw+pI= @@ -767,6 +1000,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -782,9 +1017,9 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= -k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= -k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= -mvdan.cc/unparam v0.0.0-20240917084806-57a3b4290ba3 h1:YkmTN1n5U60NM02j7TCSWRlW3fqNiuXe/eVXf0dLFN8= -mvdan.cc/unparam v0.0.0-20240917084806-57a3b4290ba3/go.mod h1:z5yboO1sP1Q9pcfvS597TpfbNXQjphDlkCJHzt13ybc= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= diff --git a/internal/tools/runner/Dockerfile b/internal/tools/runner/Dockerfile new file mode 100644 index 000000000..1af52552b --- /dev/null +++ b/internal/tools/runner/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.23 AS builder + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/tools/runner + +COPY . /usr/src/go.opentelemetry.io/auto/ +RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o /usr/local/bin/runner ./... + +ENTRYPOINT ["/usr/local/bin/runner"] diff --git a/internal/tools/runner/Dockerfile.dockerignore b/internal/tools/runner/Dockerfile.dockerignore new file mode 100644 index 000000000..35985ff75 --- /dev/null +++ b/internal/tools/runner/Dockerfile.dockerignore @@ -0,0 +1,14 @@ +# since this image is built with root context, most of the files +# need to be excluded for faster builds and to avoid spoiling build +# cache due to unchecked files (like configs or random binaries). +* + +# must-have toplevel files +!/go.sum +!/go.mod +!/LICENSE +!*.go + +# directories +!/internal/pkg +!/internal/tools diff --git a/internal/test/runner/build.sh b/internal/tools/runner/build.sh similarity index 100% rename from internal/test/runner/build.sh rename to internal/tools/runner/build.sh diff --git a/internal/test/runner/main.go b/internal/tools/runner/main.go similarity index 71% rename from internal/test/runner/main.go rename to internal/tools/runner/main.go index f430bcf4b..16cab3e9f 100644 --- a/internal/test/runner/main.go +++ b/internal/tools/runner/main.go @@ -12,17 +12,13 @@ import ( "os/signal" "syscall" - "github.com/MrAlias/collex" - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" - "go.opentelemetry.io/otel/sdk/trace" - "go.opentelemetry.io/auto" + "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" ) func main() { logLevel := flag.String("log-level", "debug", `logging level ("debug", "info", "warn", "error")`) binPath := flag.String("bin", "", "Path to the target binary") - outPath := flag.String("out", "traces.json", "Path to out generated traces") flag.Parse() logger := newLogger(*logLevel) @@ -37,7 +33,7 @@ func main() { defer stop() app := App{logger: logger} - if err := app.Run(ctx, *binPath, *outPath); err != nil { + if err := app.Run(ctx, *binPath); err != nil { logger.Error("failed to run", "error", err) os.Exit(1) } @@ -67,46 +63,49 @@ type App struct { logger *slog.Logger } -func (a *App) Run(ctx context.Context, binPath, outPath string) error { - exp, err := a.newExporter(ctx, outPath) +func (a *App) Run(ctx context.Context, binPath string) error { + exp, err := otlptracehttp.New(ctx) if err != nil { return err } + a.logger.Debug("loading target") cmd := exec.Command(binPath) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr + a.logger.Debug("starting target") if err := cmd.Start(); err != nil { return err } - loadedIndicator := make(chan struct{}) + a.logger.Debug("creating instrumentation") inst, err := auto.NewInstrumentation( ctx, auto.WithTraceExporter(exp), auto.WithPID(cmd.Process.Pid), auto.WithServiceName("testing"), auto.WithGlobal(), - auto.WithLoadedIndicator(loadedIndicator), auto.WithLogger(a.logger), + auto.WithEnv(), ) if err != nil { return err } + a.logger.Debug("loading") + err = inst.Load(ctx) + if err != nil { + return err + } + + a.logger.Debug("running") errCh := make(chan error, 1) go func() { errCh <- inst.Run(ctx) close(errCh) }() - select { - case <-ctx.Done(): - return ctx.Err() - case <-loadedIndicator: - } - var sig os.Signal = syscall.SIGCONT a.logger.Debug("sending signal to target") cmd.Process.Signal(sig) @@ -126,16 +125,6 @@ func (a *App) Run(ctx context.Context, binPath, outPath string) error { case <-done: } + a.logger.Debug("closing instrumentation") return inst.Close() } - -func (a *App) newExporter(ctx context.Context, outPath string) (trace.SpanExporter, error) { - f := fileexporter.NewFactory() - factory, err := collex.NewFactory(f, nil) - if err != nil { - return nil, err - } - c := f.CreateDefaultConfig().(*fileexporter.Config) - c.Path = outPath - return factory.SpanExporter(ctx, c) -} From e9de0b523bb56ab10936f61660e28c183876c05c Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 6 Dec 2024 11:23:45 -0800 Subject: [PATCH 06/17] Unify e2e exercise applications and Dockerfiles --- internal/test/e2e/autosdk/Dockerfile | 14 +- internal/test/e2e/autosdk/compose.yaml | 3 +- internal/test/e2e/autosdk/go.mod | 11 -- internal/test/e2e/autosdk/go.sum | 14 -- internal/test/e2e/autosdk/main.go | 19 ++- internal/test/e2e/databasesql/Dockerfile | 14 +- internal/test/e2e/databasesql/go.mod | 5 - internal/test/e2e/databasesql/go.sum | 2 - internal/test/e2e/databasesql/main.go | 23 ++- internal/test/e2e/gin/Dockerfile | 14 +- internal/test/e2e/gin/go.mod | 34 ---- internal/test/e2e/gin/go.sum | 85 ---------- internal/test/e2e/gin/main.go | 30 +++- internal/test/e2e/grpc/Dockerfile | 14 +- internal/test/e2e/grpc/go.mod | 22 --- internal/test/e2e/grpc/go.sum | 45 ------ internal/test/e2e/grpc/main.go | 20 ++- internal/test/e2e/kafka-go/Dockerfile | 14 +- internal/test/e2e/kafka-go/go.mod | 10 -- internal/test/e2e/kafka-go/go.sum | 70 -------- internal/test/e2e/kafka-go/main.go | 24 ++- internal/test/e2e/kafka-go/start.sh | 1 + internal/test/e2e/nethttp/Dockerfile | 14 +- internal/test/e2e/nethttp/go.mod | 3 - internal/test/e2e/nethttp/main.go | 32 +++- internal/test/e2e/nethttp_custom/Dockerfile | 14 +- internal/test/e2e/nethttp_custom/go.mod | 3 - internal/test/e2e/nethttp_custom/main.go | 27 +++- internal/test/e2e/otelglobal/Dockerfile | 14 +- internal/test/e2e/otelglobal/go.mod | 15 -- internal/test/e2e/otelglobal/go.sum | 23 --- internal/test/e2e/otelglobal/main.go | 26 ++- internal/test/go.mod | 51 ++++++ internal/test/go.sum | 168 ++++++++++++++++++++ internal/test/trigger/flag.go | 121 ++++++++++++++ internal/tools/runner/main.go | 1 + 36 files changed, 568 insertions(+), 432 deletions(-) delete mode 100644 internal/test/e2e/autosdk/go.mod delete mode 100644 internal/test/e2e/autosdk/go.sum delete mode 100644 internal/test/e2e/databasesql/go.mod delete mode 100644 internal/test/e2e/databasesql/go.sum delete mode 100644 internal/test/e2e/gin/go.mod delete mode 100644 internal/test/e2e/gin/go.sum delete mode 100644 internal/test/e2e/grpc/go.mod delete mode 100644 internal/test/e2e/grpc/go.sum delete mode 100644 internal/test/e2e/kafka-go/go.mod delete mode 100644 internal/test/e2e/kafka-go/go.sum delete mode 100644 internal/test/e2e/nethttp/go.mod delete mode 100644 internal/test/e2e/nethttp_custom/go.mod delete mode 100644 internal/test/e2e/otelglobal/go.mod delete mode 100644 internal/test/e2e/otelglobal/go.sum create mode 100644 internal/test/go.mod create mode 100644 internal/test/go.sum create mode 100644 internal/test/trigger/flag.go diff --git a/internal/test/e2e/autosdk/Dockerfile b/internal/test/e2e/autosdk/Dockerfile index 48567f2b1..09b0fdef2 100644 --- a/internal/test/e2e/autosdk/Dockerfile +++ b/internal/test/e2e/autosdk/Dockerfile @@ -1,17 +1,17 @@ ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 - FROM ${BASE_IMAGE} -# Make sure this dir exists. -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/autosdk - -COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk/ +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change -COPY internal/test/e2e/autosdk/go.mod internal/test/e2e/autosdk/go.sum ./ -RUN go mod download && go mod verify +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test +COPY internal/test/go.mod internal/test/go.sum ./ +RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify +COPY internal/test/trigger/ ./trigger + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/autosdk COPY internal/test/e2e/autosdk/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ diff --git a/internal/test/e2e/autosdk/compose.yaml b/internal/test/e2e/autosdk/compose.yaml index d2af311c3..f9edd3a82 100644 --- a/internal/test/e2e/autosdk/compose.yaml +++ b/internal/test/e2e/autosdk/compose.yaml @@ -28,6 +28,7 @@ services: dockerfile: internal/test/e2e/autosdk/Dockerfile args: BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" image: e2e-autosdk:latest depends_on: - runner @@ -44,7 +45,7 @@ services: condition: service_completed_successfully collector: condition: service_healthy - command: -bin=/sample-app/main + command: -bin=/usr/local/bin/autosdk shutdown-sidecar: image: busybox:latest depends_on: diff --git a/internal/test/e2e/autosdk/go.mod b/internal/test/e2e/autosdk/go.mod deleted file mode 100644 index 30459ed5d..000000000 --- a/internal/test/e2e/autosdk/go.mod +++ /dev/null @@ -1,11 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/autosdk - -go 1.22.0 - -require ( - go.opentelemetry.io/auto/sdk v1.1.0 - go.opentelemetry.io/otel v1.33.0 - go.opentelemetry.io/otel/trace v1.33.0 -) - -replace go.opentelemetry.io/auto/sdk => ../../../../sdk/ diff --git a/internal/test/e2e/autosdk/go.sum b/internal/test/e2e/autosdk/go.sum deleted file mode 100644 index d973fe064..000000000 --- a/internal/test/e2e/autosdk/go.sum +++ /dev/null @@ -1,14 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= -go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= -go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= -go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= -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/internal/test/e2e/autosdk/main.go b/internal/test/e2e/autosdk/main.go index dc369e354..ab8e5a691 100644 --- a/internal/test/e2e/autosdk/main.go +++ b/internal/test/e2e/autosdk/main.go @@ -6,15 +6,17 @@ package main import ( "context" "errors" + "flag" + "fmt" "os" "os/signal" - "syscall" "time" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" + "go.opentelemetry.io/auto/internal/test/trigger" "go.opentelemetry.io/auto/sdk" ) @@ -77,17 +79,18 @@ func sig(ctx context.Context) <-chan msg { } func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) + flag.Parse() + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) defer stop() - sigChan := make(chan os.Signal, 1) - signal.Notify(sigChan, syscall.SIGCONT) - // Wait for auto-instrumentation. - select { - case <-ctx.Done(): + err := trig.Wait(ctx) + if err != nil { + fmt.Println(err) os.Exit(1) - case <-sigChan: } provider := sdk.TracerProvider() @@ -100,7 +103,7 @@ func main() { ctx, span := tracer.Start(ctx, "main", trace.WithTimestamp(y2k)) - err := app.Run(ctx, "Alice", true, sig(ctx)) + err = app.Run(ctx, "Alice", true, sig(ctx)) if err != nil { span.SetStatus(codes.Error, "application error") span.RecordError( diff --git a/internal/test/e2e/databasesql/Dockerfile b/internal/test/e2e/databasesql/Dockerfile index 9c76cbc57..8273ae1f7 100644 --- a/internal/test/e2e/databasesql/Dockerfile +++ b/internal/test/e2e/databasesql/Dockerfile @@ -1,12 +1,18 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +FROM ${BASE_IMAGE} + +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/databasesql -COPY go.mod go.sum ./ +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test +COPY internal/test/go.mod internal/test/go.sum ./ RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify -COPY *.go . +COPY internal/test/trigger/ ./trigger + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/databasesql +COPY internal/test/e2e/databasesql/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ go build -v -o /usr/local/bin/app . diff --git a/internal/test/e2e/databasesql/go.mod b/internal/test/e2e/databasesql/go.mod deleted file mode 100644 index bb73bb669..000000000 --- a/internal/test/e2e/databasesql/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/databasesql - -go 1.22.0 - -require github.com/mattn/go-sqlite3 v1.14.24 diff --git a/internal/test/e2e/databasesql/go.sum b/internal/test/e2e/databasesql/go.sum deleted file mode 100644 index 9dcdc9b60..000000000 --- a/internal/test/e2e/databasesql/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= -github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= diff --git a/internal/test/e2e/databasesql/main.go b/internal/test/e2e/databasesql/main.go index b686d2c4e..18c19e35b 100644 --- a/internal/test/e2e/databasesql/main.go +++ b/internal/test/e2e/databasesql/main.go @@ -4,15 +4,18 @@ package main import ( + "context" "database/sql" + "flag" "fmt" "io" "log/slog" "net/http" "os" - "time" + "os/signal" _ "github.com/mattn/go-sqlite3" + "go.opentelemetry.io/auto/internal/test/trigger" ) const ( @@ -124,6 +127,13 @@ func (s *Server) invalid(w http.ResponseWriter, req *http.Request) { } func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) + flag.Parse() + + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + port := fmt.Sprintf(":%d", 8080) slog.Info("starting http server", "port", port) @@ -150,8 +160,12 @@ func main() { {url: "http://localhost:8080/invalid"}, } - // give time for auto-instrumentation to start up - time.Sleep(5 * time.Second) + // Wait for auto-instrumentation. + err := trig.Wait(ctx) + if err != nil { + slog.Error("Error waiting for auto-instrumentation", "error", err) + os.Exit(1) + } for _, t := range tests { resp, err := http.Get(t.url) @@ -167,7 +181,4 @@ func main() { _ = resp.Body.Close() } } - - // give time for auto-instrumentation to report signal - time.Sleep(5 * time.Second) } diff --git a/internal/test/e2e/gin/Dockerfile b/internal/test/e2e/gin/Dockerfile index f877d33f3..2bfd1cf45 100644 --- a/internal/test/e2e/gin/Dockerfile +++ b/internal/test/e2e/gin/Dockerfile @@ -1,12 +1,18 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +FROM ${BASE_IMAGE} + +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/gin -COPY go.mod go.sum ./ +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test +COPY internal/test/go.mod internal/test/go.sum ./ RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify -COPY *.go . +COPY internal/test/trigger/ ./trigger + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/gin +COPY internal/test/e2e/gin/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ go build -v -o /usr/local/bin/app . diff --git a/internal/test/e2e/gin/go.mod b/internal/test/e2e/gin/go.mod deleted file mode 100644 index 8176ea1d5..000000000 --- a/internal/test/e2e/gin/go.mod +++ /dev/null @@ -1,34 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/gin - -go 1.22.0 - -require github.com/gin-gonic/gin v1.10.0 - -require ( - github.com/bytedance/sonic v1.12.6 // indirect - github.com/bytedance/sonic/loader v0.2.1 // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.7 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.23.0 // indirect - github.com/goccy/go-json v0.10.4 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/cpuid/v2 v2.2.9 // indirect - github.com/leodido/go-urn v1.4.0 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.12 // indirect - golang.org/x/arch v0.12.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/text v0.21.0 // indirect - google.golang.org/protobuf v1.36.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/internal/test/e2e/gin/go.sum b/internal/test/e2e/gin/go.sum deleted file mode 100644 index a952268fb..000000000 --- a/internal/test/e2e/gin/go.sum +++ /dev/null @@ -1,85 +0,0 @@ -github.com/bytedance/sonic v1.12.6 h1:/isNmCUF2x3Sh8RAp/4mh4ZGkcFAX/hLrzrK3AvpRzk= -github.com/bytedance/sonic v1.12.6/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E= -github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= -github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA= -github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= -github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.23.0 h1:/PwmTwZhS0dPkav3cdK9kV1FsAmrL8sThn8IHr/sO+o= -github.com/go-playground/validator/v10 v10.23.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= -github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM= -github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= -github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= -github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= -github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= -github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= -golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= -google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= diff --git a/internal/test/e2e/gin/main.go b/internal/test/e2e/gin/main.go index f20c4cf3f..7c73467f9 100644 --- a/internal/test/e2e/gin/main.go +++ b/internal/test/e2e/gin/main.go @@ -4,15 +4,26 @@ package main import ( + "context" + "flag" "io" "log" "net/http" - "time" + "os" + "os/signal" "github.com/gin-gonic/gin" + "go.opentelemetry.io/auto/internal/test/trigger" ) func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) + flag.Parse() + + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + r := gin.Default() r.GET("/hello-gin", func(c *gin.Context) { c.String(http.StatusOK, "hello\n") @@ -21,10 +32,18 @@ func main() { _ = r.Run() }() - // give time for auto-instrumentation to start up - time.Sleep(5 * time.Second) + // Wait for auto-instrumentation. + err := trig.Wait(ctx) + if err != nil { + log.Fatal(err) + } - resp, err := http.Get("http://localhost:8080/hello-gin") + url := "http://localhost:8080/hello-gin" + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody) + if err != nil { + log.Fatal(err) + } + resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } @@ -35,7 +54,4 @@ func main() { log.Printf("Body: %s\n", string(body)) _ = resp.Body.Close() - - // give time for auto-instrumentation to report signal - time.Sleep(5 * time.Second) } diff --git a/internal/test/e2e/grpc/Dockerfile b/internal/test/e2e/grpc/Dockerfile index 3e4ade21b..0fe429dec 100644 --- a/internal/test/e2e/grpc/Dockerfile +++ b/internal/test/e2e/grpc/Dockerfile @@ -1,12 +1,18 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +FROM ${BASE_IMAGE} + +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/grpc -COPY go.mod go.sum ./ +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test +COPY internal/test/go.mod internal/test/go.sum ./ RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify -COPY *.go . +COPY internal/test/trigger/ ./trigger + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/grpc +COPY internal/test/e2e/grpc/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ go build -v -o /usr/local/bin/app . diff --git a/internal/test/e2e/grpc/go.mod b/internal/test/e2e/grpc/go.mod deleted file mode 100644 index fd24931c2..000000000 --- a/internal/test/e2e/grpc/go.mod +++ /dev/null @@ -1,22 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/grpc - -go 1.22.7 - -require ( - go.opentelemetry.io/otel v1.33.0 - google.golang.org/grpc v1.69.2 - google.golang.org/grpc/examples v0.0.0-20241220054550-e5a4eb091f41 -) - -require ( - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel/metric v1.33.0 // indirect - go.opentelemetry.io/otel/trace v1.33.0 // indirect - golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/text v0.21.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect - google.golang.org/protobuf v1.36.0 // indirect -) diff --git a/internal/test/e2e/grpc/go.sum b/internal/test/e2e/grpc/go.sum deleted file mode 100644 index 61c064f58..000000000 --- a/internal/test/e2e/grpc/go.sum +++ /dev/null @@ -1,45 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -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/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= -go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= -go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= -go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= -go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= -go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= -go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= -go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= -go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= -go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb h1:3oy2tynMOP1QbTC0MsNNAV+Se8M2Bd0A5+x1QHyw+pI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= -google.golang.org/grpc v1.69.2 h1:U3S9QEtbXC0bYNvRtcoklF3xGtLViumSYxWykJS+7AU= -google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= -google.golang.org/grpc/examples v0.0.0-20241220054550-e5a4eb091f41 h1:CRy0BWHfVtN1pubZRsBKt43V8cL5hzMsIfFX3APSI54= -google.golang.org/grpc/examples v0.0.0-20241220054550-e5a4eb091f41/go.mod h1:iUYUXyn6BoNc+Royf9Rq6zhL10e8fi9gWUwlQneUe6Q= -google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= -google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= -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/internal/test/e2e/grpc/main.go b/internal/test/e2e/grpc/main.go index 996b49bde..3678c3170 100644 --- a/internal/test/e2e/grpc/main.go +++ b/internal/test/e2e/grpc/main.go @@ -8,11 +8,15 @@ package main import ( "context" + "flag" "fmt" "log" "net" + "os" + "os/signal" "time" + "go.opentelemetry.io/auto/internal/test/trigger" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "google.golang.org/grpc" @@ -42,6 +46,13 @@ func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloRe } func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) + flag.Parse() + + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + // Server. lis, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) if err != nil { @@ -59,8 +70,11 @@ func main() { done <- struct{}{} }() - // Give time for auto-instrumentation to initialize. - time.Sleep(5 * time.Second) + // Wait for auto-instrumentation. + err = trig.Wait(ctx) + if err != nil { + log.Fatal(err) + } // Client. addr := fmt.Sprintf("localhost:%d", port) @@ -72,7 +86,7 @@ func main() { c := pb.NewGreeterClient(conn) // Contact the server and print out its response. - ctx, cancel := context.WithTimeout(context.Background(), time.Second) + ctx, cancel := context.WithTimeout(ctx, time.Second) defer cancel() r, err := c.SayHello(ctx, &pb.HelloRequest{Name: "world"}) if err != nil { diff --git a/internal/test/e2e/kafka-go/Dockerfile b/internal/test/e2e/kafka-go/Dockerfile index 193696626..76f34dd1c 100644 --- a/internal/test/e2e/kafka-go/Dockerfile +++ b/internal/test/e2e/kafka-go/Dockerfile @@ -1,13 +1,18 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 AS builder +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +FROM ${BASE_IMAGE} AS builder + +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test -COPY go.mod go.sum ./ +COPY internal/test/go.mod internal/test/go.sum ./ RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify +COPY internal/test/trigger/ ./trigger + WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/kafka-go -COPY *.go . +COPY internal/test/e2e/kafka-go/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ CGO_ENABLED=0 go build -v -o /usr/local/bin/app . @@ -22,10 +27,11 @@ ENV KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAI ENV KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@127.0.0.1:9093 ENV KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER COPY --from=builder /usr/local/bin/app /usr/local/bin/app +COPY --from=builder /usr/local/bin/runne[r] /usr/local/bin/runner # Add script target of /usr/local/bin/app WORKDIR /opt/kafka/ -COPY start.sh . +COPY internal/test/e2e/kafka-go/start.sh . RUN chmod +x /opt/kafka/start.sh ENTRYPOINT ["/usr/local/bin/app"] diff --git a/internal/test/e2e/kafka-go/go.mod b/internal/test/e2e/kafka-go/go.mod deleted file mode 100644 index 538ee369e..000000000 --- a/internal/test/e2e/kafka-go/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/kafka-go - -go 1.22.0 - -require github.com/segmentio/kafka-go v0.4.47 - -require ( - github.com/klauspost/compress v1.17.11 // indirect - github.com/pierrec/lz4/v4 v4.1.22 // indirect -) diff --git a/internal/test/e2e/kafka-go/go.sum b/internal/test/e2e/kafka-go/go.sum deleted file mode 100644 index ed0f89a93..000000000 --- a/internal/test/e2e/kafka-go/go.sum +++ /dev/null @@ -1,70 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= -github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU= -github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= -github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= -github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -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/internal/test/e2e/kafka-go/main.go b/internal/test/e2e/kafka-go/main.go index 8e87aabc9..ce2fcb836 100644 --- a/internal/test/e2e/kafka-go/main.go +++ b/internal/test/e2e/kafka-go/main.go @@ -9,9 +9,11 @@ import ( "fmt" "os" "os/exec" + "os/signal" "time" kafka "github.com/segmentio/kafka-go" + "go.opentelemetry.io/auto/internal/test/trigger" ) func produceMessages(kafkaWriter *kafka.Writer) { @@ -76,9 +78,21 @@ func reader(readChan chan bool) { } func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) setup := flag.String("setup", "./start.sh", "Kafka setup script") flag.Parse() + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + + // Wait for auto-instrumentation. + err := trig.Wait(ctx) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + cmd := exec.Command(*setup) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr @@ -95,7 +109,7 @@ func main() { // to create topics when auto.create.topics.enable='true' fmt.Println("trying to connect to kafka") for range time.Tick(5 * time.Second) { - _, err := kafka.DialLeader(context.Background(), "tcp", "127.0.0.1:9092", "topic1", 0) + _, err := kafka.DialLeader(ctx, "tcp", "127.0.0.1:9092", "topic1", 0) if err == nil { break } @@ -103,7 +117,7 @@ func main() { } fmt.Println("successfully connected to kafka") - _, err := kafka.DialLeader(context.Background(), "tcp", "127.0.0.1:9092", "topic2", 0) + _, err = kafka.DialLeader(ctx, "tcp", "127.0.0.1:9092", "topic2", 0) if err != nil { panic(err.Error()) } @@ -111,12 +125,6 @@ func main() { readChan := make(chan bool) go reader(readChan) - // give time for auto-instrumentation to start up - time.Sleep(5 * time.Second) - produceMessages(kafkaWriter) <-readChan - - // give time for auto-instrumentation to report signal - time.Sleep(5 * time.Second) } diff --git a/internal/test/e2e/kafka-go/start.sh b/internal/test/e2e/kafka-go/start.sh index e7e1d4e93..e918026d7 100644 --- a/internal/test/e2e/kafka-go/start.sh +++ b/internal/test/e2e/kafka-go/start.sh @@ -3,6 +3,7 @@ # Copyright The OpenTelemetry Authors # SPDX-License-Identifier: Apache-2.0 +set -x # launch kafka and wait for it to be ready /opt/bitnami/scripts/kafka/entrypoint.sh /opt/bitnami/scripts/kafka/run.sh & diff --git a/internal/test/e2e/nethttp/Dockerfile b/internal/test/e2e/nethttp/Dockerfile index 497c72b5b..5af456f04 100644 --- a/internal/test/e2e/nethttp/Dockerfile +++ b/internal/test/e2e/nethttp/Dockerfile @@ -1,12 +1,18 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +FROM ${BASE_IMAGE} + +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/nethttp -COPY go.mod ./ +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test +COPY internal/test/go.mod internal/test/go.sum ./ RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify -COPY *.go . +COPY internal/test/trigger/ ./trigger + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/nethttp +COPY internal/test/e2e/nethttp/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ go build -v -o /usr/local/bin/app . diff --git a/internal/test/e2e/nethttp/go.mod b/internal/test/e2e/nethttp/go.mod deleted file mode 100644 index dd58e0784..000000000 --- a/internal/test/e2e/nethttp/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/nethttp - -go 1.22.0 diff --git a/internal/test/e2e/nethttp/main.go b/internal/test/e2e/nethttp/main.go index b9c70ee69..74a881ba6 100644 --- a/internal/test/e2e/nethttp/main.go +++ b/internal/test/e2e/nethttp/main.go @@ -4,11 +4,16 @@ package main import ( + "context" + "flag" "fmt" "io" "log" "net/http" - "time" + "os" + "os/signal" + + "go.opentelemetry.io/auto/internal/test/trigger" ) func hello(w http.ResponseWriter, _ *http.Request) { @@ -16,15 +21,31 @@ func hello(w http.ResponseWriter, _ *http.Request) { } func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) + flag.Parse() + + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + http.HandleFunc("/hello/{id}", hello) go func() { _ = http.ListenAndServe(":8080", nil) }() - // give time for auto-instrumentation to start up - time.Sleep(5 * time.Second) + // Wait for auto-instrumentation. + err := trig.Wait(ctx) + if err != nil { + log.Fatal(err) + } - resp, err := http.Get("http://user@localhost:8080/hello/42?query=true#fragment") + url := "http://user@localhost:8080/hello/42?query=true#fragment" + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody) + if err != nil { + log.Fatal(err) + } + + resp, err := http.DefaultClient.Do(req) if err != nil { log.Fatal(err) } @@ -35,7 +56,4 @@ func main() { log.Printf("Body: %s\n", string(body)) _ = resp.Body.Close() - - // give time for auto-instrumentation to report signal - time.Sleep(5 * time.Second) } diff --git a/internal/test/e2e/nethttp_custom/Dockerfile b/internal/test/e2e/nethttp_custom/Dockerfile index 97c556817..e177aec36 100644 --- a/internal/test/e2e/nethttp_custom/Dockerfile +++ b/internal/test/e2e/nethttp_custom/Dockerfile @@ -1,12 +1,18 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +FROM ${BASE_IMAGE} + +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/nethttp_custom -COPY go.mod ./ +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test +COPY internal/test/go.mod internal/test/go.sum ./ RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify -COPY *.go . +COPY internal/test/trigger/ ./trigger + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/nethttp_custom +COPY internal/test/e2e/nethttp_custom/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ go build -v -o /usr/local/bin/app . diff --git a/internal/test/e2e/nethttp_custom/go.mod b/internal/test/e2e/nethttp_custom/go.mod deleted file mode 100644 index dd58e0784..000000000 --- a/internal/test/e2e/nethttp_custom/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/nethttp - -go 1.22.0 diff --git a/internal/test/e2e/nethttp_custom/main.go b/internal/test/e2e/nethttp_custom/main.go index 4453d7c2c..1f66a94fc 100644 --- a/internal/test/e2e/nethttp_custom/main.go +++ b/internal/test/e2e/nethttp_custom/main.go @@ -4,12 +4,17 @@ package main import ( + "context" "crypto/tls" + "flag" "fmt" "io" "log" "net/http" - "time" + "os" + "os/signal" + + "go.opentelemetry.io/auto/internal/test/trigger" ) type statusRecorder struct { @@ -75,17 +80,26 @@ func (rt *MyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { } func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) + flag.Parse() + + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + go func() { _ = http.ListenAndServe(":8080", logStatus(http.HandlerFunc(hello))) }() - // give time for auto-instrumentation to start up - time.Sleep(5 * time.Second) + // Wait for auto-instrumentation. + err := trig.Wait(ctx) + if err != nil { + log.Fatal(err) + } - req, err := http.NewRequest("GET", "http://localhost:8080/hello", nil) + req, err := http.NewRequestWithContext(ctx, "GET", "http://localhost:8080/hello", http.NoBody) if err != nil { log.Fatal(err) - return } mt := &MyRoundTripper{} @@ -101,7 +115,4 @@ func main() { log.Printf("Body: %s\n", string(body)) _ = resp.Body.Close() - - // give time for auto-instrumentation to report signal - time.Sleep(5 * time.Second) } diff --git a/internal/test/e2e/otelglobal/Dockerfile b/internal/test/e2e/otelglobal/Dockerfile index b437f7650..55e5380e0 100644 --- a/internal/test/e2e/otelglobal/Dockerfile +++ b/internal/test/e2e/otelglobal/Dockerfile @@ -1,12 +1,18 @@ -FROM golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +ARG BASE_IMAGE=golang:1.23.4@sha256:70031844b8c225351d0bb63e2c383f80db85d92ba894e3da7e13bcf80efa9a37 +FROM ${BASE_IMAGE} + +COPY sdk/ /usr/src/go.opentelemetry.io/auto/sdk # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading # them in subsequent builds if they change -WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/otelglobal -COPY go.mod go.sum ./ +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test +COPY internal/test/go.mod internal/test/go.sum ./ RUN --mount=type=cache,target=/go/pkg go mod download && go mod verify -COPY *.go . +COPY internal/test/trigger/ ./trigger + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/test/e2e/otelglobal +COPY internal/test/e2e/otelglobal/*.go . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/go/pkg \ go build -v -o /usr/local/bin/app . diff --git a/internal/test/e2e/otelglobal/go.mod b/internal/test/e2e/otelglobal/go.mod deleted file mode 100644 index 254ff71cd..000000000 --- a/internal/test/e2e/otelglobal/go.mod +++ /dev/null @@ -1,15 +0,0 @@ -module go.opentelemetry.io/auto/internal/test/e2e/otelglobal - -go 1.22.0 - -require ( - go.opentelemetry.io/otel v1.33.0 - go.opentelemetry.io/otel/trace v1.33.0 -) - -require ( - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel/metric v1.33.0 // indirect -) diff --git a/internal/test/e2e/otelglobal/go.sum b/internal/test/e2e/otelglobal/go.sum deleted file mode 100644 index aed14b9a3..000000000 --- a/internal/test/e2e/otelglobal/go.sum +++ /dev/null @@ -1,23 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= -go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= -go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= -go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= -go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= -go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= -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/internal/test/e2e/otelglobal/main.go b/internal/test/e2e/otelglobal/main.go index c151005cc..5e92d6ce8 100644 --- a/internal/test/e2e/otelglobal/main.go +++ b/internal/test/e2e/otelglobal/main.go @@ -5,9 +5,12 @@ package main import ( "context" + "flag" "fmt" - "time" + "os" + "os/signal" + "go.opentelemetry.io/auto/internal/test/trigger" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" @@ -51,13 +54,22 @@ func createMainSpan(ctx context.Context) { } func main() { + var trig trigger.Flag + flag.Var(&trig, "trigger", trig.Docs()) + flag.Parse() + + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) + defer stop() + + // Wait for auto-instrumentation. + err := trig.Wait(ctx) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + // registering unused tracers to test how we handle a non-trivial tracers map setUnusedTracers() - // give time for auto-instrumentation to start up - time.Sleep(5 * time.Second) - - createMainSpan(context.Background()) - // give time for auto-instrumentation to report signal - time.Sleep(5 * time.Second) + createMainSpan(ctx) } diff --git a/internal/test/go.mod b/internal/test/go.mod new file mode 100644 index 000000000..99b337886 --- /dev/null +++ b/internal/test/go.mod @@ -0,0 +1,51 @@ +module go.opentelemetry.io/auto/internal/test + +go 1.22.7 + +replace go.opentelemetry.io/auto/sdk => ../../sdk/ + +require ( + github.com/gin-gonic/gin v1.10.0 + github.com/mattn/go-sqlite3 v1.14.24 + github.com/segmentio/kafka-go v0.4.47 + go.opentelemetry.io/auto/sdk v1.1.0 + go.opentelemetry.io/otel v1.33.0 + go.opentelemetry.io/otel/trace v1.33.0 + golang.org/x/sys v0.28.0 + google.golang.org/grpc v1.68.1 + google.golang.org/grpc/examples v0.0.0-20241206050055-66ba4b264d26 +) + +require ( + github.com/bytedance/sonic v1.11.6 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.20.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/pierrec/lz4/v4 v4.1.15 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect + go.opentelemetry.io/otel/metric v1.33.0 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/crypto v0.30.0 // indirect + golang.org/x/net v0.32.0 // indirect + golang.org/x/text v0.21.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect + google.golang.org/protobuf v1.35.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/internal/test/go.sum b/internal/test/go.sum new file mode 100644 index 000000000..c3cb21228 --- /dev/null +++ b/internal/test/go.sum @@ -0,0 +1,168 @@ +github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= +github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= +github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +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/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= +github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= +github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= +go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= +go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= +go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= +go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= +go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY= +golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= +google.golang.org/grpc/examples v0.0.0-20241206050055-66ba4b264d26 h1:M0zpb34VQMw2ZJAUrfAFONsOLTvBHlVU25dUVaKy8X0= +google.golang.org/grpc/examples v0.0.0-20241206050055-66ba4b264d26/go.mod h1:HVNtBgD4Eabbp5OKdqHN3NyLvanTomwWTV4ioyf1mFU= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/test/trigger/flag.go b/internal/test/trigger/flag.go new file mode 100644 index 000000000..b0fb77fc8 --- /dev/null +++ b/internal/test/trigger/flag.go @@ -0,0 +1,121 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package trigger + +import ( + "context" + "flag" + "fmt" + "os" + "os/signal" + "strings" + "time" + + "golang.org/x/sys/unix" +) + +// Flag is a [flag.Value] that parses and handles a user provided trigger +// argument. +// +// Its common use case looks like this: +// +// var trigger trigger.Flag +// flag.Var(&trigger, "trigger", trigger.docs()) +// flag.Parse() +// +// ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) +// defer stop() +// +// err := trigger.wait(ctx) +// if err != nil { +// // Handle error. +// } +type Flag struct { + // Either signal:SIGNAL or sleep:DURATION + value string + fn func(context.Context) error +} + +var _ flag.Value = (*Flag)(nil) + +// Docs returns documentation about the Flag for the command line. +func (f *Flag) Docs() string { + return `trigger to wait for (i.e. "signal:SIGCONT", "sleep:5s")` +} + +// Set sets the trigger behavior of the Flag. +func (f *Flag) Set(s string) error { + f.value = s + + parts := strings.SplitN(s, ":", 2) + if len(parts) != 2 { + return fmt.Errorf("invalid trigger flag: %s", s) + } + + var err error + switch parts[0] { + case "signal": + f.fn, err = Signal(parts[1]) + case "sleep": + f.fn, err = Sleep(parts[1]) + default: + return fmt.Errorf("unknown trigger: %s", parts[0]) + } + return err +} + +// String returns the configured trigger value. +func (f *Flag) String() string { + if f == nil { + return "" + } + return f.value +} + +// Wait will wait until ready or the passed context is done. +// +// A non-nil error is returned if one occurs during the wait. If the passed +// context is cancelled or times out, the context error is returned. +func (f *Flag) Wait(ctx context.Context) error { + if f == nil || f.fn == nil { + // Default to sleeping 5 seconds. + time.Sleep(time.Second * 5) + return nil + } + return f.fn(ctx) +} + +// Sleep returns a trigger function that will wait for the parsed duration. An +// error is returned if the passed duration is invalid. +func Sleep(duration string) (func(context.Context) error, error) { + d, err := time.ParseDuration(duration) + if err != nil { + return nil, fmt.Errorf("invalid sleep duration: %w", err) + } + return func(ctx context.Context) error { + time.Sleep(d) + return nil + }, nil +} + +// Signal returns a trigger function that will wait for the parsed signal s to +// be sent to the process. An error is returned if the passed signal is +// invalid. +func Signal(s string) (func(context.Context) error, error) { + sig2 := unix.SignalNum(s) + if sig2 == 0 { + return nil, fmt.Errorf("invalid signal: %s", s) + } + return func(ctx context.Context) error { + ch := make(chan os.Signal, 1) + signal.Notify(ch, sig2) + + select { + case <-ctx.Done(): + return ctx.Err() + case <-ch: + } + return nil + }, nil +} diff --git a/internal/tools/runner/main.go b/internal/tools/runner/main.go index 16cab3e9f..b71e9cc14 100644 --- a/internal/tools/runner/main.go +++ b/internal/tools/runner/main.go @@ -71,6 +71,7 @@ func (a *App) Run(ctx context.Context, binPath string) error { a.logger.Debug("loading target") cmd := exec.Command(binPath) + cmd.Args = append(cmd.Args, "-trigger=signal:SIGCONT") cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr From e157cfa3531c41302ee4878b0a97d15a2e4ab1af Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 6 Dec 2024 13:51:09 -0800 Subject: [PATCH 07/17] Add e2e test targets --- Makefile | 11 +++- internal/test/e2e/autosdk/compose.yaml | 3 +- internal/test/e2e/databasesql/compose.yaml | 57 +++++++++++++++++++ internal/test/e2e/gin/compose.yaml | 55 ++++++++++++++++++ internal/test/e2e/grpc/compose.yaml | 55 ++++++++++++++++++ internal/test/e2e/kafka-go/compose.yaml | 55 ++++++++++++++++++ internal/test/e2e/nethttp/compose.yaml | 55 ++++++++++++++++++ internal/test/e2e/nethttp_custom/compose.yaml | 55 ++++++++++++++++++ internal/test/e2e/otelglobal/compose.yaml | 55 ++++++++++++++++++ 9 files changed, 398 insertions(+), 3 deletions(-) create mode 100644 internal/test/e2e/databasesql/compose.yaml create mode 100644 internal/test/e2e/gin/compose.yaml create mode 100644 internal/test/e2e/grpc/compose.yaml create mode 100644 internal/test/e2e/kafka-go/compose.yaml create mode 100644 internal/test/e2e/nethttp/compose.yaml create mode 100644 internal/test/e2e/nethttp_custom/compose.yaml create mode 100644 internal/test/e2e/otelglobal/compose.yaml diff --git a/Makefile b/Makefile index 4978333d4..997623222 100644 --- a/Makefile +++ b/Makefile @@ -159,12 +159,19 @@ license-header-check: exit 1; \ fi -.PHONY: e2e-autosdk +.PHONY: e2e-autosdk e2e-databasesql e2e-gin e2e-grpc e2e-kafka-go e2e-nethttp e2e-nethttp-custom e2e-otelglobal e2e-autosdk: e2e/internal/test/e2e/autosdk +e2e-databasesql: e2e/internal/test/e2e/databasesql +e2e-gin: e2e/internal/test/e2e/gin +e2e-grpc: e2e/internal/test/e2e/grpc +e2e-kafka-go: e2e/internal/test/e2e/kafka-go +e2e-nethttp: e2e/internal/test/e2e/nethttp +e2e-nethttp-custom: e2e/internal/test/e2e/nethttp_custom +e2e-otelglobal: e2e/internal/test/e2e/otelglobal e2e/%: DIR=$* e2e/%: @: > $(DIR)/traces-orig.json # Truncate or ensure ownership. - @(cd $(DIR) && docker-compose up) + @(cd $(DIR) && docker-compose up && docker-compose down) @bats $(DIR)/verify.bats .PHONY: fixture-nethttp fixture-gin fixture-databasesql fixture-nethttp-custom fixture-otelglobal fixture-autosdk fixture-kafka-go diff --git a/internal/test/e2e/autosdk/compose.yaml b/internal/test/e2e/autosdk/compose.yaml index f9edd3a82..61fdf918d 100644 --- a/internal/test/e2e/autosdk/compose.yaml +++ b/internal/test/e2e/autosdk/compose.yaml @@ -45,7 +45,8 @@ services: condition: service_completed_successfully collector: condition: service_healthy - command: -bin=/usr/local/bin/autosdk + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app shutdown-sidecar: image: busybox:latest depends_on: diff --git a/internal/test/e2e/databasesql/compose.yaml b/internal/test/e2e/databasesql/compose.yaml new file mode 100644 index 000000000..7bcf4bff8 --- /dev/null +++ b/internal/test/e2e/databasesql/compose.yaml @@ -0,0 +1,57 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + databasesql: + build: + context: ../../../../ + dockerfile: internal/test/e2e/databasesql/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" + image: e2e-databasesql:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-databasesql:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + - OTEL_GO_AUTO_INCLUDE_DB_STATEMENT=true + - OTEL_GO_AUTO_PARSE_DB_STATEMENT=true + depends_on: + databasesql: + condition: service_completed_successfully + collector: + condition: service_healthy + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" diff --git a/internal/test/e2e/gin/compose.yaml b/internal/test/e2e/gin/compose.yaml new file mode 100644 index 000000000..3125e5a01 --- /dev/null +++ b/internal/test/e2e/gin/compose.yaml @@ -0,0 +1,55 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + gin: + build: + context: ../../../../ + dockerfile: internal/test/e2e/gin/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" + image: e2e-gin:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-gin:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + depends_on: + gin: + condition: service_completed_successfully + collector: + condition: service_healthy + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" diff --git a/internal/test/e2e/grpc/compose.yaml b/internal/test/e2e/grpc/compose.yaml new file mode 100644 index 000000000..e77d09558 --- /dev/null +++ b/internal/test/e2e/grpc/compose.yaml @@ -0,0 +1,55 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + grpc: + build: + context: ../../../../ + dockerfile: internal/test/e2e/grpc/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" + image: e2e-grpc:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-grpc:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + depends_on: + grpc: + condition: service_completed_successfully + collector: + condition: service_healthy + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" diff --git a/internal/test/e2e/kafka-go/compose.yaml b/internal/test/e2e/kafka-go/compose.yaml new file mode 100644 index 000000000..303a9d080 --- /dev/null +++ b/internal/test/e2e/kafka-go/compose.yaml @@ -0,0 +1,55 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + kafka-go: + build: + context: ../../../../ + dockerfile: internal/test/e2e/kafka-go/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" + image: e2e-kafka-go:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-kafka-go:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + depends_on: + kafka-go: + condition: service_completed_successfully + collector: + condition: service_healthy + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" diff --git a/internal/test/e2e/nethttp/compose.yaml b/internal/test/e2e/nethttp/compose.yaml new file mode 100644 index 000000000..938a39a8c --- /dev/null +++ b/internal/test/e2e/nethttp/compose.yaml @@ -0,0 +1,55 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + nethttp: + build: + context: ../../../../ + dockerfile: internal/test/e2e/nethttp/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" + image: e2e-nethttp:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-nethttp:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + depends_on: + nethttp: + condition: service_completed_successfully + collector: + condition: service_healthy + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" diff --git a/internal/test/e2e/nethttp_custom/compose.yaml b/internal/test/e2e/nethttp_custom/compose.yaml new file mode 100644 index 000000000..3f310df3f --- /dev/null +++ b/internal/test/e2e/nethttp_custom/compose.yaml @@ -0,0 +1,55 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + nethttp_custom: + build: + context: ../../../../ + dockerfile: internal/test/e2e/nethttp_custom/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" + image: e2e-nethttp_custom:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-nethttp_custom:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + depends_on: + nethttp_custom: + condition: service_completed_successfully + collector: + condition: service_healthy + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" diff --git a/internal/test/e2e/otelglobal/compose.yaml b/internal/test/e2e/otelglobal/compose.yaml new file mode 100644 index 000000000..662f33831 --- /dev/null +++ b/internal/test/e2e/otelglobal/compose.yaml @@ -0,0 +1,55 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 +services: + collector: + build: + context: ../../../tools/collector/ + container_name: collector + ports: + - "4318:4318" # OTLP HTTP receiver + - "8080:8080" # Shutdown server + - "13133:13133" # Health check endpoint + command: -out=/target/traces-orig.json + volumes: + - .:/target + healthcheck: + test: ["CMD", "curl", "--silent", "--fail", "http://collector:13133/health"] + interval: 50ms + timeout: 40ms + runner: + build: + context: ../../../../ + dockerfile: internal/tools/runner/Dockerfile + image: test-runner:latest + entrypoint: ["true"] # service is just used to build image. + otelglobal: + build: + context: ../../../../ + dockerfile: internal/test/e2e/otelglobal/Dockerfile + args: + BASE_IMAGE: "test-runner:latest" + TRIGGER: "signal:SIGCONT" + image: e2e-otelglobal:latest + depends_on: + - runner + entrypoint: ["true"] # service is just used to build image. + e2e: + image: e2e-otelglobal:latest + privileged: true + environment: + - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 + - OTEL_SERVICE_NAME=sample-app + - OTEL_BSP_SCHEDULE_DELAY=60000 + depends_on: + otelglobal: + condition: service_completed_successfully + collector: + condition: service_healthy + entrypoint: ["/usr/local/bin/runner"] + command: -bin=/usr/local/bin/app + shutdown-sidecar: + image: busybox:latest + depends_on: + e2e: + condition: service_completed_successfully + entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" From 3c4f757259c46d8dcb39b006f1b8ac67f9785284 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 6 Dec 2024 14:02:02 -0800 Subject: [PATCH 08/17] Add e2e workflow --- .github/workflows/e2e.yaml | 39 +++++++++++++++++++ internal/test/e2e/autosdk/compose.yaml | 3 ++ internal/test/e2e/databasesql/compose.yaml | 3 ++ internal/test/e2e/gin/compose.yaml | 3 ++ internal/test/e2e/grpc/compose.yaml | 3 ++ internal/test/e2e/kafka-go/compose.yaml | 3 ++ internal/test/e2e/nethttp/compose.yaml | 3 ++ internal/test/e2e/nethttp_custom/compose.yaml | 3 ++ internal/test/e2e/otelglobal/compose.yaml | 3 ++ 9 files changed, 63 insertions(+) create mode 100644 .github/workflows/e2e.yaml diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 000000000..6e36f90d1 --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,39 @@ +name: e2e + +on: + push: + branches: + - main + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' + pull_request: + +jobs: + test: + strategy: + matrix: + library: + - autosdk + - databasesql + - gin + - grpc + - kafka-go + - nethttp + - nethttp_custom + - otelglobal + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Clean + run: | + rm -f ./internal/test/e2e/${{ matrix.library }}/traces{,-orig}.json + touch ./internal/test/e2e/${{ matrix.library }}/traces-orig.json + - name: Run docker-compose + uses: hoverkraft-tech/compose-action@v2.0.1 + with: + compose-file: "./internal/test/e2e/${{ matrix.library }}/compose.yaml" + - name: Setup BATS + uses: mig4/setup-bats@af9a00deb21b5d795cabfeaa8d9060410377686d # v1 + - name: Verify with BATS + run: bats ./internal/test/e2e/${{ matrix.library }}/verify.bats diff --git a/internal/test/e2e/autosdk/compose.yaml b/internal/test/e2e/autosdk/compose.yaml index 61fdf918d..b55a24de7 100644 --- a/internal/test/e2e/autosdk/compose.yaml +++ b/internal/test/e2e/autosdk/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. autosdk: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-autosdk:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-autosdk:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 diff --git a/internal/test/e2e/databasesql/compose.yaml b/internal/test/e2e/databasesql/compose.yaml index 7bcf4bff8..4dcd534e5 100644 --- a/internal/test/e2e/databasesql/compose.yaml +++ b/internal/test/e2e/databasesql/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. databasesql: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-databasesql:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-databasesql:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 diff --git a/internal/test/e2e/gin/compose.yaml b/internal/test/e2e/gin/compose.yaml index 3125e5a01..94ad04687 100644 --- a/internal/test/e2e/gin/compose.yaml +++ b/internal/test/e2e/gin/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. gin: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-gin:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-gin:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 diff --git a/internal/test/e2e/grpc/compose.yaml b/internal/test/e2e/grpc/compose.yaml index e77d09558..a0a71eeaf 100644 --- a/internal/test/e2e/grpc/compose.yaml +++ b/internal/test/e2e/grpc/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. grpc: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-grpc:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-grpc:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 diff --git a/internal/test/e2e/kafka-go/compose.yaml b/internal/test/e2e/kafka-go/compose.yaml index 303a9d080..3c2dfbd0a 100644 --- a/internal/test/e2e/kafka-go/compose.yaml +++ b/internal/test/e2e/kafka-go/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. kafka-go: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-kafka-go:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-kafka-go:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 diff --git a/internal/test/e2e/nethttp/compose.yaml b/internal/test/e2e/nethttp/compose.yaml index 938a39a8c..0d2639b28 100644 --- a/internal/test/e2e/nethttp/compose.yaml +++ b/internal/test/e2e/nethttp/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. nethttp: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-nethttp:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-nethttp:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 diff --git a/internal/test/e2e/nethttp_custom/compose.yaml b/internal/test/e2e/nethttp_custom/compose.yaml index 3f310df3f..cddbe28bd 100644 --- a/internal/test/e2e/nethttp_custom/compose.yaml +++ b/internal/test/e2e/nethttp_custom/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. nethttp_custom: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-nethttp_custom:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-nethttp_custom:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 diff --git a/internal/test/e2e/otelglobal/compose.yaml b/internal/test/e2e/otelglobal/compose.yaml index 662f33831..f0f1353d0 100644 --- a/internal/test/e2e/otelglobal/compose.yaml +++ b/internal/test/e2e/otelglobal/compose.yaml @@ -21,6 +21,7 @@ services: context: ../../../../ dockerfile: internal/tools/runner/Dockerfile image: test-runner:latest + pull_policy: build entrypoint: ["true"] # service is just used to build image. otelglobal: build: @@ -30,11 +31,13 @@ services: BASE_IMAGE: "test-runner:latest" TRIGGER: "signal:SIGCONT" image: e2e-otelglobal:latest + pull_policy: build depends_on: - runner entrypoint: ["true"] # service is just used to build image. e2e: image: e2e-otelglobal:latest + pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 From cd43eb93fadf522f04883819d2dca78baed0ecfa Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 6 Dec 2024 14:36:36 -0800 Subject: [PATCH 09/17] Run generate --- .github/workflows/e2e.yaml | 4 ++++ Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 6e36f90d1..fb8529c2a 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -25,6 +25,10 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Install build dependencies + run: sudo apt-get update && sudo apt-get install -y clang llvm libbpf-dev + - name: Run generate + run: make generate - name: Clean run: | rm -f ./internal/test/e2e/${{ matrix.library }}/traces{,-orig}.json diff --git a/Makefile b/Makefile index 997623222..e50e7eb43 100644 --- a/Makefile +++ b/Makefile @@ -169,7 +169,7 @@ e2e-nethttp: e2e/internal/test/e2e/nethttp e2e-nethttp-custom: e2e/internal/test/e2e/nethttp_custom e2e-otelglobal: e2e/internal/test/e2e/otelglobal e2e/%: DIR=$* -e2e/%: +e2e/%: generate @: > $(DIR)/traces-orig.json # Truncate or ensure ownership. @(cd $(DIR) && docker-compose up && docker-compose down) @bats $(DIR)/verify.bats From 6df36de948f3f3489e6bb7d02b69625f0f76cd8e Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 6 Dec 2024 16:11:47 -0800 Subject: [PATCH 10/17] Fix kind workflow --- .github/workflows/kind.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/kind.yml b/.github/workflows/kind.yml index 64ca03937..c15517237 100644 --- a/.github/workflows/kind.yml +++ b/.github/workflows/kind.yml @@ -34,13 +34,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Build sample app from script - if: ${{ hashFiles(format('internal/test/e2e/{0}/build.sh', matrix.library)) != '' }} - run: ./internal/test/e2e/${{ matrix.library }}/build.sh -t sample-app:latest - name: Build sample app - if: ${{ hashFiles(format('internal/test/e2e/{0}/build.sh', matrix.library)) == '' }} - working-directory: ./internal/test/e2e/${{ matrix.library }} - run: docker build -t sample-app:latest . + run: docker build -f ./internal/test/e2e/${{ matrix.library }}/Dockerfile -t sample-app:latest . - name: Set up Helm uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4 with: From 752d3114d5f7f98d5b94116243bd4e1d4070b261 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 6 Dec 2024 16:29:23 -0800 Subject: [PATCH 11/17] Fix lint --- internal/test/e2e/databasesql/main.go | 1 + internal/test/e2e/gin/main.go | 1 + internal/test/e2e/grpc/main.go | 3 ++- internal/test/e2e/kafka-go/main.go | 1 + internal/test/e2e/otelglobal/main.go | 3 ++- internal/tools/collector/main.go | 14 +++++++------- internal/tools/runner/main.go | 20 +++++++++++++------- 7 files changed, 27 insertions(+), 16 deletions(-) diff --git a/internal/test/e2e/databasesql/main.go b/internal/test/e2e/databasesql/main.go index 18c19e35b..de91f3854 100644 --- a/internal/test/e2e/databasesql/main.go +++ b/internal/test/e2e/databasesql/main.go @@ -15,6 +15,7 @@ import ( "os/signal" _ "github.com/mattn/go-sqlite3" + "go.opentelemetry.io/auto/internal/test/trigger" ) diff --git a/internal/test/e2e/gin/main.go b/internal/test/e2e/gin/main.go index 7c73467f9..99c52bfe3 100644 --- a/internal/test/e2e/gin/main.go +++ b/internal/test/e2e/gin/main.go @@ -13,6 +13,7 @@ import ( "os/signal" "github.com/gin-gonic/gin" + "go.opentelemetry.io/auto/internal/test/trigger" ) diff --git a/internal/test/e2e/grpc/main.go b/internal/test/e2e/grpc/main.go index 3678c3170..ef5fe6077 100644 --- a/internal/test/e2e/grpc/main.go +++ b/internal/test/e2e/grpc/main.go @@ -16,7 +16,6 @@ import ( "os/signal" "time" - "go.opentelemetry.io/auto/internal/test/trigger" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "google.golang.org/grpc" @@ -24,6 +23,8 @@ import ( "google.golang.org/grpc/credentials/insecure" pb "google.golang.org/grpc/examples/helloworld/helloworld" "google.golang.org/grpc/status" + + "go.opentelemetry.io/auto/internal/test/trigger" ) const port = 1701 diff --git a/internal/test/e2e/kafka-go/main.go b/internal/test/e2e/kafka-go/main.go index ce2fcb836..51de1779b 100644 --- a/internal/test/e2e/kafka-go/main.go +++ b/internal/test/e2e/kafka-go/main.go @@ -13,6 +13,7 @@ import ( "time" kafka "github.com/segmentio/kafka-go" + "go.opentelemetry.io/auto/internal/test/trigger" ) diff --git a/internal/test/e2e/otelglobal/main.go b/internal/test/e2e/otelglobal/main.go index 5e92d6ce8..ecaea15e3 100644 --- a/internal/test/e2e/otelglobal/main.go +++ b/internal/test/e2e/otelglobal/main.go @@ -10,11 +10,12 @@ import ( "os" "os/signal" - "go.opentelemetry.io/auto/internal/test/trigger" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" + + "go.opentelemetry.io/auto/internal/test/trigger" ) var tracer = otel.Tracer( diff --git a/internal/tools/collector/main.go b/internal/tools/collector/main.go index 0b4b9639e..88f55bf4f 100644 --- a/internal/tools/collector/main.go +++ b/internal/tools/collector/main.go @@ -84,8 +84,8 @@ func main() { configYaml := fmt.Sprintf(config, *outPath) logger.Debug("built config", "config", configYaml) - coll := Collector{logger: logger} - if err := coll.Start(ctx, configYaml); err != nil { + coll := collector{logger: logger} + if err := coll.start(ctx, configYaml); err != nil { logger.Error("failed to start collector", "error", err) os.Exit(1) } @@ -98,7 +98,7 @@ func main() { // Wait for the context to be canceled <-ctx.Done() - coll.Stop() + coll.stop() } func newLogger(lvlStr string) *slog.Logger { @@ -121,14 +121,14 @@ func newLogger(lvlStr string) *slog.Logger { return logger } -type Collector struct { +type collector struct { logger *slog.Logger collMu sync.Mutex coll *otelcol.Collector } -func (c *Collector) Start(ctx context.Context, configYaml string) error { +func (c *collector) start(ctx context.Context, configYaml string) error { c.collMu.Lock() defer c.collMu.Unlock() @@ -174,7 +174,7 @@ func (c *Collector) Start(ctx context.Context, configYaml string) error { return nil } -func (c *Collector) Stop() { +func (c *collector) stop() { c.logger.Info("stopping collector") c.collMu.Lock() defer c.collMu.Unlock() @@ -193,7 +193,7 @@ func startHTTPServer(addr string, cancel context.CancelFunc, logger *slog.Logger logger.Info("shutdown endpoint hit") cancel() w.WriteHeader(http.StatusOK) - w.Write([]byte("Shutting down collector...")) + _, _ = w.Write([]byte("Shutting down collector...")) }) logger.Info("starting shutdown HTTP server", "addr", addr) diff --git a/internal/tools/runner/main.go b/internal/tools/runner/main.go index b71e9cc14..0e6ff72f0 100644 --- a/internal/tools/runner/main.go +++ b/internal/tools/runner/main.go @@ -12,8 +12,9 @@ import ( "os/signal" "syscall" - "go.opentelemetry.io/auto" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" + + "go.opentelemetry.io/auto" ) func main() { @@ -32,8 +33,8 @@ func main() { ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) defer stop() - app := App{logger: logger} - if err := app.Run(ctx, *binPath); err != nil { + app := app{logger: logger} + if err := app.run(ctx, *binPath); err != nil { logger.Error("failed to run", "error", err) os.Exit(1) } @@ -59,11 +60,11 @@ func newLogger(lvlStr string) *slog.Logger { return logger } -type App struct { +type app struct { logger *slog.Logger } -func (a *App) Run(ctx context.Context, binPath string) error { +func (a *app) run(ctx context.Context, binPath string) error { exp, err := otlptracehttp.New(ctx) if err != nil { return err @@ -109,13 +110,18 @@ func (a *App) Run(ctx context.Context, binPath string) error { var sig os.Signal = syscall.SIGCONT a.logger.Debug("sending signal to target") - cmd.Process.Signal(sig) + if err := cmd.Process.Signal(sig); err != nil { + return err + } a.logger.Debug("sent signal to target") done := make(chan struct{}) go func() { - cmd.Wait() + err := cmd.Wait() close(done) + if err != nil { + a.logger.Error("command failed", "error", err) + } }() select { From 3ec5be000340a87d0c8fb51399d82500163c40f8 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 6 Dec 2024 16:44:44 -0800 Subject: [PATCH 12/17] Unify the e2e setup --- .github/workflows/e2e.yaml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index fb8529c2a..a992a461b 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -9,7 +9,26 @@ on: pull_request: jobs: + setup: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Install build dependencies + run: sudo apt-get install -y clang llvm libbpf-dev + - name: Install Go + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 + with: + go-version: "~1.23.1" + check-latest: true + - name: Run generate + run: make generate + - uses: actions/upload-artifact@v4 + with: + name: repo + path: ./ test: + needs: setup strategy: matrix: library: @@ -23,12 +42,9 @@ jobs: - otelglobal runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Install build dependencies - run: sudo apt-get update && sudo apt-get install -y clang llvm libbpf-dev - - name: Run generate - run: make generate + - uses: actions/download-artifact@v4 + with: + name: repo - name: Clean run: | rm -f ./internal/test/e2e/${{ matrix.library }}/traces{,-orig}.json From 2dfeea69a2ec514ef1399524504f446c976c2eb9 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 20 Dec 2024 13:55:43 -0800 Subject: [PATCH 13/17] Expose the collector's telemetry --- internal/tools/collector/Dockerfile | 1 + internal/tools/collector/main.go | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/tools/collector/Dockerfile b/internal/tools/collector/Dockerfile index 24ebd3297..7476f5595 100644 --- a/internal/tools/collector/Dockerfile +++ b/internal/tools/collector/Dockerfile @@ -10,5 +10,6 @@ RUN go build -o /usr/local/bin/collector ./... EXPOSE 4318 EXPOSE 8080 +EXPOSE 8888 EXPOSE 13133 ENTRYPOINT ["/usr/local/bin/collector"] diff --git a/internal/tools/collector/main.go b/internal/tools/collector/main.go index 88f55bf4f..5e446a5ac 100644 --- a/internal/tools/collector/main.go +++ b/internal/tools/collector/main.go @@ -53,9 +53,16 @@ exporters: rotation: service: - extensions: + extensions: - health_check telemetry: + metrics: + readers: + - pull: + exporter: + prometheus: + host: '0.0.0.0' + port: 8888 logs: level: "debug" pipelines: From bf268d89286a26c7394a8fe286311e9cc73e10cc Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 20 Dec 2024 13:55:59 -0800 Subject: [PATCH 14/17] Wait for the collector span # before shutdown --- internal/test/e2e/autosdk/compose.yaml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/internal/test/e2e/autosdk/compose.yaml b/internal/test/e2e/autosdk/compose.yaml index b55a24de7..765a642f0 100644 --- a/internal/test/e2e/autosdk/compose.yaml +++ b/internal/test/e2e/autosdk/compose.yaml @@ -7,6 +7,7 @@ services: container_name: collector ports: - "4318:4318" # OTLP HTTP receiver + - "8888:8888" # Internal telemetry. - "8080:8080" # Shutdown server - "13133:13133" # Health check endpoint command: -out=/target/traces-orig.json @@ -50,9 +51,32 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: + check: image: busybox:latest depends_on: e2e: condition: service_completed_successfully + entrypoint: /bin/sh + command: + - -c + - | + data() { + wget -O - http://collector:8888/metrics \ + | grep otelcol_exporter_sent_spans \ + | grep 'exporter="file/trace"' \ + | grep -o '[^ ]*$' + } + + while [ "$(data)" -ne 3 ] + do + echo "Waiting on spans..." + sleep 2 + done + echo "Received 3 spans, stopping." + exit 0 + shutdown-sidecar: + image: busybox:latest + depends_on: + check: + condition: service_completed_successfully entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" From 0f50ad9f2b2b84aa02cf378820b3de3729513134 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Fri, 20 Dec 2024 14:30:06 -0800 Subject: [PATCH 15/17] Unify shutting down into an executioner utility --- internal/test/e2e/autosdk/compose.yaml | 33 +--- internal/test/e2e/databasesql/compose.yaml | 12 +- internal/test/e2e/gin/compose.yaml | 12 +- internal/test/e2e/grpc/compose.yaml | 12 +- internal/test/e2e/kafka-go/compose.yaml | 12 +- internal/test/e2e/nethttp/compose.yaml | 12 +- internal/test/e2e/nethttp_custom/compose.yaml | 12 +- internal/test/e2e/otelglobal/compose.yaml | 12 +- internal/tools/executioner/Dockerfile | 8 + internal/tools/executioner/main.go | 154 ++++++++++++++++++ 10 files changed, 233 insertions(+), 46 deletions(-) create mode 100644 internal/tools/executioner/Dockerfile create mode 100644 internal/tools/executioner/main.go diff --git a/internal/test/e2e/autosdk/compose.yaml b/internal/test/e2e/autosdk/compose.yaml index 765a642f0..a5e994f44 100644 --- a/internal/test/e2e/autosdk/compose.yaml +++ b/internal/test/e2e/autosdk/compose.yaml @@ -51,32 +51,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - check: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh command: - - -c - - | - data() { - wget -O - http://collector:8888/metrics \ - | grep otelcol_exporter_sent_spans \ - | grep 'exporter="file/trace"' \ - | grep -o '[^ ]*$' - } - - while [ "$(data)" -ne 3 ] - do - echo "Waiting on spans..." - sleep 2 - done - echo "Received 3 spans, stopping." - exit 0 - shutdown-sidecar: - image: busybox:latest - depends_on: - check: - condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + - -collector-address=http://collector + - -span-count=3 diff --git a/internal/test/e2e/databasesql/compose.yaml b/internal/test/e2e/databasesql/compose.yaml index 4dcd534e5..750d45ff7 100644 --- a/internal/test/e2e/databasesql/compose.yaml +++ b/internal/test/e2e/databasesql/compose.yaml @@ -52,9 +52,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + command: + - -collector-address=http://collector + - -span-count=12 diff --git a/internal/test/e2e/gin/compose.yaml b/internal/test/e2e/gin/compose.yaml index 94ad04687..ca35cb233 100644 --- a/internal/test/e2e/gin/compose.yaml +++ b/internal/test/e2e/gin/compose.yaml @@ -50,9 +50,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + command: + - -collector-address=http://collector + - -span-count=2 diff --git a/internal/test/e2e/grpc/compose.yaml b/internal/test/e2e/grpc/compose.yaml index a0a71eeaf..53f6b6440 100644 --- a/internal/test/e2e/grpc/compose.yaml +++ b/internal/test/e2e/grpc/compose.yaml @@ -50,9 +50,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + command: + - -collector-address=http://collector + - -span-count=2 diff --git a/internal/test/e2e/kafka-go/compose.yaml b/internal/test/e2e/kafka-go/compose.yaml index 3c2dfbd0a..5df621352 100644 --- a/internal/test/e2e/kafka-go/compose.yaml +++ b/internal/test/e2e/kafka-go/compose.yaml @@ -50,9 +50,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + command: + - -collector-address=http://collector + - -span-count=3 diff --git a/internal/test/e2e/nethttp/compose.yaml b/internal/test/e2e/nethttp/compose.yaml index 0d2639b28..beae53383 100644 --- a/internal/test/e2e/nethttp/compose.yaml +++ b/internal/test/e2e/nethttp/compose.yaml @@ -50,9 +50,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + command: + - -collector-address=http://collector + - -span-count=2 diff --git a/internal/test/e2e/nethttp_custom/compose.yaml b/internal/test/e2e/nethttp_custom/compose.yaml index cddbe28bd..8955a4516 100644 --- a/internal/test/e2e/nethttp_custom/compose.yaml +++ b/internal/test/e2e/nethttp_custom/compose.yaml @@ -50,9 +50,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + command: + - -collector-address=http://collector + - -span-count=2 diff --git a/internal/test/e2e/otelglobal/compose.yaml b/internal/test/e2e/otelglobal/compose.yaml index f0f1353d0..f9db58b14 100644 --- a/internal/test/e2e/otelglobal/compose.yaml +++ b/internal/test/e2e/otelglobal/compose.yaml @@ -50,9 +50,15 @@ services: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] command: -bin=/usr/local/bin/app - shutdown-sidecar: - image: busybox:latest + executioner: + build: + context: ../../../../ + dockerfile: internal/tools/executioner/Dockerfile + image: test-executioner:latest + pull_policy: build depends_on: e2e: condition: service_completed_successfully - entrypoint: /bin/sh -c "while ! wget -q -O - http://collector:8080/shutdown; do sleep 2; done; exit 0" + command: + - -collector-address=http://collector + - -span-count=2 diff --git a/internal/tools/executioner/Dockerfile b/internal/tools/executioner/Dockerfile new file mode 100644 index 000000000..2c4973a33 --- /dev/null +++ b/internal/tools/executioner/Dockerfile @@ -0,0 +1,8 @@ +FROM golang:1.23 + +WORKDIR /usr/src/go.opentelemetry.io/auto/internal/tools/executioner + +COPY . /usr/src/go.opentelemetry.io/auto/ +RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o /usr/local/bin/executioner ./... + +ENTRYPOINT ["/usr/local/bin/executioner"] diff --git a/internal/tools/executioner/main.go b/internal/tools/executioner/main.go new file mode 100644 index 000000000..45144f736 --- /dev/null +++ b/internal/tools/executioner/main.go @@ -0,0 +1,154 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "context" + "flag" + "fmt" + "io" + "net/http" + "os" + "os/signal" + "strings" + "syscall" + "time" +) + +const ( + telemetryPath = "/metrics" + telemetryPort = 8888 + shutdownPath = "/shutdown" + shutdownPort = 8080 + metricName = "otelcol_exporter_sent_spans" + exporterAttr = `exporter="file/trace"` +) + +func main() { + // Command-line flags + collectorAddress := flag.String("collector-address", "http://collector", "Address of the collector") + spanCount := flag.Int("span-count", 0, "Number of spans to check before shutting down the collector") + checkLimit := flag.Int("limit", 5, "Maximum number of times to check the span count") + interval := flag.Duration("interval", 2*time.Second, "Duration between span count checks") + flag.Parse() + + if *spanCount < 0 { + fmt.Println("Error: span-count must not be negative") + return + } + + telemetryURL := fmt.Sprintf("%s:%d%s", *collectorAddress, telemetryPort, telemetryPath) + shutdownURL := fmt.Sprintf("%s:%d%s", *collectorAddress, shutdownPort, shutdownPath) + + // Context to handle SIGTERM. + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + defer stop() + + if *spanCount == 0 { + fmt.Println("Span count is 0. Skipping span count check.") + if err := sendShutdownSignal(ctx, shutdownURL); err != nil { + fmt.Println(err) + } + return + } + + fmt.Printf("Checking collector at %s for %d spans\n", telemetryURL, *spanCount) + + for i := 0; i < *checkLimit; i++ { + select { + case <-ctx.Done(): + fmt.Println("Received termination signal. Exiting.") + if err := sendShutdownSignal(ctx, shutdownURL); err != nil { + fmt.Println(err) + } + return + default: + } + + spanCountReached, err := checkSpanCount(ctx, telemetryURL, *spanCount) + if err != nil { + fmt.Printf("Error checking span count: %v\n", err) + time.Sleep(*interval) + continue + } + + if spanCountReached { + fmt.Printf("Span count of %d reached.\n", *spanCount) + if err := sendShutdownSignal(ctx, shutdownURL); err != nil { + fmt.Println(err) + } + return + } + + time.Sleep(*interval) // Wait before checking again + } + + fmt.Println("Reached check limit without meeting span count requirement.") + if err := sendShutdownSignal(ctx, shutdownURL); err != nil { + fmt.Println(err) + } +} + +func checkSpanCount(ctx context.Context, url string, targetCount int) (bool, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return false, fmt.Errorf("failed to create request: %v", err) + } + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return false, fmt.Errorf("failed to fetch telemetry data: %v", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return false, fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + + body, err := io.ReadAll(resp.Body) + if err != nil { + return false, fmt.Errorf("failed to read telemetry response body: %v", err) + } + + lines := strings.Split(string(body), "\n") + for _, line := range lines { + if strings.HasPrefix(line, metricName) && strings.Contains(line, exporterAttr) { + fields := strings.Fields(line) + if len(fields) < 2 { + continue + } + + var value int + _, err := fmt.Sscanf(fields[len(fields)-1], "%d", &value) + if err != nil { + return false, fmt.Errorf("failed to parse span count: %v", err) + } + + return value >= targetCount, nil + } + } + + return false, nil +} + +func sendShutdownSignal(ctx context.Context, url string) error { + fmt.Printf("Sending shutdown signal to %s\n", url) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, url, nil) + if err != nil { + return fmt.Errorf("failed to create shutdown request: %v", err) + } + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return fmt.Errorf("failed to send shutdown request: %v", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + + fmt.Println("Shutdown signal sent successfully.") + return nil +} From 9bc9e5232bdb44292daf2dfe8897055e0eafc00b Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Sat, 21 Dec 2024 08:36:49 -0800 Subject: [PATCH 16/17] Flatten the e2e service --- internal/test/e2e/autosdk/compose.yaml | 12 +++--------- internal/test/e2e/databasesql/compose.yaml | 12 +++--------- internal/test/e2e/gin/compose.yaml | 12 +++--------- internal/test/e2e/grpc/compose.yaml | 14 ++++---------- internal/test/e2e/kafka-go/compose.yaml | 12 +++--------- internal/test/e2e/nethttp/compose.yaml | 12 +++--------- internal/test/e2e/nethttp_custom/compose.yaml | 12 +++--------- internal/test/e2e/otelglobal/compose.yaml | 12 +++--------- 8 files changed, 25 insertions(+), 73 deletions(-) diff --git a/internal/test/e2e/autosdk/compose.yaml b/internal/test/e2e/autosdk/compose.yaml index a5e994f44..bad23d2a0 100644 --- a/internal/test/e2e/autosdk/compose.yaml +++ b/internal/test/e2e/autosdk/compose.yaml @@ -24,7 +24,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - autosdk: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/autosdk/Dockerfile @@ -33,20 +33,14 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-autosdk:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-autosdk:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 - OTEL_SERVICE_NAME=sample-app - OTEL_BSP_SCHEDULE_DELAY=60000 depends_on: - autosdk: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] diff --git a/internal/test/e2e/databasesql/compose.yaml b/internal/test/e2e/databasesql/compose.yaml index 750d45ff7..712d6d35d 100644 --- a/internal/test/e2e/databasesql/compose.yaml +++ b/internal/test/e2e/databasesql/compose.yaml @@ -23,7 +23,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - databasesql: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/databasesql/Dockerfile @@ -32,12 +32,6 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-databasesql:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-databasesql:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 @@ -46,8 +40,8 @@ services: - OTEL_GO_AUTO_INCLUDE_DB_STATEMENT=true - OTEL_GO_AUTO_PARSE_DB_STATEMENT=true depends_on: - databasesql: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] diff --git a/internal/test/e2e/gin/compose.yaml b/internal/test/e2e/gin/compose.yaml index ca35cb233..20faf8c47 100644 --- a/internal/test/e2e/gin/compose.yaml +++ b/internal/test/e2e/gin/compose.yaml @@ -23,7 +23,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - gin: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/gin/Dockerfile @@ -32,20 +32,14 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-gin:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-gin:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 - OTEL_SERVICE_NAME=sample-app - OTEL_BSP_SCHEDULE_DELAY=60000 depends_on: - gin: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] diff --git a/internal/test/e2e/grpc/compose.yaml b/internal/test/e2e/grpc/compose.yaml index 53f6b6440..22b0cd7e6 100644 --- a/internal/test/e2e/grpc/compose.yaml +++ b/internal/test/e2e/grpc/compose.yaml @@ -23,7 +23,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - grpc: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/grpc/Dockerfile @@ -32,20 +32,14 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-grpc:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-grpc:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 - OTEL_SERVICE_NAME=sample-app - OTEL_BSP_SCHEDULE_DELAY=60000 depends_on: - grpc: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] @@ -61,4 +55,4 @@ services: condition: service_completed_successfully command: - -collector-address=http://collector - - -span-count=2 + - -span-count=3 diff --git a/internal/test/e2e/kafka-go/compose.yaml b/internal/test/e2e/kafka-go/compose.yaml index 5df621352..e263d2831 100644 --- a/internal/test/e2e/kafka-go/compose.yaml +++ b/internal/test/e2e/kafka-go/compose.yaml @@ -23,7 +23,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - kafka-go: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/kafka-go/Dockerfile @@ -32,20 +32,14 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-kafka-go:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-kafka-go:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 - OTEL_SERVICE_NAME=sample-app - OTEL_BSP_SCHEDULE_DELAY=60000 depends_on: - kafka-go: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] diff --git a/internal/test/e2e/nethttp/compose.yaml b/internal/test/e2e/nethttp/compose.yaml index beae53383..a8dfbc0fd 100644 --- a/internal/test/e2e/nethttp/compose.yaml +++ b/internal/test/e2e/nethttp/compose.yaml @@ -23,7 +23,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - nethttp: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/nethttp/Dockerfile @@ -32,20 +32,14 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-nethttp:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-nethttp:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 - OTEL_SERVICE_NAME=sample-app - OTEL_BSP_SCHEDULE_DELAY=60000 depends_on: - nethttp: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] diff --git a/internal/test/e2e/nethttp_custom/compose.yaml b/internal/test/e2e/nethttp_custom/compose.yaml index 8955a4516..023706648 100644 --- a/internal/test/e2e/nethttp_custom/compose.yaml +++ b/internal/test/e2e/nethttp_custom/compose.yaml @@ -23,7 +23,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - nethttp_custom: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/nethttp_custom/Dockerfile @@ -32,20 +32,14 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-nethttp_custom:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-nethttp_custom:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 - OTEL_SERVICE_NAME=sample-app - OTEL_BSP_SCHEDULE_DELAY=60000 depends_on: - nethttp_custom: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] diff --git a/internal/test/e2e/otelglobal/compose.yaml b/internal/test/e2e/otelglobal/compose.yaml index f9db58b14..89afb49ec 100644 --- a/internal/test/e2e/otelglobal/compose.yaml +++ b/internal/test/e2e/otelglobal/compose.yaml @@ -23,7 +23,7 @@ services: image: test-runner:latest pull_policy: build entrypoint: ["true"] # service is just used to build image. - otelglobal: + e2e: build: context: ../../../../ dockerfile: internal/test/e2e/otelglobal/Dockerfile @@ -32,20 +32,14 @@ services: TRIGGER: "signal:SIGCONT" image: e2e-otelglobal:latest pull_policy: build - depends_on: - - runner - entrypoint: ["true"] # service is just used to build image. - e2e: - image: e2e-otelglobal:latest - pull_policy: build privileged: true environment: - OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318 - OTEL_SERVICE_NAME=sample-app - OTEL_BSP_SCHEDULE_DELAY=60000 depends_on: - otelglobal: - condition: service_completed_successfully + runner: + condition: service_started collector: condition: service_healthy entrypoint: ["/usr/local/bin/runner"] From f0d05936e229189ccbb0d6c131f0d7011cf93032 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Tue, 7 Jan 2025 14:18:40 -0800 Subject: [PATCH 17/17] Clean up collector --- internal/tools/collector/main.go | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/internal/tools/collector/main.go b/internal/tools/collector/main.go index 5e446a5ac..111be2d0b 100644 --- a/internal/tools/collector/main.go +++ b/internal/tools/collector/main.go @@ -11,7 +11,6 @@ import ( "net/http" "os" "os/signal" - "sync" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension" @@ -97,8 +96,6 @@ func main() { os.Exit(1) } - *listen = getEnv("SHUTDOWN_SERVER_ADDR", ":8080") - // Start the HTTP server for shutdown endpoint go startHTTPServer(*listen, cancel, logger) @@ -131,14 +128,10 @@ func newLogger(lvlStr string) *slog.Logger { type collector struct { logger *slog.Logger - collMu sync.Mutex - coll *otelcol.Collector + coll *otelcol.Collector } func (c *collector) start(ctx context.Context, configYaml string) error { - c.collMu.Lock() - defer c.collMu.Unlock() - c.logger.Debug("starting collector") info := component.BuildInfo{ @@ -183,8 +176,6 @@ func (c *collector) start(ctx context.Context, configYaml string) error { func (c *collector) stop() { c.logger.Info("stopping collector") - c.collMu.Lock() - defer c.collMu.Unlock() if c.coll == nil { return @@ -196,7 +187,8 @@ func (c *collector) stop() { } func startHTTPServer(addr string, cancel context.CancelFunc, logger *slog.Logger) { - http.HandleFunc(shutdownPath, func(w http.ResponseWriter, r *http.Request) { + mux := http.NewServeMux() + mux.HandleFunc(shutdownPath, func(w http.ResponseWriter, r *http.Request) { logger.Info("shutdown endpoint hit") cancel() w.WriteHeader(http.StatusOK) @@ -204,18 +196,12 @@ func startHTTPServer(addr string, cancel context.CancelFunc, logger *slog.Logger }) logger.Info("starting shutdown HTTP server", "addr", addr) - if err := http.ListenAndServe(addr, nil); err != nil && !errors.Is(err, http.ErrServerClosed) { + err := http.ListenAndServe(addr, mux) + if err != nil && !errors.Is(err, http.ErrServerClosed) { logger.Error("failed to start HTTP server", "error", err) } } -func getEnv(key, defaultValue string) string { - if value, exists := os.LookupEnv(key); exists { - return value - } - return defaultValue -} - func components() (otelcol.Factories, error) { var err error factories := otelcol.Factories{}