From d8140a6e78ffe395a9019ba5950f1118cae795c7 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Tue, 27 Aug 2024 16:04:06 +0300 Subject: [PATCH 01/10] Add config provider and ApplyConfig API to ebpf director --- odiglet/go.mod | 59 ++++---- odiglet/go.sum | 134 ++++++++++-------- odiglet/pkg/ebpf/configprovider.go | 66 +++++++++ odiglet/pkg/ebpf/director.go | 29 +++- odiglet/pkg/ebpf/go.go | 42 +++++- .../instrumentationconfig.go | 52 +++++++ .../pkg/kube/instrumentation_ebpf/manager.go | 16 +++ 7 files changed, 305 insertions(+), 93 deletions(-) create mode 100644 odiglet/pkg/ebpf/configprovider.go create mode 100644 odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go diff --git a/odiglet/go.mod b/odiglet/go.mod index 67cb0fa30..4317a6462 100644 --- a/odiglet/go.mod +++ b/odiglet/go.mod @@ -14,9 +14,9 @@ require ( github.com/odigos-io/odigos/opampserver v0.0.0 github.com/odigos-io/odigos/procdiscovery v0.0.0 github.com/odigos-io/opentelemetry-zap-bridge v0.0.5 - go.opentelemetry.io/auto v0.14.0-alpha - go.opentelemetry.io/otel v1.28.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 + go.opentelemetry.io/auto v0.14.0-alpha.0.20240825151512-46ef49139923 + go.opentelemetry.io/otel v1.29.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 go.uber.org/zap v1.27.0 google.golang.org/grpc v1.65.0 k8s.io/api v0.31.0 @@ -31,7 +31,7 @@ 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/cilium/ebpf v0.15.0 // indirect + github.com/cilium/ebpf v0.16.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect @@ -50,11 +50,12 @@ require ( github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect @@ -62,7 +63,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_golang v1.20.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect @@ -70,35 +71,35 @@ require ( github.com/x448/float16 v0.8.4 // indirect go.opentelemetry.io/contrib/bridges/prometheus v0.53.0 // indirect go.opentelemetry.io/contrib/exporters/autoexport v0.53.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.4.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 // indirect - go.opentelemetry.io/otel/log v0.4.0 // indirect - go.opentelemetry.io/otel/metric v1.28.0 // indirect - go.opentelemetry.io/otel/sdk v1.28.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.4.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect - go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 // indirect + go.opentelemetry.io/otel/log v0.5.0 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect + go.opentelemetry.io/otel/sdk v1.29.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.5.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/arch v0.8.0 // indirect + golang.org/x/arch v0.9.0 // indirect golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/term v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/term v0.23.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/odiglet/go.sum b/odiglet/go.sum index 3fd518829..0b97a81a4 100644 --- a/odiglet/go.sum +++ b/odiglet/go.sum @@ -48,8 +48,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.15.0 h1:7NxJhNiBT3NG8pZJ3c+yfrVdHY8ScgKD27sScgjLMMk= -github.com/cilium/ebpf v0.15.0/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso= +github.com/cilium/ebpf v0.16.0 h1:+BiEnHL6Z7lXnlGUsXQPPAE7+kenAd4ES8MQ5min0Ok= +github.com/cilium/ebpf v0.16.0/go.mod h1:L7u2Blt2jMM/vLAVgjxluxtBKlz3/GWjB0dMOEngfwE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -176,8 +176,8 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I= 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 v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -189,6 +189,10 @@ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +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.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -199,6 +203,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -213,6 +219,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubevirt/device-plugin-manager v1.19.5 h1:nA9rPpQyWBNyrpqaZe2aW4PZfTBbyOgm16+O9q7FQts= github.com/kubevirt/device-plugin-manager v1.19.5/go.mod h1:gPIAptDNdxXBVbq4I2eNPlLy8ZHbd24KpjNLWmpfQuU= +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/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -225,6 +233,10 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +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/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= @@ -270,8 +282,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.1 h1:IMJXHOD6eARkQpxo8KkhgEVFlBNm+nkrFUyGlIu7Na8= +github.com/prometheus/client_golang v1.20.1/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -319,46 +331,46 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/auto v0.14.0-alpha h1:Dc8MoRawqVu/0EQxTpDjBmUHHRSQ6ATbKkjGoUTWaOw= -go.opentelemetry.io/auto v0.14.0-alpha/go.mod h1:OyuWH1KVgewc6YKakfDn48arE3giVB/IyQRtH/47oPI= +go.opentelemetry.io/auto v0.14.0-alpha.0.20240825151512-46ef49139923 h1:wSU80zHrOf8SQDfgOGo21bqDIMKok5NWy4BltMtCamE= +go.opentelemetry.io/auto v0.14.0-alpha.0.20240825151512-46ef49139923/go.mod h1:VCih+Cig/z0X8WHrmyaIK1rRo/T66rP7z9OPFMTM+wI= go.opentelemetry.io/contrib/bridges/prometheus v0.53.0 h1:BdkKDtcrHThgjcEia1737OUuFdP6xzBKAMx2sNZCkvE= go.opentelemetry.io/contrib/bridges/prometheus v0.53.0/go.mod h1:ZkhVxcJgeXlL/lVyT/vxNHVFiSG5qOaDwYaSgD8IfZo= go.opentelemetry.io/contrib/exporters/autoexport v0.53.0 h1:13K+tY7E8GJInkrvRiPAhC0gi/7vKjzDNhtmCf+QXG8= go.opentelemetry.io/contrib/exporters/autoexport v0.53.0/go.mod h1:lyQF6xQ4iDnMg4sccNdFs1zf62xd79YI8vZqKjOTwMs= -go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= -go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.4.0 h1:zBPZAISA9NOc5cE8zydqDiS0itvg/P/0Hn9m72a5gvM= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.4.0/go.mod h1:gcj2fFjEsqpV3fXuzAA+0Ze1p2/4MJ4T7d77AmkvueQ= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 h1:U2guen0GhqH8o/G2un8f/aG/y++OuW6MyCo6hT9prXk= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0/go.mod h1:yeGZANgEcpdx/WK0IvvRFC+2oLiMS2u4L/0Rj2M2Qr0= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0 h1:aLmmtjRke7LPDQ3lvpFz+kNEH43faFhzW7v8BFIEydg= -go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0/go.mod h1:TC1pyCt6G9Sjb4bQpShH+P5R53pO6ZuGnHuuln9xMeE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 h1:R3X6ZXmNPRR8ul6i3WgFURCHzaXjHdm0karRG/+dj3s= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0/go.mod h1:QWFXnDavXWwMx2EEcZsf3yxgEKAqsxQ+Syjp+seyInw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03ymgYhPKmeXGk5Zu+cIZOlVzd9Zv7QIiyItjFBU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk= -go.opentelemetry.io/otel/exporters/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng= -go.opentelemetry.io/otel/exporters/prometheus v0.50.0/go.mod h1:pMm5PkUo5YwbLiuEf7t2xg4wbP0/eSJrMxIMxKosynY= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0 h1:0MH3f8lZrflbUWXVxyBg/zviDFdGE062uKh5+fu8Vv0= -go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.4.0/go.mod h1:Vh68vYiHY5mPdekTr0ox0sALsqjoVy0w3Os278yX5SQ= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0 h1:BJee2iLkfRfl9lc7aFmBwkWxY/RI1RDdXepSF6y8TPE= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.28.0/go.mod h1:DIzlHs3DRscCIBU3Y9YSzPfScwnYnzfnCd4g8zA7bZc= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0 h1:EVSnY9JbEEW92bEkIYOVMw4q1WJxIAGoFTrtYOzWuRQ= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.28.0/go.mod h1:Ea1N1QQryNXpCD0I1fdLibBAIpQuBkznMmkdKrapk1Y= -go.opentelemetry.io/otel/log v0.4.0 h1:/vZ+3Utqh18e8TPjuc3ecg284078KWrR8BRz+PQAj3o= -go.opentelemetry.io/otel/log v0.4.0/go.mod h1:DhGnQvky7pHy82MIRV43iXh3FlKN8UUKftn0KbLOq6I= -go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= -go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= -go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= -go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= -go.opentelemetry.io/otel/sdk/log v0.4.0 h1:1mMI22L82zLqf6KtkjrRy5BbagOTWdJsqMY/HSqILAA= -go.opentelemetry.io/otel/sdk/log v0.4.0/go.mod h1:AYJ9FVF0hNOgAVzUG/ybg/QttnXhUePWAupmCqtdESo= -go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08= -go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg= -go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= -go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0 h1:4d++HQ+Ihdl+53zSjtsCUFDmNMju2FC9qFkUlTxPLqo= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.5.0/go.mod h1:mQX5dTO3Mh5ZF7bPKDkt5c/7C41u/SiDr9XgTpzXXn8= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0 h1:k6fQVDQexDE+3jG2SfCQjnHS7OamcP73YMoxEVq5B6k= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.29.0/go.mod h1:t4BrYLHU450Zo9fnydWlIuswB1bm7rM8havDpWOJeDo= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 h1:xvhQxJ/C9+RTnAj5DpTg7LSM1vbbMTiXt7e9hsfqHNw= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0/go.mod h1:Fcvs2Bz1jkDM+Wf5/ozBGmi3tQ/c9zPKLnsipnfhGAo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 h1:dIIDULZJpgdiHz5tXrTgKIMLkus6jEFa7x5SOKcyR7E= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0/go.mod h1:jlRVBe7+Z1wyxFSUs48L6OBQZ5JwH2Hg/Vbl+t9rAgI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 h1:nSiV3s7wiCam610XcLbYOmMfJxB9gO4uK3Xgv5gmTgg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0/go.mod h1:hKn/e/Nmd19/x1gvIHwtOwVWM+VhuITSWip3JUDghj0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 h1:JAv0Jwtl01UFiyWZEMiJZBiTlv5A50zNs8lsthXqIio= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0/go.mod h1:QNKLmUEAq2QUbPQUfvw4fmv0bgbK7UlOSFCnXyfvSNc= +go.opentelemetry.io/otel/exporters/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= +go.opentelemetry.io/otel/exporters/prometheus v0.51.0/go.mod h1:v0mFe5Kk7woIh938mrZBJBmENYquyA0IICrlYm4Y0t4= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0 h1:ThVXnEsdwNcxdBO+r96ci1xbF+PgNjwlk457VNuJODo= +go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.5.0/go.mod h1:rHWcSmC4q2h3gje/yOq6sAOaq8+UHxN/Ru3BbmDXOfY= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0 h1:X3ZjNp36/WlkSYx0ul2jw4PtbNEDDeLskw3VPsrpYM0= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.29.0/go.mod h1:2uL/xnOXh0CHOBFCWXz5u1A4GXLiW+0IQIzVbeOEQ0U= +go.opentelemetry.io/otel/log v0.5.0 h1:x1Pr6Y3gnXgl1iFBwtGy1W/mnzENoK0w0ZoaeOI3i30= +go.opentelemetry.io/otel/log v0.5.0/go.mod h1:NU/ozXeGuOR5/mjCRXYbTC00NFJ3NYuraV/7O78F0rE= +go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= +go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= +go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo= +go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok= +go.opentelemetry.io/otel/sdk/log v0.5.0 h1:A+9lSjlZGxkQOr7QSBJcuyyYBw79CufQ69saiJLey7o= +go.opentelemetry.io/otel/sdk/log v0.5.0/go.mod h1:zjxIW7sw1IHolZL2KlSAtrUi8JHttoeiQy43Yl3WuVQ= +go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY= +go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ= +go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -370,8 +382,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 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.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= -golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.9.0 h1:ub9TgUInamJ8mrZIGlBG6/4TqWeMszd4N8lNorbrr6k= +golang.org/x/arch v0.9.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -379,8 +391,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -424,14 +436,14 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -439,6 +451,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.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-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -466,16 +480,16 @@ golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -535,10 +549,10 @@ google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBr google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200916143405-f6a2fa72f0c4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= -google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd h1:BBOTEWLuuEGQy9n1y9MhVJ9Qt0BDu21X8qZs71/uPZo= +google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd h1:6TEm2ZxXoQmFWFlt1vNxvVOa1Q0dXFQD1m/rYjXmS0E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/odiglet/pkg/ebpf/configprovider.go b/odiglet/pkg/ebpf/configprovider.go new file mode 100644 index 000000000..702cfa777 --- /dev/null +++ b/odiglet/pkg/ebpf/configprovider.go @@ -0,0 +1,66 @@ +package ebpf + +import ( + "context" + "errors" + "sync" + + "github.com/odigos-io/odigos/odiglet/pkg/log" +) + +type configProvider[C any] struct { + configChan chan C + initialConfig C + + stoppedMutex sync.Mutex + stopped bool +} + +func newConfigProvider[C any](initialConfig C) *configProvider[C] { + return &configProvider[C]{ + initialConfig: initialConfig, + configChan: make(chan C), + } +} + +func (c *configProvider[C]) InitialConfig(_ context.Context) C { + return c.initialConfig +} + +func (c *configProvider[C]) Shutdown(_ context.Context) error { + c.stoppedMutex.Lock() + defer c.stoppedMutex.Unlock() + + if c.stopped { + return nil + } + + close(c.configChan) + c.stopped = true + return nil +} + +func (c *configProvider[C]) Watch() <-chan C { + return c.configChan +} + +func (c *configProvider[C]) SendConfig(ctx context.Context, newConfig C) error { + c.stoppedMutex.Lock() + defer c.stoppedMutex.Unlock() + + if c.stopped { + log.Logger.Info("SendConfig called on stopped configProvider, the supplied config will be ignored") + return nil + } + + // send a config or potentially return an error on timeout + select { + case c.configChan <- newConfig: + return nil + case <-ctx.Done(): + if ctx.Err() == context.DeadlineExceeded { + return errors.New("failed to update config of instrumentation: timeout waiting for config update") + } + return ctx.Err() + } +} diff --git a/odiglet/pkg/ebpf/director.go b/odiglet/pkg/ebpf/director.go index 21e028063..d4023c1d7 100644 --- a/odiglet/pkg/ebpf/director.go +++ b/odiglet/pkg/ebpf/director.go @@ -2,6 +2,7 @@ package ebpf import ( "context" + "fmt" "sync" odigosv1 "github.com/odigos-io/odigos/api/odigos/v1alpha1" @@ -22,6 +23,7 @@ import ( type OtelEbpfSdk interface { Run(ctx context.Context) error Close(ctx context.Context) error + ApplyConfig(ctx context.Context, config *odigosv1.InstrumentationConfig) error } // users can use different eBPF otel SDKs by returning them from this function @@ -35,6 +37,7 @@ type Director interface { Instrument(ctx context.Context, pid int, podDetails types.NamespacedName, podWorkload *workload.PodWorkload, appName string, containerName string) error Cleanup(podDetails types.NamespacedName) Shutdown() + ApplyInstrumentationConfig(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error } type podDetails struct { @@ -101,6 +104,8 @@ type DirectorKey struct { type DirectorsMap map[DirectorKey]Director +var _ Director = &EbpfDirector[*GoOtelEbpfSdk]{} + func NewEbpfDirector[T OtelEbpfSdk](ctx context.Context, client client.Client, scheme *runtime.Scheme, language common.ProgrammingLanguage, instrumentationFactory InstrumentationFactory[T]) *EbpfDirector[T] { director := &EbpfDirector[T]{ language: language, @@ -118,6 +123,27 @@ func NewEbpfDirector[T OtelEbpfSdk](ctx context.Context, client client.Client, s return director } +func (d *EbpfDirector[T]) ApplyInstrumentationConfig(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error { + d.mux.Lock() + defer d.mux.Unlock() + + insts := d.GetWorkloadInstrumentations(workload) + + log.Logger.V(3).Info("Applying config to instrumentations after CRD change", "instrumentationConfig", instrumentationConfig, "workload", workload, "SDKs count", len(insts)) + + var retErr []error + for _, inst := range insts { + err := inst.ApplyConfig(ctx, instrumentationConfig) + if err != nil { + retErr = append(retErr, err) + } + } + if len(retErr) > 0 { + return fmt.Errorf("failed to apply config to %d instrumentations", len(retErr)) + } + return nil +} + func (d *EbpfDirector[T]) observeInstrumentations(ctx context.Context, scheme *runtime.Scheme) { for { select { @@ -312,9 +338,6 @@ func (d *EbpfDirector[T]) Shutdown() { } func (d *EbpfDirector[T]) GetWorkloadInstrumentations(workload *workload.PodWorkload) []T { - d.mux.Lock() - defer d.mux.Unlock() - pods, ok := d.workloadToPods[*workload] if !ok { return nil diff --git a/odiglet/pkg/ebpf/go.go b/odiglet/pkg/ebpf/go.go index 531b51c90..082984117 100644 --- a/odiglet/pkg/ebpf/go.go +++ b/odiglet/pkg/ebpf/go.go @@ -4,6 +4,8 @@ import ( "context" "fmt" + "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/common" "github.com/odigos-io/odigos/k8sutils/pkg/workload" "github.com/odigos-io/odigos/odiglet/pkg/kube/utils" @@ -11,13 +13,18 @@ import ( "github.com/odigos-io/odigos/odiglet/pkg/instrumentation/consts" "github.com/odigos-io/odigos/odiglet/pkg/log" "go.opentelemetry.io/auto" + goAutoConfig "go.opentelemetry.io/auto/config" "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc" ) type GoOtelEbpfSdk struct { inst *auto.Instrumentation + cp *configProvider[goAutoConfig.InstrumentationConfig] } +// compile-time check that configProvider[goAutoConfig.InstrumentationConfig] implements goAutoConfig.Provider +var _ goAutoConfig.Provider = (*configProvider[goAutoConfig.InstrumentationConfig])(nil) + type GoInstrumentationFactory struct{} func NewGoInstrumentationFactory() InstrumentationFactory[*GoOtelEbpfSdk] { @@ -35,6 +42,8 @@ func (g *GoInstrumentationFactory) CreateEbpfInstrumentation(ctx context.Context return nil, err } + cp := newConfigProvider(goAutoConfig.InstrumentationConfig{}) + inst, err := auto.NewInstrumentation( ctx, auto.WithEnv(), // for OTEL_LOG_LEVEL @@ -44,13 +53,14 @@ func (g *GoInstrumentationFactory) CreateEbpfInstrumentation(ctx context.Context auto.WithTraceExporter(defaultExporter), auto.WithGlobal(), auto.WithLoadedIndicator(loadedIndicator), + auto.WithConfigProvider(cp), ) if err != nil { log.Logger.Error(err, "instrumentation setup failed") return nil, err } - return &GoOtelEbpfSdk{inst: inst}, nil + return &GoOtelEbpfSdk{inst: inst, cp: cp}, nil } func (g *GoOtelEbpfSdk) Run(ctx context.Context) error { @@ -60,3 +70,33 @@ func (g *GoOtelEbpfSdk) Run(ctx context.Context) error { func (g *GoOtelEbpfSdk) Close(ctx context.Context) error { return g.inst.Close() } + +func (g *GoOtelEbpfSdk) ApplyConfig(ctx context.Context, instConfig *v1alpha1.InstrumentationConfig) error { + return g.cp.SendConfig(ctx, convertToGoInstrumentationConfig(instConfig)) +} + +func convertToGoInstrumentationConfig(instConfig *v1alpha1.InstrumentationConfig) goAutoConfig.InstrumentationConfig { + ic := goAutoConfig.InstrumentationConfig{} + ic.InstrumentationLibraryConfigs = make(map[goAutoConfig.InstrumentationLibraryID]goAutoConfig.InstrumentationLibrary) + for _, sdkConfig := range instConfig.Spec.SdkConfigs { + if sdkConfig.Language != common.GoProgrammingLanguage { + continue + } + for _, ilc := range sdkConfig.InstrumentationLibraryConfigs { + libID := goAutoConfig.InstrumentationLibraryID{ + InstrumentedPkg: ilc.InstrumentationLibraryId.InstrumentationLibraryName, + SpanKind: common.SpanKindOdigosToOtel(ilc.InstrumentationLibraryId.SpanKind), + } + var tracesEnabled *bool + if ilc.TraceConfig != nil { + tracesEnabled = ilc.TraceConfig.Enabled + } + ic.InstrumentationLibraryConfigs[libID] = goAutoConfig.InstrumentationLibrary{ + TracesEnabled: tracesEnabled, + } + } + + // TODO: sampling config + } + return ic +} diff --git a/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go b/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go new file mode 100644 index 000000000..c6ddf0511 --- /dev/null +++ b/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go @@ -0,0 +1,52 @@ +package instrumentation_ebpf + +import ( + "context" + + odigosv1 "github.com/odigos-io/odigos/api/odigos/v1alpha1" + "github.com/odigos-io/odigos/k8sutils/pkg/workload" + "github.com/odigos-io/odigos/odiglet/pkg/ebpf" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/runtime" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type InstrumentationConfigReconciler struct { + client.Client + Scheme *runtime.Scheme + Directors ebpf.DirectorsMap +} + +func (i *InstrumentationConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + workloadName, workloadKind, err := workload.ExtractWorkloadInfoFromRuntimeObjectName(req.Name) + if err != nil { + return ctrl.Result{}, err + } + + podWorkload := &workload.PodWorkload{ + Namespace: req.Namespace, + Kind: workloadKind, + Name: workloadName, + } + + // Fetch the InstrumentationConfig instrumentationConfig + instrumentationConfig := &odigosv1.InstrumentationConfig{} + err = i.Get(ctx, req.NamespacedName, instrumentationConfig) + if err != nil { + if apierrors.IsNotFound(err) { + return ctrl.Result{}, nil + } else { + return ctrl.Result{}, err + } + } + + for _, director := range i.Directors { + err = director.ApplyInstrumentationConfig(ctx, podWorkload, instrumentationConfig) + if err != nil { + return ctrl.Result{}, err + } + } + + return ctrl.Result{}, nil +} \ No newline at end of file diff --git a/odiglet/pkg/kube/instrumentation_ebpf/manager.go b/odiglet/pkg/kube/instrumentation_ebpf/manager.go index a5016930c..d090eb722 100644 --- a/odiglet/pkg/kube/instrumentation_ebpf/manager.go +++ b/odiglet/pkg/kube/instrumentation_ebpf/manager.go @@ -4,6 +4,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" + odigosv1 "github.com/odigos-io/odigos/api/odigos/v1alpha1" "github.com/odigos-io/odigos/odiglet/pkg/ebpf" "github.com/odigos-io/odigos/odiglet/pkg/log" corev1 "k8s.io/api/core/v1" @@ -53,6 +54,7 @@ func SetupWithManager(mgr ctrl.Manager, ebpfDirectors ebpf.DirectorsMap) error { err := builder. ControllerManagedBy(mgr). + Named("PodReconciler_ebpf"). For(&corev1.Pod{}). WithEventFilter(&podPredicate{}). Complete(&PodsReconciler{ @@ -64,5 +66,19 @@ func SetupWithManager(mgr ctrl.Manager, ebpfDirectors ebpf.DirectorsMap) error { return err } + err = builder. + ControllerManagedBy(mgr). + Named("InstrumentationConfigReconciler_ebpf"). + For(&odigosv1.InstrumentationConfig{}). + WithEventFilter(predicate.GenerationChangedPredicate{}). + Complete(&InstrumentationConfigReconciler{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + Directors: ebpfDirectors, + }) + if err != nil { + return err + } + return nil } From e36e667376e900c814f3998b0608f7da7dd00651 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 1 Sep 2024 13:11:01 +0300 Subject: [PATCH 02/10] export the NewConfigProvider function --- odiglet/pkg/ebpf/configprovider.go | 5 ++++- odiglet/pkg/ebpf/go.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/odiglet/pkg/ebpf/configprovider.go b/odiglet/pkg/ebpf/configprovider.go index 702cfa777..16ba76f74 100644 --- a/odiglet/pkg/ebpf/configprovider.go +++ b/odiglet/pkg/ebpf/configprovider.go @@ -16,7 +16,9 @@ type configProvider[C any] struct { stopped bool } -func newConfigProvider[C any](initialConfig C) *configProvider[C] { +// NewConfigProvider creates a new configProvider with the given initial config. +// It allows for updating the configuration of a running instrumentation. +func NewConfigProvider[C any](initialConfig C) *configProvider[C] { return &configProvider[C]{ initialConfig: initialConfig, configChan: make(chan C), @@ -54,6 +56,7 @@ func (c *configProvider[C]) SendConfig(ctx context.Context, newConfig C) error { } // send a config or potentially return an error on timeout + // TODO: we should decide on a timeout value for sending config. select { case c.configChan <- newConfig: return nil diff --git a/odiglet/pkg/ebpf/go.go b/odiglet/pkg/ebpf/go.go index 082984117..66b5d016d 100644 --- a/odiglet/pkg/ebpf/go.go +++ b/odiglet/pkg/ebpf/go.go @@ -19,7 +19,7 @@ import ( type GoOtelEbpfSdk struct { inst *auto.Instrumentation - cp *configProvider[goAutoConfig.InstrumentationConfig] + cp *configProvider[goAutoConfig.InstrumentationConfig] } // compile-time check that configProvider[goAutoConfig.InstrumentationConfig] implements goAutoConfig.Provider @@ -42,7 +42,7 @@ func (g *GoInstrumentationFactory) CreateEbpfInstrumentation(ctx context.Context return nil, err } - cp := newConfigProvider(goAutoConfig.InstrumentationConfig{}) + cp := NewConfigProvider(goAutoConfig.InstrumentationConfig{}) inst, err := auto.NewInstrumentation( ctx, From a9f7fbfaf8d4e5a99232283bc984dce09cab94dc Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 1 Sep 2024 13:23:40 +0300 Subject: [PATCH 03/10] export ConfigProvider struct --- odiglet/pkg/ebpf/configprovider.go | 14 +++++++------- odiglet/pkg/ebpf/go.go | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/odiglet/pkg/ebpf/configprovider.go b/odiglet/pkg/ebpf/configprovider.go index 16ba76f74..552c89fbb 100644 --- a/odiglet/pkg/ebpf/configprovider.go +++ b/odiglet/pkg/ebpf/configprovider.go @@ -8,7 +8,7 @@ import ( "github.com/odigos-io/odigos/odiglet/pkg/log" ) -type configProvider[C any] struct { +type ConfigProvider[C any] struct { configChan chan C initialConfig C @@ -18,18 +18,18 @@ type configProvider[C any] struct { // NewConfigProvider creates a new configProvider with the given initial config. // It allows for updating the configuration of a running instrumentation. -func NewConfigProvider[C any](initialConfig C) *configProvider[C] { - return &configProvider[C]{ +func NewConfigProvider[C any](initialConfig C) *ConfigProvider[C] { + return &ConfigProvider[C]{ initialConfig: initialConfig, configChan: make(chan C), } } -func (c *configProvider[C]) InitialConfig(_ context.Context) C { +func (c *ConfigProvider[C]) InitialConfig(_ context.Context) C { return c.initialConfig } -func (c *configProvider[C]) Shutdown(_ context.Context) error { +func (c *ConfigProvider[C]) Shutdown(_ context.Context) error { c.stoppedMutex.Lock() defer c.stoppedMutex.Unlock() @@ -42,11 +42,11 @@ func (c *configProvider[C]) Shutdown(_ context.Context) error { return nil } -func (c *configProvider[C]) Watch() <-chan C { +func (c *ConfigProvider[C]) Watch() <-chan C { return c.configChan } -func (c *configProvider[C]) SendConfig(ctx context.Context, newConfig C) error { +func (c *ConfigProvider[C]) SendConfig(ctx context.Context, newConfig C) error { c.stoppedMutex.Lock() defer c.stoppedMutex.Unlock() diff --git a/odiglet/pkg/ebpf/go.go b/odiglet/pkg/ebpf/go.go index 66b5d016d..2fa5f0f64 100644 --- a/odiglet/pkg/ebpf/go.go +++ b/odiglet/pkg/ebpf/go.go @@ -19,11 +19,11 @@ import ( type GoOtelEbpfSdk struct { inst *auto.Instrumentation - cp *configProvider[goAutoConfig.InstrumentationConfig] + cp *ConfigProvider[goAutoConfig.InstrumentationConfig] } // compile-time check that configProvider[goAutoConfig.InstrumentationConfig] implements goAutoConfig.Provider -var _ goAutoConfig.Provider = (*configProvider[goAutoConfig.InstrumentationConfig])(nil) +var _ goAutoConfig.Provider = (*ConfigProvider[goAutoConfig.InstrumentationConfig])(nil) type GoInstrumentationFactory struct{} From 12e9300413d268f92d42d9b2e7b2eb19a43ba0f3 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 1 Sep 2024 13:49:24 +0300 Subject: [PATCH 04/10] rename new config API from ApplyInstrumentationConfig to ApplyInstrumentationConfiguration since the first is needed for backword compatibility until we fully move to the new config provider --- odiglet/pkg/ebpf/director.go | 6 ++++-- .../pkg/kube/instrumentation_ebpf/instrumentationconfig.go | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/odiglet/pkg/ebpf/director.go b/odiglet/pkg/ebpf/director.go index d4023c1d7..6ad2d6ef1 100644 --- a/odiglet/pkg/ebpf/director.go +++ b/odiglet/pkg/ebpf/director.go @@ -37,7 +37,9 @@ type Director interface { Instrument(ctx context.Context, pid int, podDetails types.NamespacedName, podWorkload *workload.PodWorkload, appName string, containerName string) error Cleanup(podDetails types.NamespacedName) Shutdown() - ApplyInstrumentationConfig(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error + // TODO: once all our implementation move to this function we can rename it to ApplyInstrumentationConfig, + // currently that name is reserved for the old API until it is removed + ApplyInstrumentationConfiguration(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error } type podDetails struct { @@ -123,7 +125,7 @@ func NewEbpfDirector[T OtelEbpfSdk](ctx context.Context, client client.Client, s return director } -func (d *EbpfDirector[T]) ApplyInstrumentationConfig(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error { +func (d *EbpfDirector[T]) ApplyInstrumentationConfiguration(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error { d.mux.Lock() defer d.mux.Unlock() diff --git a/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go b/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go index c6ddf0511..06c9fbc59 100644 --- a/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go +++ b/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go @@ -19,7 +19,7 @@ type InstrumentationConfigReconciler struct { } func (i *InstrumentationConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - workloadName, workloadKind, err := workload.ExtractWorkloadInfoFromRuntimeObjectName(req.Name) + workloadName, workloadKind, err := workload.ExtractWorkloadInfoFromRuntimeObjectName(req.Name) if err != nil { return ctrl.Result{}, err } @@ -42,11 +42,11 @@ func (i *InstrumentationConfigReconciler) Reconcile(ctx context.Context, req ctr } for _, director := range i.Directors { - err = director.ApplyInstrumentationConfig(ctx, podWorkload, instrumentationConfig) + err = director.ApplyInstrumentationConfiguration(ctx, podWorkload, instrumentationConfig) if err != nil { return ctrl.Result{}, err } } return ctrl.Result{}, nil -} \ No newline at end of file +} From 93bf0d4043ca31bbb75cb61d8391df16680caace Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 1 Sep 2024 15:53:39 +0300 Subject: [PATCH 05/10] add comment --- odiglet/pkg/ebpf/director.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odiglet/pkg/ebpf/director.go b/odiglet/pkg/ebpf/director.go index 6ad2d6ef1..a3b2b7fbd 100644 --- a/odiglet/pkg/ebpf/director.go +++ b/odiglet/pkg/ebpf/director.go @@ -38,7 +38,8 @@ type Director interface { Cleanup(podDetails types.NamespacedName) Shutdown() // TODO: once all our implementation move to this function we can rename it to ApplyInstrumentationConfig, - // currently that name is reserved for the old API until it is removed + // currently that name is reserved for the old API until it is removed. + // Do we want to move this to a separate interface? since this might not be relevant for all SDKs ApplyInstrumentationConfiguration(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error } From 1ed057bd51a3c58d52477ebc2e3b6301216fee47 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Sun, 1 Sep 2024 17:35:10 +0300 Subject: [PATCH 06/10] Add timeout for sending configuration updates for instrumentation --- odiglet/pkg/ebpf/configprovider.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/odiglet/pkg/ebpf/configprovider.go b/odiglet/pkg/ebpf/configprovider.go index 552c89fbb..feb3f529d 100644 --- a/odiglet/pkg/ebpf/configprovider.go +++ b/odiglet/pkg/ebpf/configprovider.go @@ -4,10 +4,14 @@ import ( "context" "errors" "sync" + "time" "github.com/odigos-io/odigos/odiglet/pkg/log" ) +// Max time to wait for a config update to be sent to the instrumentation. +const applyConfigTimeout = 50 * time.Millisecond + type ConfigProvider[C any] struct { configChan chan C initialConfig C @@ -56,11 +60,13 @@ func (c *ConfigProvider[C]) SendConfig(ctx context.Context, newConfig C) error { } // send a config or potentially return an error on timeout - // TODO: we should decide on a timeout value for sending config. + applyCtx, cancel := context.WithTimeout(ctx, applyConfigTimeout) + defer cancel() + select { case c.configChan <- newConfig: return nil - case <-ctx.Done(): + case <-applyCtx.Done(): if ctx.Err() == context.DeadlineExceeded { return errors.New("failed to update config of instrumentation: timeout waiting for config update") } From 228ede942e51bdf9cd894f4dd16297a58309d571 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Mon, 2 Sep 2024 11:04:36 +0300 Subject: [PATCH 07/10] added comments --- odiglet/pkg/ebpf/configprovider.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/odiglet/pkg/ebpf/configprovider.go b/odiglet/pkg/ebpf/configprovider.go index feb3f529d..30f1aa5dc 100644 --- a/odiglet/pkg/ebpf/configprovider.go +++ b/odiglet/pkg/ebpf/configprovider.go @@ -10,6 +10,9 @@ import ( ) // Max time to wait for a config update to be sent to the instrumentation. +// In case the configuration is updating in a faster pace relative to the pace the instrumentation can apply it, +// this timeout will be hit and avoid sending new configuration before the previous one is applied. +// This timeout might be changed in the future. const applyConfigTimeout = 50 * time.Millisecond type ConfigProvider[C any] struct { @@ -50,6 +53,9 @@ func (c *ConfigProvider[C]) Watch() <-chan C { return c.configChan } +// SendConfig sends a new configuration to the instrumentation. +// If the instrumentation was closed or cannot accept the new configuration within a configured timeout, +// an error is returned. func (c *ConfigProvider[C]) SendConfig(ctx context.Context, newConfig C) error { c.stoppedMutex.Lock() defer c.stoppedMutex.Unlock() From e5223538201a231be0297b0becaab68524b2b537 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Mon, 2 Sep 2024 12:13:46 +0300 Subject: [PATCH 08/10] Separate the SDK configuration to a different interface --- odiglet/pkg/ebpf/director.go | 15 +++++++++++++-- odiglet/pkg/ebpf/go.go | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/odiglet/pkg/ebpf/director.go b/odiglet/pkg/ebpf/director.go index a3b2b7fbd..e7f31d245 100644 --- a/odiglet/pkg/ebpf/director.go +++ b/odiglet/pkg/ebpf/director.go @@ -23,6 +23,10 @@ import ( type OtelEbpfSdk interface { Run(ctx context.Context) error Close(ctx context.Context) error +} + +type ConfigurableOtelEbpfSdk interface { + OtelEbpfSdk ApplyConfig(ctx context.Context, config *odigosv1.InstrumentationConfig) error } @@ -39,7 +43,6 @@ type Director interface { Shutdown() // TODO: once all our implementation move to this function we can rename it to ApplyInstrumentationConfig, // currently that name is reserved for the old API until it is removed. - // Do we want to move this to a separate interface? since this might not be relevant for all SDKs ApplyInstrumentationConfiguration(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error } @@ -127,6 +130,13 @@ func NewEbpfDirector[T OtelEbpfSdk](ctx context.Context, client client.Client, s } func (d *EbpfDirector[T]) ApplyInstrumentationConfiguration(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error { + var t T + if _, ok := any(t).(ConfigurableOtelEbpfSdk); !ok { + // TODO increase verbosity level + log.Logger.V(0).Info("eBPF SDK is not configurable, skip applying configuration", "workload", workload) + return nil + } + d.mux.Lock() defer d.mux.Unlock() @@ -136,7 +146,8 @@ func (d *EbpfDirector[T]) ApplyInstrumentationConfiguration(ctx context.Context, var retErr []error for _, inst := range insts { - err := inst.ApplyConfig(ctx, instrumentationConfig) + // The type assertion is safe because we made sure the SDK for this director implements the ConfigurableOtelEbpfSdk interface + err := any(inst).(ConfigurableOtelEbpfSdk).ApplyConfig(ctx, instrumentationConfig) if err != nil { retErr = append(retErr, err) } diff --git a/odiglet/pkg/ebpf/go.go b/odiglet/pkg/ebpf/go.go index 2fa5f0f64..03b89ddd9 100644 --- a/odiglet/pkg/ebpf/go.go +++ b/odiglet/pkg/ebpf/go.go @@ -25,6 +25,9 @@ type GoOtelEbpfSdk struct { // compile-time check that configProvider[goAutoConfig.InstrumentationConfig] implements goAutoConfig.Provider var _ goAutoConfig.Provider = (*ConfigProvider[goAutoConfig.InstrumentationConfig])(nil) +// compile-time check that GoOtelEbpfSdk implements ConfigurableOtelEbpfSdk +var _ ConfigurableOtelEbpfSdk = (*GoOtelEbpfSdk)(nil) + type GoInstrumentationFactory struct{} func NewGoInstrumentationFactory() InstrumentationFactory[*GoOtelEbpfSdk] { From 017f4f9562652dfc2dc38498cde4303138c4d2c3 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Mon, 2 Sep 2024 14:11:12 +0300 Subject: [PATCH 09/10] Apply configuration only for the specified languages in the CRD --- api/odigos/v1alpha1/instrumentatioconfig_types.go | 9 +++++++++ odiglet/pkg/ebpf/director.go | 2 +- .../instrumentation_ebpf/instrumentationconfig.go | 13 +++++++++---- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/api/odigos/v1alpha1/instrumentatioconfig_types.go b/api/odigos/v1alpha1/instrumentatioconfig_types.go index 6a80df432..ff4af4c47 100644 --- a/api/odigos/v1alpha1/instrumentatioconfig_types.go +++ b/api/odigos/v1alpha1/instrumentatioconfig_types.go @@ -167,3 +167,12 @@ type InstrumentationConfigList struct { func init() { SchemeBuilder.Register(&InstrumentationConfig{}, &InstrumentationConfigList{}) } + +// Languages returns the set of languages that this configuration applies to +func (ic *InstrumentationConfig) Languages() map[common.ProgrammingLanguage]struct{} { + langs := make(map[common.ProgrammingLanguage]struct{}) + for _, sdkConfig := range ic.Spec.SdkConfigs { + langs[sdkConfig.Language] = struct{}{} + } + return langs +} diff --git a/odiglet/pkg/ebpf/director.go b/odiglet/pkg/ebpf/director.go index e7f31d245..02d84ca0d 100644 --- a/odiglet/pkg/ebpf/director.go +++ b/odiglet/pkg/ebpf/director.go @@ -133,7 +133,7 @@ func (d *EbpfDirector[T]) ApplyInstrumentationConfiguration(ctx context.Context, var t T if _, ok := any(t).(ConfigurableOtelEbpfSdk); !ok { // TODO increase verbosity level - log.Logger.V(0).Info("eBPF SDK is not configurable, skip applying configuration", "workload", workload) + log.Logger.V(0).Info("eBPF SDK is not configurable, skip applying configuration", "language", d.Language()) return nil } diff --git a/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go b/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go index 06c9fbc59..65169ac52 100644 --- a/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go +++ b/odiglet/pkg/kube/instrumentation_ebpf/instrumentationconfig.go @@ -41,10 +41,15 @@ func (i *InstrumentationConfigReconciler) Reconcile(ctx context.Context, req ctr } } - for _, director := range i.Directors { - err = director.ApplyInstrumentationConfiguration(ctx, podWorkload, instrumentationConfig) - if err != nil { - return ctrl.Result{}, err + langs := instrumentationConfig.Languages() + + for key, director := range i.Directors { + // Apply the configuration only for languages specified in the InstrumentationConfig + if _, ok := langs[key.Language]; ok { + err = director.ApplyInstrumentationConfiguration(ctx, podWorkload, instrumentationConfig) + if err != nil { + return ctrl.Result{}, err + } } } From f82a044f8e5e58339f68e140bd18e503cbc1b6b4 Mon Sep 17 00:00:00 2001 From: Ron Federman Date: Mon, 2 Sep 2024 14:30:18 +0300 Subject: [PATCH 10/10] update log --- odiglet/pkg/ebpf/director.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/odiglet/pkg/ebpf/director.go b/odiglet/pkg/ebpf/director.go index 02d84ca0d..1561ce811 100644 --- a/odiglet/pkg/ebpf/director.go +++ b/odiglet/pkg/ebpf/director.go @@ -132,8 +132,7 @@ func NewEbpfDirector[T OtelEbpfSdk](ctx context.Context, client client.Client, s func (d *EbpfDirector[T]) ApplyInstrumentationConfiguration(ctx context.Context, workload *workload.PodWorkload, instrumentationConfig *odigosv1.InstrumentationConfig) error { var t T if _, ok := any(t).(ConfigurableOtelEbpfSdk); !ok { - // TODO increase verbosity level - log.Logger.V(0).Info("eBPF SDK is not configurable, skip applying configuration", "language", d.Language()) + log.Logger.V(1).Info("eBPF SDK is not configurable, skip applying configuration", "language", d.Language()) return nil }