From 23203e3d86d4f28b4c3d832bdd95d6b3b16579a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 8 Aug 2024 14:16:15 +0100 Subject: [PATCH 01/32] [extensions/observer/cfgardenobserver] Implement cfgardenobserver --- cmd/otelcontribcol/go.mod | 16 +- cmd/otelcontribcol/go.sum | 38 ++- extension/observer/cfgardenobserver/README.md | 4 +- extension/observer/cfgardenobserver/config.go | 95 +++++- .../observer/cfgardenobserver/config_test.go | 144 +++++++- .../observer/cfgardenobserver/extension.go | 314 +++++++++++++++++- .../cfgardenobserver/extension_test.go | 194 ++++++++++- .../observer/cfgardenobserver/factory.go | 16 +- .../generated_component_test.go | 31 -- extension/observer/cfgardenobserver/go.mod | 34 +- extension/observer/cfgardenobserver/go.sum | 72 +++- .../observer/cfgardenobserver/metadata.yaml | 6 + .../cfgardenobserver/testdata/config.yaml | 32 +- 13 files changed, 892 insertions(+), 104 deletions(-) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 2f2094f34e60..8cd17a8b0041 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -256,8 +256,10 @@ require ( cloud.google.com/go/spanner v1.65.0 // indirect cloud.google.com/go/trace v1.10.10 // indirect code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c // indirect + code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb // indirect code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c // indirect code.cloudfoundry.org/go-loggregator v7.4.0+incompatible // indirect + code.cloudfoundry.org/lager/v3 v3.0.3 // indirect code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -419,6 +421,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect + github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect github.com/briandowns/spinner v1.23.0 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect @@ -429,7 +432,9 @@ require ( github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/cilium/ebpf v0.11.0 // indirect github.com/cloudfoundry-incubator/uaago v0.0.0-20190307164349-8136b7bbe76e // indirect + github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 // indirect github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b // indirect + github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect github.com/containerd/cgroups/v3 v3.0.3 // indirect github.com/containerd/console v1.0.3 // indirect github.com/containerd/ttrpc v1.2.4 // indirect @@ -479,12 +484,14 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.20.2 // indirect github.com/go-openapi/jsonreference v0.20.4 // indirect github.com/go-openapi/swag v0.22.9 // indirect github.com/go-resty/resty/v2 v2.13.1 // indirect github.com/go-sql-driver/mysql v1.8.1 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/go-zookeeper/zk v1.0.3 // indirect github.com/gobwas/glob v0.2.3 // indirect @@ -510,6 +517,7 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect @@ -589,6 +597,7 @@ require ( github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect + github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-ieproxy v0.0.11 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -617,6 +626,7 @@ require ( github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/nginxinc/nginx-prometheus-exporter v0.11.0 // indirect github.com/oklog/ulid/v2 v2.1.0 // indirect + github.com/onsi/ginkgo/v2 v2.19.0 // indirect github.com/open-telemetry/opamp-go v0.15.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.106.1 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.106.1 // indirect @@ -672,6 +682,7 @@ require ( github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/outcaste-io/ristretto v0.2.1 // indirect github.com/ovh/go-ovh v1.5.1 // indirect + github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/paulmach/orb v0.11.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect @@ -727,6 +738,7 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect + github.com/tedsuo/rata v1.0.0 // indirect github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.977 // indirect github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.17.3 // indirect @@ -808,14 +820,14 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.26.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/mod v0.18.0 // indirect + golang.org/x/mod v0.19.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/term v0.23.0 // indirect golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/tools v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gonum.org/v1/gonum v0.15.0 // indirect google.golang.org/api v0.189.0 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 74e35ea8c8b5..2453739ecdeb 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -621,10 +621,14 @@ cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c h1:5eeuG0BHx1+DHeT3AP+ISKZ2ht1UjGhm581ljqYpVeQ= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= +code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb h1:DIWMTi2IdpmDCttJS4QSvICxmzW9ZsPSRRoUFRtRQJ0= +code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb/go.mod h1:U64KFt+62i7ZEODWue1CUv61XbKGlpNXG3ICA9SNA4E= code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c h1:N2GMlHc/SJQk7BkaME/kDHaciVTy4NuRmxVJLhnqKK8= code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c/go.mod h1:o7lq/SmHshDVxHdRJ/fMT3VPcoXyE1HcRXbG8QibO3k= code.cloudfoundry.org/go-loggregator v7.4.0+incompatible h1:KqZYloMQWM5Zg/BQKunOIA4OODh7djZbk48qqbowNFI= code.cloudfoundry.org/go-loggregator v7.4.0+incompatible/go.mod h1:KPBTRqj+y738Nhf1+g4JHFaBU8j7dedirR5ETNHvMXU= +code.cloudfoundry.org/lager/v3 v3.0.3 h1:/UTmadZfIaKuT/whEinSxK1mzRfNu1uPfvjFfGqiwzM= +code.cloudfoundry.org/lager/v3 v3.0.3/go.mod h1:Zn5q1SrIuuHjEUE7xerMKt3ztunrJQCZETAo7rV0CH8= code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 h1:mrZQaZmuDIPhSp6b96b+CRKC2uH44ifa5cjDV2epKis= code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78/go.mod h1:tkZo8GtzBjySJ7USvxm4E36lNQw1D3xM6oKHGqdaAJ4= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= @@ -1088,6 +1092,8 @@ github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwN github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= +github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -1132,6 +1138,8 @@ github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudfoundry-incubator/uaago v0.0.0-20190307164349-8136b7bbe76e h1:DFYA2+zpeaTPEOizAJuaee2O7YX3UP5tOMjkeXL8iLo= github.com/cloudfoundry-incubator/uaago v0.0.0-20190307164349-8136b7bbe76e/go.mod h1:8wJCVaTSjT8phXCkbZWAKIB9JU8BEVHbnSbLgkr8WfY= +github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 h1:HK3+nJEPgwlhc5H74aw/V4mVowqWaTKGjHONdVQQ2Vw= +github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9/go.mod h1:eUjFfpsU3lRv388wKlXMmkQfsJ9pveUHZEia7AoBCPY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -1147,6 +1155,8 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0= github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= @@ -1351,6 +1361,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-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -1377,8 +1389,8 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= @@ -1836,6 +1848,8 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 h1:YFh+sjyJTMQSYjKwM4dFKhJPJC/wfo98tPUc17HdoYw= +github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11/go.mod h1:Ah2dBMoxZEqk118as2T4u4fjfXarE0pPnMJaArZQZsI= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -1960,16 +1974,16 @@ github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvw github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= -github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= -github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/open-telemetry/opamp-go v0.15.0 h1:X2TWhEsGQ8GP7Uos3Ic9v/1aFUqoECZXKS7xAF5HqsA= github.com/open-telemetry/opamp-go v0.15.0/go.mod h1:QyPeN56JXlcZt5yG5RMdZ50Ju+zMFs1Ihy/hwHyF8Oo= github.com/open-telemetry/otel-arrow v0.24.0 h1:hNUEbwHW/1gEOUiN+HoI+ITiXe2vSBaPWlE9FRwJwDE= @@ -2000,6 +2014,8 @@ github.com/outcaste-io/ristretto v0.2.1 h1:KCItuNIGJZcursqHr3ghO7fc5ddZLEHspL9UR github.com/outcaste-io/ristretto v0.2.1/go.mod h1:W8HywhmtlopSB1jeMg3JtdIhf+DYkLAr0VN/s4+MHac= github.com/ovh/go-ovh v1.5.1 h1:P8O+7H+NQuFK9P/j4sFW5C0fvSS2DnHYGPwdVCp45wI= github.com/ovh/go-ovh v1.5.1/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -2227,6 +2243,8 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.977 h1:/M1XvgBEBaq7TfgqYQc0MqqEEuhRmyaukBR+giD7y18= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.977/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.32.0 h1:ug1aK08L3gCHdhknlTTwWjPHPS+/alvLJU/DRxTD/ME= @@ -2608,8 +2626,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= -golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2988,8 +3006,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= 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.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= -golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= diff --git a/extension/observer/cfgardenobserver/README.md b/extension/observer/cfgardenobserver/README.md index 3c5aa70f1576..785141c9ef7a 100644 --- a/extension/observer/cfgardenobserver/README.md +++ b/extension/observer/cfgardenobserver/README.md @@ -20,7 +20,7 @@ The `cfgarden_observer` looks at the current host to discover Garden containers. ```yaml extensions: cfgarden_observer: - # url of the Garden socket, defaults to unix:///var/vcap/data/garden/garden.sock + # path of the Garden socket, defaults to /var/vcap/data/garden/garden.sock endpoint: my/path/to/garden.sock # determines how often to look for changes in endpoints. refresh_interval: 30s @@ -41,7 +41,7 @@ receivers: | Name | Type | Default | Docs | |------------------|--------|------------------------------------------|--------------------------------------------------------| | refresh_interval | string | 60s | Determines how often to look for changes in endpoints. | -| endpoint | string | unix:///var/vcap/data/garden/garden.sock | The endpoint to connect to the Garden API. | +| endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | ### Endpoint Variables diff --git a/extension/observer/cfgardenobserver/config.go b/extension/observer/cfgardenobserver/config.go index ea6a62539e98..494ba9c7398e 100644 --- a/extension/observer/cfgardenobserver/config.go +++ b/extension/observer/cfgardenobserver/config.go @@ -4,15 +4,106 @@ package cfgardenobserver // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/cfgardenobserver" import ( + "errors" + "fmt" "time" ) // Config defines configuration for CF Garden observer. type Config struct { - // The URL of the CF Garden api. Default is "unix:///var/vcap/data/garden/garden.sock" - Endpoint string `mapstructure:"endpoint"` + // CloudFoundry API Configuration + CloudFoundry CfConfig `mapstructure:"cloud_foundry"` + + // Garden API Configuration + Garden GardenConfig `mapstructure:"garden"` // RefreshInterval determines the frequency at which the observer // needs to poll for collecting information about new processes. RefreshInterval time.Duration `mapstructure:"refresh_interval"` + + // The time to wait before resyncing app information on cached containers + // using the CloudFoundry API. Example: cache_sync_interval: "20m" + // Default: "5m" + CacheSyncInterval time.Duration `mapstructure:"cache_sync_interval"` +} + +// Validate overrides the embedded noop validation so that load config can trigger +// our own validation logic. +func (config *Config) Validate() error { + c := config.CloudFoundry + if c.Endpoint == "" { + return errors.New("config.Endpoint must be specified") + } + if c.AuthType == "" { + return errors.New("config.AuthType must be specified") + } + + switch c.AuthType { + case AuthTypeUserPass: + if c.Username == "" { + return fieldError(AuthTypeUserPass, "username") + } + if c.Password == "" { + return fieldError(AuthTypeUserPass, "password") + } + case AuthTypeClientCredentials: + if c.ClientID == "" { + return fieldError(AuthTypeClientCredentials, "client_id") + } + if c.ClientSecret == "" { + return fieldError(AuthTypeClientCredentials, "client_secret") + } + case AuthTypeToken: + if c.AccessToken == "" { + return fieldError(AuthTypeToken, "access_token") + } + if c.RefreshToken == "" { + return fieldError(AuthTypeToken, "refresh_token") + } + default: + return fmt.Errorf("unknown auth_type: %s", c.AuthType) + } + + return nil +} + +func fieldError(authType AuthType, param string) error { + return fmt.Errorf("%s is required when using auth_type: %s", param, authType) +} + +type GardenConfig struct { + // The URL of the CF Garden api. Default is "/var/vcap/data/garden/garden.sock" + Endpoint string `mapstructure:"endpoint"` } + +type CfConfig struct { + // The URL of the CloudFoundry API + Endpoint string `mapstructure:"endpoint"` + + // Authentication method, there are 3 options + AuthType AuthType `mapstructure:"auth_type"` + + // Used for user_pass authentication method + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` + + // Used for token authentication method + AccessToken string `mapstructure:"access_token"` + RefreshToken string `mapstructure:"refresh_token"` + + // Used for client_credentials authentication method + ClientID string `mapstructure:"client_id"` + ClientSecret string `mapstructure:"client_secret"` +} + +// AuthType describes the type of authentication to use for the CloudFoundry API +type AuthType string + +const ( + // AuthTypeClientCredentials uses a client ID and client secret to authenticate + AuthTypeClientCredentials AuthType = "client_credentials" + // AuthTypeUserPass uses username and password to authenticate + AuthTypeUserPass AuthType = "user_pass" + // AuthTypeToken uses access token and refresh token to authenticate + AuthTypeToken AuthType = "token" +) diff --git a/extension/observer/cfgardenobserver/config_test.go b/extension/observer/cfgardenobserver/config_test.go index 4d11faf25408..161d88460540 100644 --- a/extension/observer/cfgardenobserver/config_test.go +++ b/extension/observer/cfgardenobserver/config_test.go @@ -26,15 +26,81 @@ func TestLoadConfig(t *testing.T) { { id: component.NewID(metadata.Type), expected: &Config{ - Endpoint: "unix:///var/vcap/data/garden/garden.sock", - RefreshInterval: 1 * time.Minute, + RefreshInterval: 1 * time.Minute, + CacheSyncInterval: 5 * time.Minute, + Garden: GardenConfig{ + Endpoint: "/var/vcap/data/garden/garden.sock", + }, + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: "client_credentials", + ClientID: "myclientid", + ClientSecret: "myclientsecret", + }, }, }, { id: component.NewIDWithName(metadata.Type, "all_settings"), expected: &Config{ - Endpoint: "unix:///var/vcap/data/garden/custom.sock", - RefreshInterval: 20 * time.Second, + RefreshInterval: 20 * time.Second, + CacheSyncInterval: 5 * time.Second, + Garden: GardenConfig{ + Endpoint: "/var/vcap/data/garden/custom.sock", + }, + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: "user_pass", + Username: "myuser", + Password: "mypass", + }, + }, + }, + { + id: component.NewIDWithName(metadata.Type, "user_pass"), + expected: &Config{ + Garden: GardenConfig{ + Endpoint: "/var/vcap/data/garden/garden.sock", + }, + RefreshInterval: 1 * time.Minute, + CacheSyncInterval: 5 * time.Minute, + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: "user_pass", + Username: "myuser", + Password: "mypass", + }, + }, + }, + { + id: component.NewIDWithName(metadata.Type, "client_credentials"), + expected: &Config{ + Garden: GardenConfig{ + Endpoint: "/var/vcap/data/garden/garden.sock", + }, + RefreshInterval: 1 * time.Minute, + CacheSyncInterval: 5 * time.Minute, + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: "client_credentials", + ClientID: "myclientid", + ClientSecret: "myclientsecret", + }, + }, + }, + { + id: component.NewIDWithName(metadata.Type, "token"), + expected: &Config{ + Garden: GardenConfig{ + Endpoint: "/var/vcap/data/garden/garden.sock", + }, + RefreshInterval: 1 * time.Minute, + CacheSyncInterval: 5 * time.Minute, + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: "token", + AccessToken: "myaccesstoken", + RefreshToken: "myrefreshtoken", + }, }, }, } @@ -53,3 +119,73 @@ func TestLoadConfig(t *testing.T) { }) } } + +func TestConfig_Validate(t *testing.T) { + cases := []struct { + reason string + cfg Config + msg string + }{ + { + reason: "missing endpoint", + cfg: Config{}, + msg: "config.Endpoint must be specified", + }, + { + reason: "missing auth_type", + cfg: Config{ + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + }, + }, + msg: "config.AuthType must be specified", + }, + { + reason: "unknown auth_type", + cfg: Config{ + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: "unknown", + }, + }, + msg: "unknown auth_type: unknown", + }, + { + reason: "missing username", + cfg: Config{ + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: AuthTypeUserPass, + }, + }, + msg: fieldError(AuthTypeUserPass, "username").Error(), + }, + { + reason: "missing clientID", + cfg: Config{ + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: AuthTypeClientCredentials, + }, + }, + msg: fieldError(AuthTypeClientCredentials, "client_id").Error(), + }, + { + reason: "missing AccessToken", + cfg: Config{ + CloudFoundry: CfConfig{ + Endpoint: "https://api.cf.mydomain.com", + AuthType: AuthTypeToken, + }, + }, + msg: fieldError(AuthTypeToken, "access_token").Error(), + }, + } + + for _, tCase := range cases { + t.Run(tCase.reason, func(t *testing.T) { + err := tCase.cfg.Validate() + require.EqualError(t, err, tCase.msg) + }) + } +} diff --git a/extension/observer/cfgardenobserver/extension.go b/extension/observer/cfgardenobserver/extension.go index 67f2c616cce8..e0ae64cbf559 100644 --- a/extension/observer/cfgardenobserver/extension.go +++ b/extension/observer/cfgardenobserver/extension.go @@ -4,33 +4,331 @@ package cfgardenobserver // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/cfgardenobserver" import ( + "context" + "encoding/json" + "errors" + "fmt" + "strconv" + "strings" + "sync" "time" + "code.cloudfoundry.org/garden" + gardenClient "code.cloudfoundry.org/garden/client" + gardenConnection "code.cloudfoundry.org/garden/client/connection" + "github.com/cloudfoundry/go-cfclient/v3/client" + "github.com/cloudfoundry/go-cfclient/v3/config" + "github.com/cloudfoundry/go-cfclient/v3/resource" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/extension" + "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer" ) type cfGardenObserver struct { *observer.EndpointsWatcher + cancel context.CancelFunc + config *Config + ctx context.Context + logger *zap.Logger + once *sync.Once - component.StartFunc - component.ShutdownFunc + garden garden.Client + cf *client.Client + + containerMu sync.RWMutex + containers map[string]garden.ContainerInfo + + appMu sync.RWMutex + apps map[string]*resource.App } var _ extension.Extension = (*cfGardenObserver)(nil) -func newObserver(params extension.Settings, _ *Config) (extension.Extension, error) { - g := &cfGardenObserver{} - g.EndpointsWatcher = observer.NewEndpointsWatcher(g, time.Second, params.Logger) - +func newObserver(config *Config, logger *zap.Logger) (extension.Extension, error) { + g := &cfGardenObserver{ + config: config, + logger: logger, + once: &sync.Once{}, + containers: make(map[string]garden.ContainerInfo), + apps: make(map[string]*resource.App), + cancel: func() { + // Safe value provided on initialisation + }, + } + g.EndpointsWatcher = observer.NewEndpointsWatcher(g, config.RefreshInterval, logger) return g, nil } +func (g *cfGardenObserver) SyncApps() error { + g.containerMu.RLock() + containers := g.containers + g.containerMu.RUnlock() + + g.appMu.Lock() + defer g.appMu.Unlock() + g.apps = make(map[string]*resource.App) + for _, info := range containers { + appID, err := infoToAppID(info) + if err != nil { + return err + } + + if _, ok := g.apps[appID]; ok { + continue + } + + app, err := g.cf.Applications.Get(g.ctx, appID) + if err != nil { + return fmt.Errorf("error fetching application: %w", err) + } + g.apps[appID] = app + } + + return nil +} + +func (g *cfGardenObserver) App(info garden.ContainerInfo) (*resource.App, error) { + appID, err := infoToAppID(info) + if err != nil { + return nil, err + } + + g.appMu.Lock() + defer g.appMu.Unlock() + app, ok := g.apps[appID] + if ok { + return app, nil + } + + app, err = g.cf.Applications.Get(g.ctx, appID) + if err != nil { + return nil, err + } + g.apps[appID] = app + + return app, nil +} + +func (g *cfGardenObserver) Start(_ context.Context, _ component.Host) error { + gCtx, cancel := context.WithCancel(context.Background()) + g.cancel = cancel + g.ctx = gCtx + + g.garden = gardenClient.New(gardenConnection.New("unix", g.config.Garden.Endpoint)) + + var err error + g.cf, err = newCfClient(g.config.CloudFoundry) + if err != nil { + return err + } + + g.once.Do( + func() { + go func() { + cacheRefreshTicker := time.NewTicker(g.config.CacheSyncInterval) + defer cacheRefreshTicker.Stop() + + for { + select { + case <-g.ctx.Done(): + return + case <-cacheRefreshTicker.C: + err = g.SyncApps() + if err != nil { + g.logger.Error("could not sync app cache", zap.Error(err)) + } + } + } + }() + }, + ) + + return nil +} + +func (g *cfGardenObserver) Shutdown(_ context.Context) error { + g.cancel() + return nil +} + func (g *cfGardenObserver) ListEndpoints() []observer.Endpoint { - // TODO: Implement the logic to list the endpoints. - endpoints := make([]observer.Endpoint, 0) + var endpoints []observer.Endpoint + + containers, err := g.garden.Containers(garden.Properties{}) + if err != nil { + g.logger.Error("could not list containers", zap.Error(err)) + return endpoints + } + + infos := make(map[string]garden.ContainerInfo) + for _, c := range containers { + info, err := c.Info() + if err != nil { + g.logger.Error("error getting container info", zap.String("handle", c.Handle()), zap.Error(err)) + continue + } + + if info.State != "active" { + continue + } + + endpoints = append(endpoints, g.containerEndpoints(c.Handle(), info)...) + infos[c.Handle()] = info + } + go g.updateContainerCache(infos) return endpoints } + +// containerEndpoints generates a list of observer.Endpoint for a container, +// this is because a container might have more than one exposed ports +func (g *cfGardenObserver) containerEndpoints(handle string, info garden.ContainerInfo) []observer.Endpoint { + portsProp, ok := info.Properties["network.ports"] + if !ok { + g.logger.Error("could not discover container ports") + return nil + } + ports := strings.Split(portsProp, ",") + + app, err := g.App(info) + if err != nil { + g.logger.Error("error fetching Application", zap.Error(err)) + fmt.Println("ERROR") + return nil + } + + endpoints := []observer.Endpoint{} + for _, port := range ports { + port, err := strconv.ParseUint(port, 10, 16) + if err != nil { + g.logger.Error("container port is not valid", zap.Error(err)) + continue + } + + details := &observer.Container{ + Name: handle, + ContainerID: handle, + Host: info.ContainerIP, + Port: uint16(port), + Transport: observer.ProtocolTCP, + Labels: g.containerLabels(info, app), + } + + endpoint := observer.Endpoint{ + ID: observer.EndpointID(fmt.Sprintf("%s:%d", details.ContainerID, details.Port)), + Target: fmt.Sprintf("%s:%d", details.Host, details.Port), + Details: details, + } + endpoints = append(endpoints, endpoint) + } + return endpoints +} + +func (g *cfGardenObserver) containerLabels(info garden.ContainerInfo, app *resource.App) map[string]string { + labels := make(map[string]string) + tags, err := parseTags(info) + if err != nil { + fmt.Println(err) + g.logger.Warn("not able to parse container tags into labels", zap.Error(err)) + return nil + } + for k, v := range tags { + labels[k] = v + } + + for k, v := range app.Metadata.Labels { + labels[k] = *v + } + + return labels +} + +// The info.Properties contains a key called "log_config", which +// has contents that look like the following JSON endoded string: +// +// { +// "guid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", +// "index": 0, +// "source_name": "CELL", +// "tags": { +// "app_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", +// "app_name": "example-app", +// "instance_id": "0", +// "organization_id": "11111111-2222-3333-4444-555555555555", +// "organization_name": "example-org", +// "process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", +// "process_instance_id": "abcdef12-3456-7890-abcd-ef1234567890", +// "process_type": "web", +// "source_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", +// "space_id": "99999999-8888-7777-6666-555555555555", +// "space_name": "example-space" +// } +// } +// +// We parse only the tags into a map, to be used as labels +func parseTags(info garden.ContainerInfo) (map[string]string, error) { + logConfig, ok := info.Properties["log_config"] + if !ok { + return nil, errors.New("container properties do not have log_config field") + } + + var data map[string]any + err := json.Unmarshal([]byte(logConfig), &data) + if err != nil { + return nil, fmt.Errorf("error unmarshaling logConfig: %w", err) + } + + tags, ok := data["tags"].(map[string]any) + if !ok { + return nil, fmt.Errorf("expected tags field to be a map. got=%T", data["tags"]) + } + + result := make(map[string]string) + for key, value := range tags { + if strValue, ok := value.(string); ok { + result[key] = strValue + } + } + + return result, nil +} + +func newCfClient(cfConfig CfConfig) (*client.Client, error) { + var cfg *config.Config + var err error + + switch cfConfig.AuthType { + case AuthTypeUserPass: + cfg, err = config.New(cfConfig.Endpoint, config.UserPassword(cfConfig.Username, cfConfig.Password)) + case AuthTypeClientCredentials: + cfg, err = config.New(cfConfig.Endpoint, config.ClientCredentials(cfConfig.ClientID, cfConfig.ClientSecret)) + case AuthTypeToken: + cfg, err = config.New(cfConfig.Endpoint, config.Token(cfConfig.AccessToken, cfConfig.RefreshToken)) + } + + if err != nil { + return nil, fmt.Errorf("error creating connection to CloudFoundry API: %w", err) + } + + c, err := client.New(cfg) + if err != nil { + return nil, err + } + return c, nil +} + +func (g *cfGardenObserver) updateContainerCache(infos map[string]garden.ContainerInfo) { + g.containerMu.Lock() + defer g.containerMu.Unlock() + g.containers = infos +} + +func infoToAppID(info garden.ContainerInfo) (string, error) { + id, ok := info.Properties["network.app_id"] + if !ok { + return "", errors.New("could not find app_id") + } + return id, nil +} diff --git a/extension/observer/cfgardenobserver/extension_test.go b/extension/observer/cfgardenobserver/extension_test.go index db7e9d753384..efba02e27eed 100644 --- a/extension/observer/cfgardenobserver/extension_test.go +++ b/extension/observer/cfgardenobserver/extension_test.go @@ -4,32 +4,196 @@ package cfgardenobserver import ( - "context" + "fmt" "testing" + "code.cloudfoundry.org/garden" + "github.com/cloudfoundry/go-cfclient/v3/resource" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/extension/extensiontest" + "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer" ) -func TestStartAndStopObserver(t *testing.T) { +func strPtr(s string) *string { return &s } + +func TestContainerEndpoints(t *testing.T) { + handle := "14d91d46-6ebd-43a1-8e20-316d8e6a92a4" + ip := "1.2.3.4" + appID := "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + logConfig := fmt.Sprintf(` +{ + "guid": "%s", + "index": 0, + "source_name": "CELL", + "tags": { + "app_id": "%s", + "app_name": "myapp" + } +} + `, handle, appID) + + tests := []struct { + name string + input garden.ContainerInfo + expected []observer.Endpoint + }{ + { + name: "single port", + input: garden.ContainerInfo{ + ContainerIP: ip, + Properties: map[string]string{ + "log_config": logConfig, + "network.ports": "8080", + "network.app_id": appID, + }, + }, + expected: []observer.Endpoint{ + { + ID: observer.EndpointID(fmt.Sprintf("%s:%d", handle, 8080)), + Target: fmt.Sprintf("%s:%d", ip, 8080), + Details: &observer.Container{ + Name: handle, + ContainerID: handle, + Host: ip, + Port: uint16(8080), + Transport: observer.ProtocolTCP, + Labels: map[string]string{ + "app_id": appID, + "app_name": "myapp", + "app_label": "app_value", + "app_label2": "app_value2", + }, + }, + }, + }, + }, + { + name: "multiple ports", + input: garden.ContainerInfo{ + ContainerIP: ip, + Properties: map[string]string{ + "log_config": logConfig, + "network.ports": "8080,9999", + "network.app_id": appID, + }, + }, + expected: []observer.Endpoint{ + { + ID: observer.EndpointID(fmt.Sprintf("%s:%d", handle, 8080)), + Target: fmt.Sprintf("%s:%d", ip, 8080), + Details: &observer.Container{ + Name: handle, + ContainerID: handle, + Host: ip, + Port: uint16(8080), + Transport: observer.ProtocolTCP, + Labels: map[string]string{ + "app_id": appID, + "app_name": "myapp", + "app_label": "app_value", + "app_label2": "app_value2", + }, + }, + }, + { + ID: observer.EndpointID(fmt.Sprintf("%s:%d", handle, 9999)), + Target: fmt.Sprintf("%s:%d", ip, 9999), + Details: &observer.Container{ + Name: handle, + ContainerID: handle, + Host: ip, + Port: uint16(9999), + Transport: observer.ProtocolTCP, + Labels: map[string]string{ + "app_id": appID, + "app_name": "myapp", + "app_label": "app_value", + "app_label2": "app_value2", + }, + }, + }, + }, + }, + } + + for _, tt := range tests { + factory := NewFactory() + ext, err := newObserver(factory.CreateDefaultConfig().(*Config), zap.NewNop()) + require.NoError(t, err) + require.NotNil(t, ext) + + obs, ok := ext.(*cfGardenObserver) + require.True(t, ok) + obs.apps[appID] = &resource.App{ + Metadata: &resource.Metadata{ + Labels: map[string]*string{ + "app_label": strPtr("app_value"), + "app_label2": strPtr("app_value2"), + }, + }, + } + + require.Equal(t, tt.expected, obs.containerEndpoints(handle, tt.input)) + } +} + +func TestContainerLabels(t *testing.T) { + info := garden.ContainerInfo{ + Properties: map[string]string{ + "log_config": ` +{ + "guid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "index": 0, + "source_name": "CELL", + "tags": { + "app_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "app_name": "example-app", + "instance_id": "0", + "organization_id": "11111111-2222-3333-4444-555555555555", + "organization_name": "example-org", + "process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "process_instance_id": "abcdef12-3456-7890-abcd-ef1234567890", + "process_type": "web", + "source_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "space_id": "99999999-8888-7777-6666-555555555555", + "space_name": "example-space" + } +} + `, + }, + } + app := &resource.App{ + Metadata: &resource.Metadata{ + Labels: map[string]*string{ + "key": strPtr("value"), + "key2": strPtr("value2"), + }, + }, + } + expected := map[string]string{ + "app_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "app_name": "example-app", + "instance_id": "0", + "organization_id": "11111111-2222-3333-4444-555555555555", + "organization_name": "example-org", + "process_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "process_instance_id": "abcdef12-3456-7890-abcd-ef1234567890", + "process_type": "web", + "source_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", + "space_id": "99999999-8888-7777-6666-555555555555", + "space_name": "example-space", + "key": "value", + "key2": "value2", + } + factory := NewFactory() - params := extensiontest.NewNopSettings() - ext, err := newObserver(params, factory.CreateDefaultConfig().(*Config)) + ext, err := newObserver(factory.CreateDefaultConfig().(*Config), zap.NewNop()) require.NoError(t, err) require.NotNil(t, ext) - obvs, ok := ext.(*cfGardenObserver) + obs, ok := ext.(*cfGardenObserver) require.True(t, ok) - ctx := context.Background() - require.NoError(t, obvs.Start(ctx, componenttest.NewNopHost())) - - expected := obvs.ListEndpoints() - want := []observer.Endpoint{} - require.Equal(t, want, expected) - - require.NoError(t, obvs.Shutdown(ctx)) + require.Equal(t, expected, obs.containerLabels(info, app)) } diff --git a/extension/observer/cfgardenobserver/factory.go b/extension/observer/cfgardenobserver/factory.go index f4a40e15fbe2..2881e1029f00 100644 --- a/extension/observer/cfgardenobserver/factory.go +++ b/extension/observer/cfgardenobserver/factory.go @@ -15,10 +15,11 @@ import ( const ( defaultCollectionInterval = 1 * time.Minute - defaultEndpoint = "unix:///var/vcap/data/garden/garden.sock" + defaultCacheSyncInterval = 5 * time.Minute + defaultEndpoint = "/var/vcap/data/garden/garden.sock" ) -// NewFactory creates a factory for HostObserver extension. +// NewFactory creates a factory for CfGardenObserver extension. func NewFactory() extension.Factory { return extension.NewFactory( metadata.Type, @@ -30,15 +31,18 @@ func NewFactory() extension.Factory { func createDefaultConfig() component.Config { return &Config{ - RefreshInterval: defaultCollectionInterval, - Endpoint: defaultEndpoint, + RefreshInterval: defaultCollectionInterval, + CacheSyncInterval: defaultCacheSyncInterval, + Garden: GardenConfig{ + Endpoint: defaultEndpoint, + }, } } func createExtension( _ context.Context, - params extension.Settings, + settings extension.Settings, cfg component.Config, ) (extension.Extension, error) { - return newObserver(params, cfg.(*Config)) + return newObserver(cfg.(*Config), settings.Logger) } diff --git a/extension/observer/cfgardenobserver/generated_component_test.go b/extension/observer/cfgardenobserver/generated_component_test.go index 2aecde514c40..30f52c8571a5 100644 --- a/extension/observer/cfgardenobserver/generated_component_test.go +++ b/extension/observer/cfgardenobserver/generated_component_test.go @@ -3,13 +3,10 @@ package cfgardenobserver import ( - "context" "testing" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/confmap/confmaptest" - "go.opentelemetry.io/collector/extension/extensiontest" ) func TestComponentFactoryType(t *testing.T) { @@ -19,31 +16,3 @@ func TestComponentFactoryType(t *testing.T) { func TestComponentConfigStruct(t *testing.T) { require.NoError(t, componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig())) } - -func TestComponentLifecycle(t *testing.T) { - factory := NewFactory() - - cm, err := confmaptest.LoadConf("metadata.yaml") - require.NoError(t, err) - cfg := factory.CreateDefaultConfig() - sub, err := cm.Sub("tests::config") - require.NoError(t, err) - require.NoError(t, sub.Unmarshal(&cfg)) - t.Run("shutdown", func(t *testing.T) { - e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) - require.NoError(t, err) - err = e.Shutdown(context.Background()) - require.NoError(t, err) - }) - t.Run("lifecycle", func(t *testing.T) { - firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) - require.NoError(t, err) - require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, firstExt.Shutdown(context.Background())) - - secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopSettings(), cfg) - require.NoError(t, err) - require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, secondExt.Shutdown(context.Background())) - }) -} diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index c99aa4b5fd1d..c2d84e59924a 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -3,38 +3,53 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/obser go 1.21.0 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.106.1 + code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb + github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.106.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.106.1 - go.opentelemetry.io/collector/confmap v0.106.1 - go.opentelemetry.io/collector/extension v0.106.1 + go.opentelemetry.io/collector/component v0.106.0 + go.opentelemetry.io/collector/confmap v0.106.0 + go.opentelemetry.io/collector/extension v0.106.0 go.uber.org/goleak v1.3.0 + go.uber.org/zap v1.27.0 ) require ( + code.cloudfoundry.org/lager/v3 v3.0.3 // indirect github.com/beorn7/perks v1.0.1 // indirect + github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-version v1.7.0 // 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.1 // indirect + github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/nxadm/tail v1.4.11 // indirect + github.com/onsi/ginkgo/v2 v2.19.0 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.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 - go.opentelemetry.io/collector/config/configtelemetry v0.106.1 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.106.0 // indirect go.opentelemetry.io/collector/featuregate v1.12.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.106.1 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.106.0 // indirect go.opentelemetry.io/collector/pdata v1.12.0 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect @@ -43,10 +58,11 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect go.opentelemetry.io/otel/trace v1.28.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.23.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index 933e03b109a6..ce8f0a1fc5c0 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -1,20 +1,39 @@ +code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb h1:DIWMTi2IdpmDCttJS4QSvICxmzW9ZsPSRRoUFRtRQJ0= +code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb/go.mod h1:U64KFt+62i7ZEODWue1CUv61XbKGlpNXG3ICA9SNA4E= +code.cloudfoundry.org/lager/v3 v3.0.3 h1:/UTmadZfIaKuT/whEinSxK1mzRfNu1uPfvjFfGqiwzM= +code.cloudfoundry.org/lager/v3 v3.0.3/go.mod h1:Zn5q1SrIuuHjEUE7xerMKt3ztunrJQCZETAo7rV0CH8= 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/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= +github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 h1:HK3+nJEPgwlhc5H74aw/V4mVowqWaTKGjHONdVQQ2Vw= +github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9/go.mod h1:eUjFfpsU3lRv388wKlXMmkQfsJ9pveUHZEia7AoBCPY= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +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/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= 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-martini/martini v0.0.0-20170121215854-22fa46961aab h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= github.com/go-viper/mapstructure/v2 v2.0.0/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/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/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= @@ -31,12 +50,26 @@ 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/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 h1:YFh+sjyJTMQSYjKwM4dFKhJPJC/wfo98tPUc17HdoYw= +github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11/go.mod h1:Ah2dBMoxZEqk118as2T4u4fjfXarE0pPnMJaArZQZsI= 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/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/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= +github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= 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/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= @@ -49,24 +82,28 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= 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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.106.1 h1:6Xp4tKqnd/JkJDG/C4p1hto+Y5zvk5FwqZIdMCPzZlA= -go.opentelemetry.io/collector/component v0.106.1/go.mod h1:KiVE/5ZayuLlDJTe7mHqHRCn/5LrmF99C7/mKe54mWA= -go.opentelemetry.io/collector/config/configtelemetry v0.106.1 h1:A8nwYnI6brfur5KPFC8GtVX/49pByvVoKSgO4qPXBqg= -go.opentelemetry.io/collector/config/configtelemetry v0.106.1/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/confmap v0.106.1 h1:R7HQIPDRPOEwauBeJUlkT8Elc5f0KQr/s/kQfZi05t0= -go.opentelemetry.io/collector/confmap v0.106.1/go.mod h1:iWdWgvxRYSHdAt5ySgPJq/i6fQMKGNnP5Pt7jOfTXno= -go.opentelemetry.io/collector/extension v0.106.1 h1:HNV2eOxaSDy5gL5KYoPoTLlp6fdeWmuw4paxhi10VUo= -go.opentelemetry.io/collector/extension v0.106.1/go.mod h1:DCOGxD+WnIJiDveKWlvH5WwB9AgqlRUlnKgwhNCLrtQ= +go.opentelemetry.io/collector/component v0.106.0 h1:2CJbqV8taL7nBKuHxeULvJySa4+gfsgvAENb+lS/vYM= +go.opentelemetry.io/collector/component v0.106.0/go.mod h1:lAcHA7k8WVzJRxlkOtOWqgf9+2uRJLfLUiYJapRbr5w= +go.opentelemetry.io/collector/config/configtelemetry v0.106.0 h1:UEUO2pkLpPoAi92MoLhVu3q7mVZONFAxAGorJCtF+aE= +go.opentelemetry.io/collector/config/configtelemetry v0.106.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/confmap v0.106.0 h1:oZ/QfGjtOTz6sEbNkp8CxSwDFRHXej8u6MywvhTzjqI= +go.opentelemetry.io/collector/confmap v0.106.0/go.mod h1:X+nvuiQs3zdeXKkrEX1Ta3R49eLZ2/NYZLs3KUp1pik= +go.opentelemetry.io/collector/extension v0.106.0 h1:E/UY7fmFOMClb6qMYsOxHz3rY4LNXtCcKItkOq/REP4= +go.opentelemetry.io/collector/extension v0.106.0/go.mod h1:e1vJ444rIPTMn/xRwapkV6oSpr07SPi6t2xrDaGrusY= go.opentelemetry.io/collector/featuregate v1.12.0 h1:l5WbV2vMQd2bL8ubfGrbKNtZaeJRckE12CTHvRe47Tw= go.opentelemetry.io/collector/featuregate v1.12.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= -go.opentelemetry.io/collector/internal/globalgates v0.106.1 h1:0NQHTcykmYNDsNKObJ2XocGCv3WUAQZppfP3o6hZUIA= -go.opentelemetry.io/collector/internal/globalgates v0.106.1/go.mod h1:Z5US6O2xkZAtxVSSBnHAPFZwPhFoxlyKLUvS67Vx4gc= +go.opentelemetry.io/collector/internal/globalgates v0.106.0 h1:Rg6ZM2DROO4nx93nEFoNInisUGLHBq4IAU0oK1/T7jw= +go.opentelemetry.io/collector/internal/globalgates v0.106.0/go.mod h1:Z5US6O2xkZAtxVSSBnHAPFZwPhFoxlyKLUvS67Vx4gc= go.opentelemetry.io/collector/pdata v1.12.0 h1:Xx5VK1p4VO0md8MWm2icwC1MnJ7f8EimKItMWw46BmA= go.opentelemetry.io/collector/pdata v1.12.0/go.mod h1:MYeB0MmMAxeM0hstCFrCqWLzdyeYySim2dG6pDT6nYI= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= @@ -96,16 +133,19 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 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.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +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/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/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/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/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.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= @@ -114,6 +154,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= 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= @@ -127,5 +169,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn 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/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 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/extension/observer/cfgardenobserver/metadata.yaml b/extension/observer/cfgardenobserver/metadata.yaml index 1db3578ed443..c3360d451596 100644 --- a/extension/observer/cfgardenobserver/metadata.yaml +++ b/extension/observer/cfgardenobserver/metadata.yaml @@ -1,4 +1,5 @@ type: cfgarden_observer +scope_name: otelcol/cfgardenobserver status: class: extension @@ -6,3 +7,8 @@ status: development: [extension] codeowners: active: [crobert-1, cemdk, tomasmota, m1rp, jriguera] + +# We don't want to make actual connections to CloudFoundry api in our tests +tests: + skip_lifecycle: true + skip_shutdown: true diff --git a/extension/observer/cfgardenobserver/testdata/config.yaml b/extension/observer/cfgardenobserver/testdata/config.yaml index a1a9b8375759..81a3626f4a00 100644 --- a/extension/observer/cfgardenobserver/testdata/config.yaml +++ b/extension/observer/cfgardenobserver/testdata/config.yaml @@ -1,4 +1,34 @@ cfgarden_observer: + cloud_foundry: + endpoint: https://api.cf.mydomain.com + auth_type: client_credentials + client_id: myclientid + client_secret: myclientsecret cfgarden_observer/all_settings: + cache_sync_interval: 5s refresh_interval: 20s - endpoint: unix:///var/vcap/data/garden/custom.sock + garden: + endpoint: /var/vcap/data/garden/custom.sock + cloud_foundry: + endpoint: https://api.cf.mydomain.com + auth_type: user_pass + username: myuser + password: mypass +cfgarden_observer/user_pass: + cloud_foundry: + endpoint: https://api.cf.mydomain.com + auth_type: user_pass + username: myuser + password: mypass +cfgarden_observer/client_credentials: + cloud_foundry: + endpoint: https://api.cf.mydomain.com + auth_type: client_credentials + client_id: myclientid + client_secret: myclientsecret +cfgarden_observer/token: + cloud_foundry: + endpoint: https://api.cf.mydomain.com + auth_type: token + access_token: myaccesstoken + refresh_token: myrefreshtoken From 7c71c8821845b61be64519822f9761311e78db36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 8 Aug 2024 14:45:10 +0100 Subject: [PATCH 02/32] [extensions/observer/cfgardenobserver] Updated docs --- extension/observer/cfgardenobserver/README.md | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/extension/observer/cfgardenobserver/README.md b/extension/observer/cfgardenobserver/README.md index 785141c9ef7a..3c43fed6b5c5 100644 --- a/extension/observer/cfgardenobserver/README.md +++ b/extension/observer/cfgardenobserver/README.md @@ -20,17 +20,29 @@ The `cfgarden_observer` looks at the current host to discover Garden containers. ```yaml extensions: cfgarden_observer: - # path of the Garden socket, defaults to /var/vcap/data/garden/garden.sock - endpoint: my/path/to/garden.sock # determines how often to look for changes in endpoints. refresh_interval: 30s + # determines how often app metadata cache is refreshed + cache_sync_interval: 10m + garden: + # path of the Garden socket, defaults to /var/vcap/data/garden/garden.sock + endpoint: my/path/to/garden.sock + cloud_foundry: + # CloudFoundry API endpoint, required + endpoint: https://api.cf.mydomain.com + # Authentication type, required + auth_type: client_credentials + # Client ID + client_id: myclientid + # Client Secret + client_secret: myclientsecret receivers: receiver_creator: watch_observers: [cfgarden_observer] receivers: prometheus_simple: - rule: type == "container" && name == "myapp" + rule: type == "container" && labels["prometheus.io/scrape"] == "true" config: metrics_path: /metrics endpoint: '`endpoint`' @@ -38,16 +50,30 @@ receivers: ### Configuration -| Name | Type | Default | Docs | -|------------------|--------|------------------------------------------|--------------------------------------------------------| -| refresh_interval | string | 60s | Determines how often to look for changes in endpoints. | -| endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | +| Name | Type | Default | Description | +| --------------------------- | ------ | --------------------------------- | ----------------------------------------------------------------- | +| refresh_interval | string | 60s | Determines how often to look for changes in endpoints. | +| cache_sync_interval | string | 5m | determines how often app metadata cache is refreshed | +| garden.endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | +| cloud_foundry.endpoint | string | none. parameter is required | CloudFoundry API endpoint | +| cloud_foundry.auth_type | string | none. parameter is required | Authentication type, one of: user_pass, client_credentials, token | +| cloud_foundry.username | string | none | Username (auth_type: user_pass) | +| cloud_foundry.password | string | none | Password (auth_type: user_pass) | +| cloud_foundry.client_id | string | none | Client ID (auth_type: client_credentials) | +| cloud_foundry.client_secret | string | none | Client Secret (auth_type: client_credentials) | +| cloud_foundry.access_token | string | none | Access Token (auth_type: token) | +| cloud_foundry.refresh_token | string | none | Refresh Token (auth_type: token) | ### Endpoint Variables Endpoint variables exposed by this observer are as follows. -| Variable | Description | -|-----------|--------------------------------------------------------------------------------------------| -| type | this value is always `container` | -| name | name of the Garden container associated to the port | +| Variable | Description | +| ------------ | --------------------------------------------------------------------------------- | +| type | This value is always `container` | +| name | Name of the Garden container associated to the port | +| labels | map[string]string with labels set on the log_config tags and application resource | +| port | Exposed port of the container | +| container_id | ID of the container | +| host | Hostname or IP of the underlying host the container is running on | +| transport | Transport protocol used by the endpoint (TCP or UDP) | From ef9269ee236ac1f75f1ca5193ee1ad7ff4ea64f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 8 Aug 2024 14:58:35 +0100 Subject: [PATCH 03/32] [extensions/observer/cfgardenobserver] Added changelog --- .chloggen/implement-cfgardenobserver.yaml | 27 ++++++++++++++++++++++ extension/observer/cfgardenobserver/go.mod | 8 +++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .chloggen/implement-cfgardenobserver.yaml diff --git a/.chloggen/implement-cfgardenobserver.yaml b/.chloggen/implement-cfgardenobserver.yaml new file mode 100644 index 000000000000..8d5ace8867f6 --- /dev/null +++ b/.chloggen/implement-cfgardenobserver.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: new_component + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: extensions/observer/cfgardenobserver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Implemented the observer, the second PR in the 3 PR process for new components + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [33618] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index c2d84e59924a..4dcf8d04a615 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -7,9 +7,9 @@ require ( github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.106.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.106.0 - go.opentelemetry.io/collector/confmap v0.106.0 - go.opentelemetry.io/collector/extension v0.106.0 + go.opentelemetry.io/collector/component v0.106.1 + go.opentelemetry.io/collector/confmap v0.106.1 + go.opentelemetry.io/collector/extension v0.106.1 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -47,7 +47,7 @@ require ( github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/tedsuo/rata v1.0.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.106.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.106.1 // indirect go.opentelemetry.io/collector/featuregate v1.12.0 // indirect go.opentelemetry.io/collector/internal/globalgates v0.106.0 // indirect go.opentelemetry.io/collector/pdata v1.12.0 // indirect From c358cc6653d35cb8a3b7dd375a1c3f8aef1e6356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 8 Aug 2024 15:08:43 +0100 Subject: [PATCH 04/32] [extensions/observer/cfgardenobserver] Tidy after dep update --- extension/observer/cfgardenobserver/go.mod | 2 +- extension/observer/cfgardenobserver/go.sum | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 4dcf8d04a615..cbaf61043dc7 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -49,7 +49,7 @@ require ( github.com/tedsuo/rata v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.106.1 // indirect go.opentelemetry.io/collector/featuregate v1.12.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.106.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.106.1 // indirect go.opentelemetry.io/collector/pdata v1.12.0 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index ce8f0a1fc5c0..3ab051336a1a 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -92,18 +92,18 @@ github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.106.0 h1:2CJbqV8taL7nBKuHxeULvJySa4+gfsgvAENb+lS/vYM= -go.opentelemetry.io/collector/component v0.106.0/go.mod h1:lAcHA7k8WVzJRxlkOtOWqgf9+2uRJLfLUiYJapRbr5w= -go.opentelemetry.io/collector/config/configtelemetry v0.106.0 h1:UEUO2pkLpPoAi92MoLhVu3q7mVZONFAxAGorJCtF+aE= -go.opentelemetry.io/collector/config/configtelemetry v0.106.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/confmap v0.106.0 h1:oZ/QfGjtOTz6sEbNkp8CxSwDFRHXej8u6MywvhTzjqI= -go.opentelemetry.io/collector/confmap v0.106.0/go.mod h1:X+nvuiQs3zdeXKkrEX1Ta3R49eLZ2/NYZLs3KUp1pik= -go.opentelemetry.io/collector/extension v0.106.0 h1:E/UY7fmFOMClb6qMYsOxHz3rY4LNXtCcKItkOq/REP4= -go.opentelemetry.io/collector/extension v0.106.0/go.mod h1:e1vJ444rIPTMn/xRwapkV6oSpr07SPi6t2xrDaGrusY= +go.opentelemetry.io/collector/component v0.106.1 h1:6Xp4tKqnd/JkJDG/C4p1hto+Y5zvk5FwqZIdMCPzZlA= +go.opentelemetry.io/collector/component v0.106.1/go.mod h1:KiVE/5ZayuLlDJTe7mHqHRCn/5LrmF99C7/mKe54mWA= +go.opentelemetry.io/collector/config/configtelemetry v0.106.1 h1:A8nwYnI6brfur5KPFC8GtVX/49pByvVoKSgO4qPXBqg= +go.opentelemetry.io/collector/config/configtelemetry v0.106.1/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/confmap v0.106.1 h1:R7HQIPDRPOEwauBeJUlkT8Elc5f0KQr/s/kQfZi05t0= +go.opentelemetry.io/collector/confmap v0.106.1/go.mod h1:iWdWgvxRYSHdAt5ySgPJq/i6fQMKGNnP5Pt7jOfTXno= +go.opentelemetry.io/collector/extension v0.106.1 h1:HNV2eOxaSDy5gL5KYoPoTLlp6fdeWmuw4paxhi10VUo= +go.opentelemetry.io/collector/extension v0.106.1/go.mod h1:DCOGxD+WnIJiDveKWlvH5WwB9AgqlRUlnKgwhNCLrtQ= go.opentelemetry.io/collector/featuregate v1.12.0 h1:l5WbV2vMQd2bL8ubfGrbKNtZaeJRckE12CTHvRe47Tw= go.opentelemetry.io/collector/featuregate v1.12.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= -go.opentelemetry.io/collector/internal/globalgates v0.106.0 h1:Rg6ZM2DROO4nx93nEFoNInisUGLHBq4IAU0oK1/T7jw= -go.opentelemetry.io/collector/internal/globalgates v0.106.0/go.mod h1:Z5US6O2xkZAtxVSSBnHAPFZwPhFoxlyKLUvS67Vx4gc= +go.opentelemetry.io/collector/internal/globalgates v0.106.1 h1:0NQHTcykmYNDsNKObJ2XocGCv3WUAQZppfP3o6hZUIA= +go.opentelemetry.io/collector/internal/globalgates v0.106.1/go.mod h1:Z5US6O2xkZAtxVSSBnHAPFZwPhFoxlyKLUvS67Vx4gc= go.opentelemetry.io/collector/pdata v1.12.0 h1:Xx5VK1p4VO0md8MWm2icwC1MnJ7f8EimKItMWw46BmA= go.opentelemetry.io/collector/pdata v1.12.0/go.mod h1:MYeB0MmMAxeM0hstCFrCqWLzdyeYySim2dG6pDT6nYI= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= From 38238cb9a010f758fb3e443e277b09ab42afd373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Fri, 9 Aug 2024 09:45:12 +0100 Subject: [PATCH 05/32] [extensions/observer/cfgardenobserver] Make including app labels optional --- extension/observer/cfgardenobserver/config.go | 14 ++- .../observer/cfgardenobserver/config_test.go | 52 +++++++---- .../observer/cfgardenobserver/extension.go | 58 ++++++------ .../cfgardenobserver/extension_test.go | 90 ++++++++++++++----- .../cfgardenobserver/testdata/config.yaml | 10 +-- 5 files changed, 151 insertions(+), 73 deletions(-) diff --git a/extension/observer/cfgardenobserver/config.go b/extension/observer/cfgardenobserver/config.go index 494ba9c7398e..7421185e8309 100644 --- a/extension/observer/cfgardenobserver/config.go +++ b/extension/observer/cfgardenobserver/config.go @@ -19,23 +19,33 @@ type Config struct { // RefreshInterval determines the frequency at which the observer // needs to poll for collecting information about new processes. + // Default: "1m" RefreshInterval time.Duration `mapstructure:"refresh_interval"` // The time to wait before resyncing app information on cached containers // using the CloudFoundry API. Example: cache_sync_interval: "20m" // Default: "5m" CacheSyncInterval time.Duration `mapstructure:"cache_sync_interval"` + + // Determines whether or not Application labels get added to the Endpoint labels. + // This requires cloud_foundry to be configured, such that API calls can be made + // Default: false + IncludeAppLabels bool `mapstructure:"include_app_labels"` } // Validate overrides the embedded noop validation so that load config can trigger // our own validation logic. func (config *Config) Validate() error { + if !config.IncludeAppLabels { + return nil + } + c := config.CloudFoundry if c.Endpoint == "" { - return errors.New("config.Endpoint must be specified") + return errors.New("config.Endpoint must be specified when include_app_labels is set to true") } if c.AuthType == "" { - return errors.New("config.AuthType must be specified") + return errors.New("config.AuthType must be specified when include_app_labels is set to true") } switch c.AuthType { diff --git a/extension/observer/cfgardenobserver/config_test.go b/extension/observer/cfgardenobserver/config_test.go index 161d88460540..ecd914b2ac04 100644 --- a/extension/observer/cfgardenobserver/config_test.go +++ b/extension/observer/cfgardenobserver/config_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/confmap/confmaptest" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/cfgardenobserver/internal/metadata" @@ -28,15 +29,10 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ RefreshInterval: 1 * time.Minute, CacheSyncInterval: 5 * time.Minute, + IncludeAppLabels: false, Garden: GardenConfig{ Endpoint: "/var/vcap/data/garden/garden.sock", }, - CloudFoundry: CfConfig{ - Endpoint: "https://api.cf.mydomain.com", - AuthType: "client_credentials", - ClientID: "myclientid", - ClientSecret: "myclientsecret", - }, }, }, { @@ -44,6 +40,7 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ RefreshInterval: 20 * time.Second, CacheSyncInterval: 5 * time.Second, + IncludeAppLabels: true, Garden: GardenConfig{ Endpoint: "/var/vcap/data/garden/custom.sock", }, @@ -63,6 +60,7 @@ func TestLoadConfig(t *testing.T) { }, RefreshInterval: 1 * time.Minute, CacheSyncInterval: 5 * time.Minute, + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", AuthType: "user_pass", @@ -79,6 +77,7 @@ func TestLoadConfig(t *testing.T) { }, RefreshInterval: 1 * time.Minute, CacheSyncInterval: 5 * time.Minute, + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", AuthType: "client_credentials", @@ -95,6 +94,7 @@ func TestLoadConfig(t *testing.T) { }, RefreshInterval: 1 * time.Minute, CacheSyncInterval: 5 * time.Minute, + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", AuthType: "token", @@ -106,21 +106,14 @@ func TestLoadConfig(t *testing.T) { } for _, tt := range tests { t.Run(tt.id.String(), func(t *testing.T) { - cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) - require.NoError(t, err) - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - sub, err := cm.Sub(tt.id.String()) - require.NoError(t, err) - require.NoError(t, sub.Unmarshal(cfg)) - + cfg := loadConfig(t, tt.id) assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) }) } } -func TestConfig_Validate(t *testing.T) { +func TestConfigValidate(t *testing.T) { cases := []struct { reason string cfg Config @@ -128,21 +121,25 @@ func TestConfig_Validate(t *testing.T) { }{ { reason: "missing endpoint", - cfg: Config{}, - msg: "config.Endpoint must be specified", + cfg: Config{ + IncludeAppLabels: true, + }, + msg: "config.Endpoint must be specified when include_app_labels is set to true", }, { reason: "missing auth_type", cfg: Config{ + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", }, }, - msg: "config.AuthType must be specified", + msg: "config.AuthType must be specified when include_app_labels is set to true", }, { reason: "unknown auth_type", cfg: Config{ + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", AuthType: "unknown", @@ -153,6 +150,7 @@ func TestConfig_Validate(t *testing.T) { { reason: "missing username", cfg: Config{ + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", AuthType: AuthTypeUserPass, @@ -163,6 +161,7 @@ func TestConfig_Validate(t *testing.T) { { reason: "missing clientID", cfg: Config{ + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", AuthType: AuthTypeClientCredentials, @@ -173,6 +172,7 @@ func TestConfig_Validate(t *testing.T) { { reason: "missing AccessToken", cfg: Config{ + IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", AuthType: AuthTypeToken, @@ -189,3 +189,19 @@ func TestConfig_Validate(t *testing.T) { }) } } + +func loadConf(t testing.TB, path string, id component.ID) *confmap.Conf { + cm, err := confmaptest.LoadConf(filepath.Join("testdata", path)) + require.NoError(t, err) + sub, err := cm.Sub(id.String()) + require.NoError(t, err) + return sub +} + +func loadConfig(t testing.TB, id component.ID) *Config { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + sub := loadConf(t, "config.yaml", id) + require.NoError(t, sub.Unmarshal(cfg)) + return cfg.(*Config) +} diff --git a/extension/observer/cfgardenobserver/extension.go b/extension/observer/cfgardenobserver/extension.go index e0ae64cbf559..dca5dcba5a74 100644 --- a/extension/observer/cfgardenobserver/extension.go +++ b/extension/observer/cfgardenobserver/extension.go @@ -124,26 +124,28 @@ func (g *cfGardenObserver) Start(_ context.Context, _ component.Host) error { return err } - g.once.Do( - func() { - go func() { - cacheRefreshTicker := time.NewTicker(g.config.CacheSyncInterval) - defer cacheRefreshTicker.Stop() - - for { - select { - case <-g.ctx.Done(): - return - case <-cacheRefreshTicker.C: - err = g.SyncApps() - if err != nil { - g.logger.Error("could not sync app cache", zap.Error(err)) + if g.config.IncludeAppLabels { + g.once.Do( + func() { + go func() { + cacheRefreshTicker := time.NewTicker(g.config.CacheSyncInterval) + defer cacheRefreshTicker.Stop() + + for { + select { + case <-g.ctx.Done(): + return + case <-cacheRefreshTicker.C: + err = g.SyncApps() + if err != nil { + g.logger.Error("could not sync app cache", zap.Error(err)) + } } } - } - }() - }, - ) + }() + }, + ) + } return nil } @@ -192,11 +194,14 @@ func (g *cfGardenObserver) containerEndpoints(handle string, info garden.Contain } ports := strings.Split(portsProp, ",") - app, err := g.App(info) - if err != nil { - g.logger.Error("error fetching Application", zap.Error(err)) - fmt.Println("ERROR") - return nil + var app *resource.App + var err error + if g.config.IncludeAppLabels { + app, err = g.App(info) + if err != nil { + g.logger.Error("error fetching Application", zap.Error(err)) + return nil + } } endpoints := []observer.Endpoint{} @@ -230,7 +235,6 @@ func (g *cfGardenObserver) containerLabels(info garden.ContainerInfo, app *resou labels := make(map[string]string) tags, err := parseTags(info) if err != nil { - fmt.Println(err) g.logger.Warn("not able to parse container tags into labels", zap.Error(err)) return nil } @@ -238,8 +242,10 @@ func (g *cfGardenObserver) containerLabels(info garden.ContainerInfo, app *resou labels[k] = v } - for k, v := range app.Metadata.Labels { - labels[k] = *v + if app != nil { + for k, v := range app.Metadata.Labels { + labels[k] = *v + } } return labels diff --git a/extension/observer/cfgardenobserver/extension_test.go b/extension/observer/cfgardenobserver/extension_test.go index efba02e27eed..5bbdc5cea5d2 100644 --- a/extension/observer/cfgardenobserver/extension_test.go +++ b/extension/observer/cfgardenobserver/extension_test.go @@ -10,9 +10,11 @@ import ( "code.cloudfoundry.org/garden" "github.com/cloudfoundry/go-cfclient/v3/resource" "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/cfgardenobserver/internal/metadata" ) func strPtr(s string) *string { return &s } @@ -59,10 +61,8 @@ func TestContainerEndpoints(t *testing.T) { Port: uint16(8080), Transport: observer.ProtocolTCP, Labels: map[string]string{ - "app_id": appID, - "app_name": "myapp", - "app_label": "app_value", - "app_label2": "app_value2", + "app_id": appID, + "app_name": "myapp", }, }, }, @@ -89,10 +89,8 @@ func TestContainerEndpoints(t *testing.T) { Port: uint16(8080), Transport: observer.ProtocolTCP, Labels: map[string]string{ - "app_id": appID, - "app_name": "myapp", - "app_label": "app_value", - "app_label2": "app_value2", + "app_id": appID, + "app_name": "myapp", }, }, }, @@ -106,10 +104,8 @@ func TestContainerEndpoints(t *testing.T) { Port: uint16(9999), Transport: observer.ProtocolTCP, Labels: map[string]string{ - "app_id": appID, - "app_name": "myapp", - "app_label": "app_value", - "app_label2": "app_value2", + "app_id": appID, + "app_name": "myapp", }, }, }, @@ -118,24 +114,76 @@ func TestContainerEndpoints(t *testing.T) { } for _, tt := range tests { - factory := NewFactory() - ext, err := newObserver(factory.CreateDefaultConfig().(*Config), zap.NewNop()) + config := loadConfig(t, component.NewID(metadata.Type)) + ext, err := newObserver(config, zap.NewNop()) require.NoError(t, err) require.NotNil(t, ext) obs, ok := ext.(*cfGardenObserver) require.True(t, ok) - obs.apps[appID] = &resource.App{ - Metadata: &resource.Metadata{ - Labels: map[string]*string{ - "app_label": strPtr("app_value"), - "app_label2": strPtr("app_value2"), + require.Equal(t, tt.expected, obs.containerEndpoints(handle, tt.input)) + } +} + +func TestIncludeAppLabels(t *testing.T) { + handle := "14d91d46-6ebd-43a1-8e20-316d8e6a92a4" + ip := "1.2.3.4" + appID := "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + logConfig := fmt.Sprintf(` +{ + "guid": "%s", + "index": 0, + "source_name": "CELL", + "tags": { + "app_id": "%s", + "app_name": "myapp" + } +} + `, handle, appID) + input := garden.ContainerInfo{ + ContainerIP: ip, + Properties: map[string]string{ + "log_config": logConfig, + "network.ports": "8080", + "network.app_id": appID, + }, + } + expected := []observer.Endpoint{ + { + ID: observer.EndpointID(fmt.Sprintf("%s:%d", handle, 8080)), + Target: fmt.Sprintf("%s:%d", ip, 8080), + Details: &observer.Container{ + Name: handle, + ContainerID: handle, + Host: ip, + Port: uint16(8080), + Transport: observer.ProtocolTCP, + Labels: map[string]string{ + "app_id": appID, + "app_name": "myapp", + "app_label": "app_value", + "app_label2": "app_value2", }, }, - } + }, + } - require.Equal(t, tt.expected, obs.containerEndpoints(handle, tt.input)) + extAllSettings := loadConfig(t, component.NewIDWithName(metadata.Type, "all_settings")) + ext, err := newObserver(extAllSettings, zap.NewNop()) + require.NoError(t, err) + require.NotNil(t, ext) + + obs, ok := ext.(*cfGardenObserver) + obs.apps[appID] = &resource.App{ + Metadata: &resource.Metadata{ + Labels: map[string]*string{ + "app_label": strPtr("app_value"), + "app_label2": strPtr("app_value2"), + }, + }, } + require.True(t, ok) + require.Equal(t, expected, obs.containerEndpoints(handle, input)) } func TestContainerLabels(t *testing.T) { diff --git a/extension/observer/cfgardenobserver/testdata/config.yaml b/extension/observer/cfgardenobserver/testdata/config.yaml index 81a3626f4a00..252ce25aa916 100644 --- a/extension/observer/cfgardenobserver/testdata/config.yaml +++ b/extension/observer/cfgardenobserver/testdata/config.yaml @@ -1,12 +1,7 @@ -cfgarden_observer: - cloud_foundry: - endpoint: https://api.cf.mydomain.com - auth_type: client_credentials - client_id: myclientid - client_secret: myclientsecret cfgarden_observer/all_settings: cache_sync_interval: 5s refresh_interval: 20s + include_app_labels: true garden: endpoint: /var/vcap/data/garden/custom.sock cloud_foundry: @@ -15,18 +10,21 @@ cfgarden_observer/all_settings: username: myuser password: mypass cfgarden_observer/user_pass: + include_app_labels: true cloud_foundry: endpoint: https://api.cf.mydomain.com auth_type: user_pass username: myuser password: mypass cfgarden_observer/client_credentials: + include_app_labels: true cloud_foundry: endpoint: https://api.cf.mydomain.com auth_type: client_credentials client_id: myclientid client_secret: myclientsecret cfgarden_observer/token: + include_app_labels: true cloud_foundry: endpoint: https://api.cf.mydomain.com auth_type: token From 8eea55b7ae3033e49e2cd584b1f90dee7d1e4ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Mon, 12 Aug 2024 09:46:06 +0100 Subject: [PATCH 06/32] [extensions/observer/cfgardenobserver] Run tidy --- extension/observer/cfgardenobserver/go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 52f6aa8c68c7..5719a0c3d740 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -46,6 +46,7 @@ require ( 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 + github.com/tedsuo/rata v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.106.2-0.20240809191011-ef07ea073562 // indirect go.opentelemetry.io/collector/featuregate v1.12.1-0.20240809191011-ef07ea073562 // indirect go.opentelemetry.io/collector/internal/globalgates v0.106.2-0.20240809191011-ef07ea073562 // indirect From 8c15f7a5d60eb6e5c1616d8e0adf29b2c800635f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Tue, 13 Aug 2024 09:54:48 +0100 Subject: [PATCH 07/32] [extensions/observer/cfgardenobserver] Gen --- .../cfgardenobserver/internal/metadata/generated_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/observer/cfgardenobserver/internal/metadata/generated_status.go b/extension/observer/cfgardenobserver/internal/metadata/generated_status.go index 547bd8c0b7e6..b198899f25a8 100644 --- a/extension/observer/cfgardenobserver/internal/metadata/generated_status.go +++ b/extension/observer/cfgardenobserver/internal/metadata/generated_status.go @@ -8,7 +8,7 @@ import ( var ( Type = component.MustNewType("cfgarden_observer") - ScopeName = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/cfgardenobserver" + ScopeName = "otelcol/cfgardenobserver" ) const ( From 03f689fa8f1f224c5bc019c3e21da1571705e4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Tue, 13 Aug 2024 11:09:29 +0100 Subject: [PATCH 08/32] [extensions/observer/cfgardenobserver] Go Tidy --- extension/observer/cfgardenobserver/go.mod | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 9e90d3ded71b..eca17cce8d93 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -46,6 +46,11 @@ require ( 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 + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.107.0 // indirect + go.opentelemetry.io/collector/featuregate v1.13.0 // indirect + go.opentelemetry.io/collector/internal/globalgates v0.107.0 // indirect + go.opentelemetry.io/collector/pdata v1.13.0 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect go.opentelemetry.io/otel/metric v1.28.0 // indirect From 0421a10c59fca676785e6df58882e617bea45437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Tue, 13 Aug 2024 15:19:30 +0100 Subject: [PATCH 09/32] [extensions/observer/cfgardenobserver] Add include_app_labels to docs --- extension/observer/cfgardenobserver/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extension/observer/cfgardenobserver/README.md b/extension/observer/cfgardenobserver/README.md index 3c43fed6b5c5..9baac88f810c 100644 --- a/extension/observer/cfgardenobserver/README.md +++ b/extension/observer/cfgardenobserver/README.md @@ -53,7 +53,8 @@ receivers: | Name | Type | Default | Description | | --------------------------- | ------ | --------------------------------- | ----------------------------------------------------------------- | | refresh_interval | string | 60s | Determines how often to look for changes in endpoints. | -| cache_sync_interval | string | 5m | determines how often app metadata cache is refreshed | +| cache_sync_interval | string | 5m | Determines how often app metadata cache is refreshed | +| include_app_labels | bool | false | Determines whether or not app labels get added to container labels| | garden.endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | | cloud_foundry.endpoint | string | none. parameter is required | CloudFoundry API endpoint | | cloud_foundry.auth_type | string | none. parameter is required | Authentication type, one of: user_pass, client_credentials, token | From 1b8ab0975540da1ad9d5322bc315ef83af527f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 14 Aug 2024 09:51:15 +0100 Subject: [PATCH 10/32] [extensions/observer/cfgardenobserver] Address review tweaks --- extension/observer/cfgardenobserver/README.md | 37 +++++------- extension/observer/cfgardenobserver/config.go | 36 ++++++------ .../observer/cfgardenobserver/config_test.go | 16 ++--- .../observer/cfgardenobserver/extension.go | 58 +++++++++---------- 4 files changed, 70 insertions(+), 77 deletions(-) diff --git a/extension/observer/cfgardenobserver/README.md b/extension/observer/cfgardenobserver/README.md index 9baac88f810c..fb88d08c114f 100644 --- a/extension/observer/cfgardenobserver/README.md +++ b/extension/observer/cfgardenobserver/README.md @@ -20,21 +20,15 @@ The `cfgarden_observer` looks at the current host to discover Garden containers. ```yaml extensions: cfgarden_observer: - # determines how often to look for changes in endpoints. refresh_interval: 30s - # determines how often app metadata cache is refreshed cache_sync_interval: 10m + include_app_labels: true garden: - # path of the Garden socket, defaults to /var/vcap/data/garden/garden.sock endpoint: my/path/to/garden.sock cloud_foundry: - # CloudFoundry API endpoint, required endpoint: https://api.cf.mydomain.com - # Authentication type, required auth_type: client_credentials - # Client ID client_id: myclientid - # Client Secret client_secret: myclientsecret receivers: @@ -49,21 +43,20 @@ receivers: ``` ### Configuration - -| Name | Type | Default | Description | -| --------------------------- | ------ | --------------------------------- | ----------------------------------------------------------------- | -| refresh_interval | string | 60s | Determines how often to look for changes in endpoints. | -| cache_sync_interval | string | 5m | Determines how often app metadata cache is refreshed | -| include_app_labels | bool | false | Determines whether or not app labels get added to container labels| -| garden.endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | -| cloud_foundry.endpoint | string | none. parameter is required | CloudFoundry API endpoint | -| cloud_foundry.auth_type | string | none. parameter is required | Authentication type, one of: user_pass, client_credentials, token | -| cloud_foundry.username | string | none | Username (auth_type: user_pass) | -| cloud_foundry.password | string | none | Password (auth_type: user_pass) | -| cloud_foundry.client_id | string | none | Client ID (auth_type: client_credentials) | -| cloud_foundry.client_secret | string | none | Client Secret (auth_type: client_credentials) | -| cloud_foundry.access_token | string | none | Access Token (auth_type: token) | -| cloud_foundry.refresh_token | string | none | Refresh Token (auth_type: token) | +| Name | Type | Default | Description | +| --------------------------- | ------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------ | +| refresh_interval | string | 1m | Determines how often to look for changes in endpoints. | +| cache_sync_interval | string | 5m | Determines how often app metadata cache is refreshed | +| include_app_labels | bool | false | Determines whether or not app labels get added to container labels | +| garden.endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | +| cloud_foundry.endpoint | string | none. required when `include_app_labels` is set to `true` | CloudFoundry API endpoint | +| cloud_foundry.auth_type | string | none. required when `include_app_labels` is set to `true` | Authentication type, one of: user_pass, client_credentials, token | +| cloud_foundry.username | string | none. | Username (auth_type: user_pass) | +| cloud_foundry.password | string | none | Password (auth_type: user_pass) | +| cloud_foundry.client_id | string | none | Client ID (auth_type: client_credentials) | +| cloud_foundry.client_secret | string | none | Client Secret (auth_type: client_credentials) | +| cloud_foundry.access_token | string | none | Access Token (auth_type: token) | +| cloud_foundry.refresh_token | string | none | Refresh Token (auth_type: token) | ### Endpoint Variables diff --git a/extension/observer/cfgardenobserver/config.go b/extension/observer/cfgardenobserver/config.go index 7421185e8309..7fc2200b31dc 100644 --- a/extension/observer/cfgardenobserver/config.go +++ b/extension/observer/cfgardenobserver/config.go @@ -45,33 +45,33 @@ func (config *Config) Validate() error { return errors.New("config.Endpoint must be specified when include_app_labels is set to true") } if c.AuthType == "" { - return errors.New("config.AuthType must be specified when include_app_labels is set to true") + return errors.New("config.authType must be specified when include_app_labels is set to true") } switch c.AuthType { - case AuthTypeUserPass: + case authTypeUserPass: if c.Username == "" { - return fieldError(AuthTypeUserPass, "username") + return fieldError(authTypeUserPass, "username") } if c.Password == "" { - return fieldError(AuthTypeUserPass, "password") + return fieldError(authTypeUserPass, "password") } - case AuthTypeClientCredentials: + case authTypeClientCredentials: if c.ClientID == "" { - return fieldError(AuthTypeClientCredentials, "client_id") + return fieldError(authTypeClientCredentials, "client_id") } if c.ClientSecret == "" { - return fieldError(AuthTypeClientCredentials, "client_secret") + return fieldError(authTypeClientCredentials, "client_secret") } - case AuthTypeToken: + case authTypeToken: if c.AccessToken == "" { - return fieldError(AuthTypeToken, "access_token") + return fieldError(authTypeToken, "access_token") } if c.RefreshToken == "" { - return fieldError(AuthTypeToken, "refresh_token") + return fieldError(authTypeToken, "refresh_token") } default: - return fmt.Errorf("unknown auth_type: %s", c.AuthType) + return fmt.Errorf("configuration option `auth_type` must be set to one of the following values: [user_pass, client_credentials, token]. Specified value: %s", c.AuthType) } return nil @@ -106,14 +106,14 @@ type CfConfig struct { ClientSecret string `mapstructure:"client_secret"` } -// AuthType describes the type of authentication to use for the CloudFoundry API +// authType describes the type of authentication to use for the CloudFoundry API type AuthType string const ( - // AuthTypeClientCredentials uses a client ID and client secret to authenticate - AuthTypeClientCredentials AuthType = "client_credentials" - // AuthTypeUserPass uses username and password to authenticate - AuthTypeUserPass AuthType = "user_pass" - // AuthTypeToken uses access token and refresh token to authenticate - AuthTypeToken AuthType = "token" + // authTypeClientCredentials uses a client ID and client secret to authenticate + authTypeClientCredentials AuthType = "client_credentials" + // authTypeUserPass uses username and password to authenticate + authTypeUserPass AuthType = "user_pass" + // authTypeToken uses access token and refresh token to authenticate + authTypeToken AuthType = "token" ) diff --git a/extension/observer/cfgardenobserver/config_test.go b/extension/observer/cfgardenobserver/config_test.go index ecd914b2ac04..358c9842f10e 100644 --- a/extension/observer/cfgardenobserver/config_test.go +++ b/extension/observer/cfgardenobserver/config_test.go @@ -134,7 +134,7 @@ func TestConfigValidate(t *testing.T) { Endpoint: "https://api.cf.mydomain.com", }, }, - msg: "config.AuthType must be specified when include_app_labels is set to true", + msg: "config.authType must be specified when include_app_labels is set to true", }, { reason: "unknown auth_type", @@ -145,7 +145,7 @@ func TestConfigValidate(t *testing.T) { AuthType: "unknown", }, }, - msg: "unknown auth_type: unknown", + msg: "configuration option `auth_type` must be set to one of the following values: [user_pass, client_credentials, token]. Specified value: unknown", }, { reason: "missing username", @@ -153,10 +153,10 @@ func TestConfigValidate(t *testing.T) { IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: AuthTypeUserPass, + AuthType: authTypeUserPass, }, }, - msg: fieldError(AuthTypeUserPass, "username").Error(), + msg: fieldError(authTypeUserPass, "username").Error(), }, { reason: "missing clientID", @@ -164,10 +164,10 @@ func TestConfigValidate(t *testing.T) { IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: AuthTypeClientCredentials, + AuthType: authTypeClientCredentials, }, }, - msg: fieldError(AuthTypeClientCredentials, "client_id").Error(), + msg: fieldError(authTypeClientCredentials, "client_id").Error(), }, { reason: "missing AccessToken", @@ -175,10 +175,10 @@ func TestConfigValidate(t *testing.T) { IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: AuthTypeToken, + AuthType: authTypeToken, }, }, - msg: fieldError(AuthTypeToken, "access_token").Error(), + msg: fieldError(authTypeToken, "access_token").Error(), }, } diff --git a/extension/observer/cfgardenobserver/extension.go b/extension/observer/cfgardenobserver/extension.go index dca5dcba5a74..64696873a722 100644 --- a/extension/observer/cfgardenobserver/extension.go +++ b/extension/observer/cfgardenobserver/extension.go @@ -6,7 +6,6 @@ package cfgardenobserver // import "github.com/open-telemetry/opentelemetry-coll import ( "context" "encoding/json" - "errors" "fmt" "strconv" "strings" @@ -26,6 +25,14 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer" ) +const ( + propertiesAppIDKey = "network.app_id" + propertiesPortsKey = "network.ports" + propertiesLogConfigKey = "log_config" + logConfigTagsKey = "tags" + containerStateActive = "active" +) + type cfGardenObserver struct { *observer.EndpointsWatcher cancel context.CancelFunc @@ -70,9 +77,9 @@ func (g *cfGardenObserver) SyncApps() error { defer g.appMu.Unlock() g.apps = make(map[string]*resource.App) for _, info := range containers { - appID, err := infoToAppID(info) - if err != nil { - return err + appID, ok := info.Properties[propertiesAppIDKey] + if !ok { + return fmt.Errorf("container properties do not have a `%s` field, required to fetch application labels", propertiesAppIDKey) } if _, ok := g.apps[appID]; ok { @@ -90,9 +97,9 @@ func (g *cfGardenObserver) SyncApps() error { } func (g *cfGardenObserver) App(info garden.ContainerInfo) (*resource.App, error) { - appID, err := infoToAppID(info) - if err != nil { - return nil, err + appID, ok := info.Properties[propertiesAppIDKey] + if !ok { + return nil, fmt.Errorf("container properties do not have a `%s` field, required to fetch application labels", propertiesAppIDKey) } g.appMu.Lock() @@ -102,7 +109,7 @@ func (g *cfGardenObserver) App(info garden.ContainerInfo) (*resource.App, error) return app, nil } - app, err = g.cf.Applications.Get(g.ctx, appID) + app, err := g.cf.Applications.Get(g.ctx, appID) if err != nil { return nil, err } @@ -172,7 +179,7 @@ func (g *cfGardenObserver) ListEndpoints() []observer.Endpoint { continue } - if info.State != "active" { + if info.State != containerStateActive { continue } @@ -187,7 +194,7 @@ func (g *cfGardenObserver) ListEndpoints() []observer.Endpoint { // containerEndpoints generates a list of observer.Endpoint for a container, // this is because a container might have more than one exposed ports func (g *cfGardenObserver) containerEndpoints(handle string, info garden.ContainerInfo) []observer.Endpoint { - portsProp, ok := info.Properties["network.ports"] + portsProp, ok := info.Properties[propertiesPortsKey] if !ok { g.logger.Error("could not discover container ports") return nil @@ -199,14 +206,15 @@ func (g *cfGardenObserver) containerEndpoints(handle string, info garden.Contain if g.config.IncludeAppLabels { app, err = g.App(info) if err != nil { - g.logger.Error("error fetching Application", zap.Error(err)) + g.logger.Error("error fetching application", zap.Error(err)) return nil } } endpoints := []observer.Endpoint{} - for _, port := range ports { - port, err := strconv.ParseUint(port, 10, 16) + for _, portString := range ports { + var port uint64 + port, err = strconv.ParseUint(portString, 10, 16) if err != nil { g.logger.Error("container port is not valid", zap.Error(err)) continue @@ -252,7 +260,7 @@ func (g *cfGardenObserver) containerLabels(info garden.ContainerInfo, app *resou } // The info.Properties contains a key called "log_config", which -// has contents that look like the following JSON endoded string: +// has contents that look like the following JSON encoded string: // // { // "guid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", @@ -275,9 +283,9 @@ func (g *cfGardenObserver) containerLabels(info garden.ContainerInfo, app *resou // // We parse only the tags into a map, to be used as labels func parseTags(info garden.ContainerInfo) (map[string]string, error) { - logConfig, ok := info.Properties["log_config"] + logConfig, ok := info.Properties[propertiesLogConfigKey] if !ok { - return nil, errors.New("container properties do not have log_config field") + return nil, fmt.Errorf("container properties do not have a `%s` field", propertiesLogConfigKey) } var data map[string]any @@ -286,9 +294,9 @@ func parseTags(info garden.ContainerInfo) (map[string]string, error) { return nil, fmt.Errorf("error unmarshaling logConfig: %w", err) } - tags, ok := data["tags"].(map[string]any) + tags, ok := data[logConfigTagsKey].(map[string]any) if !ok { - return nil, fmt.Errorf("expected tags field to be a map. got=%T", data["tags"]) + return nil, fmt.Errorf("expected tags field to be a map. got=%T", data[logConfigTagsKey]) } result := make(map[string]string) @@ -306,11 +314,11 @@ func newCfClient(cfConfig CfConfig) (*client.Client, error) { var err error switch cfConfig.AuthType { - case AuthTypeUserPass: + case authTypeUserPass: cfg, err = config.New(cfConfig.Endpoint, config.UserPassword(cfConfig.Username, cfConfig.Password)) - case AuthTypeClientCredentials: + case authTypeClientCredentials: cfg, err = config.New(cfConfig.Endpoint, config.ClientCredentials(cfConfig.ClientID, cfConfig.ClientSecret)) - case AuthTypeToken: + case authTypeToken: cfg, err = config.New(cfConfig.Endpoint, config.Token(cfConfig.AccessToken, cfConfig.RefreshToken)) } @@ -330,11 +338,3 @@ func (g *cfGardenObserver) updateContainerCache(infos map[string]garden.Containe defer g.containerMu.Unlock() g.containers = infos } - -func infoToAppID(info garden.ContainerInfo) (string, error) { - id, ok := info.Properties["network.app_id"] - if !ok { - return "", errors.New("could not find app_id") - } - return id, nil -} From c405be6dc15f4d4b436dfe3dc09a0d9f8453bd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 14 Aug 2024 10:52:45 +0100 Subject: [PATCH 11/32] [extensions/observer/cfgardenobserver] Gen otelcontribcol --- cmd/otelcontribcol/go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index d351fd22cc45..07ef3de25736 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -517,6 +517,7 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect github.com/google/s2a-go v0.1.8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect From 3924cb6b22eb9623882511d88f351df75638e09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 14 Aug 2024 12:49:21 +0100 Subject: [PATCH 12/32] [extensions/observer/cfgardenobserver] Keep channel instead of context in struct --- .../observer/cfgardenobserver/extension.go | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/extension/observer/cfgardenobserver/extension.go b/extension/observer/cfgardenobserver/extension.go index 64696873a722..a5c13653b0eb 100644 --- a/extension/observer/cfgardenobserver/extension.go +++ b/extension/observer/cfgardenobserver/extension.go @@ -35,11 +35,11 @@ const ( type cfGardenObserver struct { *observer.EndpointsWatcher - cancel context.CancelFunc - config *Config - ctx context.Context - logger *zap.Logger - once *sync.Once + cancel context.CancelFunc + config *Config + doneChan <-chan struct{} + logger *zap.Logger + once *sync.Once garden garden.Client cf *client.Client @@ -86,7 +86,7 @@ func (g *cfGardenObserver) SyncApps() error { continue } - app, err := g.cf.Applications.Get(g.ctx, appID) + app, err := g.cf.Applications.Get(context.Background(), appID) if err != nil { return fmt.Errorf("error fetching application: %w", err) } @@ -109,7 +109,7 @@ func (g *cfGardenObserver) App(info garden.ContainerInfo) (*resource.App, error) return app, nil } - app, err := g.cf.Applications.Get(g.ctx, appID) + app, err := g.cf.Applications.Get(context.Background(), appID) if err != nil { return nil, err } @@ -119,9 +119,9 @@ func (g *cfGardenObserver) App(info garden.ContainerInfo) (*resource.App, error) } func (g *cfGardenObserver) Start(_ context.Context, _ component.Host) error { - gCtx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(context.Background()) g.cancel = cancel - g.ctx = gCtx + g.doneChan = ctx.Done() g.garden = gardenClient.New(gardenConnection.New("unix", g.config.Garden.Endpoint)) @@ -140,7 +140,7 @@ func (g *cfGardenObserver) Start(_ context.Context, _ component.Host) error { for { select { - case <-g.ctx.Done(): + case <-g.doneChan: return case <-cacheRefreshTicker.C: err = g.SyncApps() From 7273310e5223975778340b5b9352536a06aaebfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 14 Aug 2024 21:30:17 +0100 Subject: [PATCH 13/32] [extensions/observer/cfgardenobserver] Remove CancelFunc --- extension/observer/cfgardenobserver/extension.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/extension/observer/cfgardenobserver/extension.go b/extension/observer/cfgardenobserver/extension.go index a5c13653b0eb..0d71dd53d784 100644 --- a/extension/observer/cfgardenobserver/extension.go +++ b/extension/observer/cfgardenobserver/extension.go @@ -35,9 +35,8 @@ const ( type cfGardenObserver struct { *observer.EndpointsWatcher - cancel context.CancelFunc config *Config - doneChan <-chan struct{} + doneChan chan struct{} logger *zap.Logger once *sync.Once @@ -60,9 +59,7 @@ func newObserver(config *Config, logger *zap.Logger) (extension.Extension, error once: &sync.Once{}, containers: make(map[string]garden.ContainerInfo), apps: make(map[string]*resource.App), - cancel: func() { - // Safe value provided on initialisation - }, + doneChan: make(chan struct{}), } g.EndpointsWatcher = observer.NewEndpointsWatcher(g, config.RefreshInterval, logger) return g, nil @@ -119,10 +116,6 @@ func (g *cfGardenObserver) App(info garden.ContainerInfo) (*resource.App, error) } func (g *cfGardenObserver) Start(_ context.Context, _ component.Host) error { - ctx, cancel := context.WithCancel(context.Background()) - g.cancel = cancel - g.doneChan = ctx.Done() - g.garden = gardenClient.New(gardenConnection.New("unix", g.config.Garden.Endpoint)) var err error @@ -158,7 +151,7 @@ func (g *cfGardenObserver) Start(_ context.Context, _ component.Host) error { } func (g *cfGardenObserver) Shutdown(_ context.Context) error { - g.cancel() + close(g.doneChan) return nil } From eb80736b4e9f6bc10a11964e2a56a5e79864c20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 14 Aug 2024 21:44:42 +0100 Subject: [PATCH 14/32] [extensions/observer/cfgardenobserver] Go mod --- cmd/otelcontribcol/go.mod | 3 +-- cmd/otelcontribcol/go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index e23ae70567b1..2eb176adb3de 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -682,9 +682,8 @@ require ( github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/outcaste-io/ristretto v0.2.1 // indirect - github.com/ovh/go-ovh v1.5.1 // indirect - github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/ovh/go-ovh v1.6.0 // indirect + github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/paulmach/orb v0.11.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 60d5396a7d61..b3882eb90edf 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -2016,10 +2016,10 @@ github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7s github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/outcaste-io/ristretto v0.2.1 h1:KCItuNIGJZcursqHr3ghO7fc5ddZLEHspL9UR0cQM64= github.com/outcaste-io/ristretto v0.2.1/go.mod h1:W8HywhmtlopSB1jeMg3JtdIhf+DYkLAr0VN/s4+MHac= -github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= -github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI= github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= +github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -2249,8 +2249,8 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.977 h1:/M1XvgBEBaq7TfgqYQc0MqqEEuhRmyaukBR+giD7y18= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.977/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.982 h1:gxat/4F9zSOQRT2Kr9XvoakNyeWWXoLDPpdQruWfA2I= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.982/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.32.0 h1:ug1aK08L3gCHdhknlTTwWjPHPS+/alvLJU/DRxTD/ME= github.com/testcontainers/testcontainers-go v0.32.0/go.mod h1:CRHrzHLQhlXUsa5gXjTOfqIEJcrK5+xMDmBr/WMI88E= github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= From 4575eb286142641eda2f930dbd74d66a3927b826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Tue, 20 Aug 2024 13:28:57 +0100 Subject: [PATCH 15/32] [extensions/observer/cfgardenobserver] Go tidy --- extension/observer/cfgardenobserver/go.mod | 1 + extension/observer/cfgardenobserver/go.sum | 33 ++++++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 32c73adaf26c..b822e894f540 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -47,6 +47,7 @@ require ( github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.0.0-20240731165531-6d32c09daf9f // indirect go.opentelemetry.io/collector/config/configtelemetry v0.107.0 // indirect go.opentelemetry.io/collector/featuregate v1.13.0 // indirect go.opentelemetry.io/collector/internal/globalgates v0.107.0 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index 8d4e739ee81f..ed297745dbfc 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -11,6 +11,23 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 h1:HK3+nJEPgwlhc5H74aw/V4mVowqWaTKGjHONdVQQ2Vw= github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9/go.mod h1:eUjFfpsU3lRv388wKlXMmkQfsJ9pveUHZEia7AoBCPY= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +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/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +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-martini/martini v0.0.0-20170121215854-22fa46961aab h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/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/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -79,18 +96,18 @@ go.opentelemetry.io/collector/component v0.107.1-0.20240816132030-9fd84668bb02 h go.opentelemetry.io/collector/component v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:dJbbK7+PLB4qvX1pboKyBnpRimGCV4qFJemPiLO4rdo= go.opentelemetry.io/collector/component/componentstatus v0.0.0-20240731165531-6d32c09daf9f h1:VuVQ+G0e7HqXTFoGbLfyXUnX2+6dieyxNNE8ITJrBX8= go.opentelemetry.io/collector/component/componentstatus v0.0.0-20240731165531-6d32c09daf9f/go.mod h1:og4XLcnY0wAMtUK+xd2ZFexQnH5Io3AhJx0SPQLmv2Q= -go.opentelemetry.io/collector/config/configtelemetry v0.107.1-0.20240816132030-9fd84668bb02 h1:qpoImoLfVpZfND+o2qKJ0hib15yTF7mnjKBnS8O+cKQ= -go.opentelemetry.io/collector/config/configtelemetry v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/config/configtelemetry v0.107.0 h1:pSGd4FWQ/Up/Af+XZTR8JNneH/wmQ/TAU4Z16JHQeUc= +go.opentelemetry.io/collector/config/configtelemetry v0.107.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= go.opentelemetry.io/collector/confmap v0.107.1-0.20240816132030-9fd84668bb02 h1:ebDK+CmU+bGm5T/hAao09vxc4SG6+qQgSuRvDGjzFyY= go.opentelemetry.io/collector/confmap v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:3ybd6KEP2x4PcfFhrrEX86b4Y9dk6uBgFgMgK1Rc+aE= go.opentelemetry.io/collector/extension v0.107.1-0.20240816132030-9fd84668bb02 h1:uuTR9a4mj3vPboCCivieIYa4FMfvyo+ZyqEGF1h6jkY= go.opentelemetry.io/collector/extension v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:eH5yJAfY31Bb4x92siOxf/YVgjurqfAStDkMwlHgFZs= -go.opentelemetry.io/collector/featuregate v1.13.1-0.20240816132030-9fd84668bb02 h1:ZoCqkkOcfTJW7nd6hNF+cTD2cVSn48/OA4sgQVkxnhM= -go.opentelemetry.io/collector/featuregate v1.13.1-0.20240816132030-9fd84668bb02/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/internal/globalgates v0.107.1-0.20240816132030-9fd84668bb02 h1:syCCE97HFHcsgfDVCfRGj0CI1Uwky7rqbUWhTOAtD5A= -go.opentelemetry.io/collector/internal/globalgates v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:7IA1qlvv7qJ9ykanv1lIdjrkS+yL/ugOrr9Rgxb7lwU= -go.opentelemetry.io/collector/pdata v1.13.1-0.20240816132030-9fd84668bb02 h1:ZWKffCXPwEjYkfoDPCVLHEBdHrFyD/ZcMc4nbCmYkFU= -go.opentelemetry.io/collector/pdata v1.13.1-0.20240816132030-9fd84668bb02/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= +go.opentelemetry.io/collector/featuregate v1.13.0 h1:rc84eCf5hesXQ8/bP6Zc15wqthbomfLBHmox5tT7AwM= +go.opentelemetry.io/collector/featuregate v1.13.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= +go.opentelemetry.io/collector/internal/globalgates v0.107.0 h1:PaD6WgQg80YTVxg8OF+YEqgI7WRd13wMu/R6GIG7uNU= +go.opentelemetry.io/collector/internal/globalgates v0.107.0/go.mod h1:hca7Tpzu6JmBrAOgmlyp/ZM6kxprPRMKqSYoq/Tdzjw= +go.opentelemetry.io/collector/pdata v1.13.0 h1:eV3NQt2f1UcaibkziMvGTQI34LlpiYBUGp1yP0G/Cxw= +go.opentelemetry.io/collector/pdata v1.13.0/go.mod h1:MYeB0MmMAxeM0hstCFrCqWLzdyeYySim2dG6pDT6nYI= 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/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng= From ea84eb7158c76ae0788072464aadc8fe7aa936e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 21 Aug 2024 13:23:25 +0100 Subject: [PATCH 16/32] [extensions/observer/cfgardenobserver] Make authType private --- cmd/otelcontribcol/go.sum | 7 ++++++- extension/observer/cfgardenobserver/config.go | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 5c480b854e17..f24ffdc193d5 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -1390,7 +1390,6 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= @@ -2246,6 +2245,12 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.987 h1:SjSW4sjqeRuOw+6YYGvR0GSm/RglmWhRqXWPtzNFg1s= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.987/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.32.0 h1:ug1aK08L3gCHdhknlTTwWjPHPS+/alvLJU/DRxTD/ME= github.com/testcontainers/testcontainers-go v0.32.0/go.mod h1:CRHrzHLQhlXUsa5gXjTOfqIEJcrK5+xMDmBr/WMI88E= github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= diff --git a/extension/observer/cfgardenobserver/config.go b/extension/observer/cfgardenobserver/config.go index 7fc2200b31dc..ac561531fdec 100644 --- a/extension/observer/cfgardenobserver/config.go +++ b/extension/observer/cfgardenobserver/config.go @@ -77,7 +77,7 @@ func (config *Config) Validate() error { return nil } -func fieldError(authType AuthType, param string) error { +func fieldError(authType authType, param string) error { return fmt.Errorf("%s is required when using auth_type: %s", param, authType) } @@ -91,7 +91,7 @@ type CfConfig struct { Endpoint string `mapstructure:"endpoint"` // Authentication method, there are 3 options - AuthType AuthType `mapstructure:"auth_type"` + AuthType authType `mapstructure:"auth_type"` // Used for user_pass authentication method Username string `mapstructure:"username"` @@ -107,13 +107,13 @@ type CfConfig struct { } // authType describes the type of authentication to use for the CloudFoundry API -type AuthType string +type authType string const ( // authTypeClientCredentials uses a client ID and client secret to authenticate - authTypeClientCredentials AuthType = "client_credentials" + authTypeClientCredentials authType = "client_credentials" // authTypeUserPass uses username and password to authenticate - authTypeUserPass AuthType = "user_pass" + authTypeUserPass authType = "user_pass" // authTypeToken uses access token and refresh token to authenticate - authTypeToken AuthType = "token" + authTypeToken authType = "token" ) From 4425eab9b26b7f7f473b94d571da56254b36cf8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 21 Aug 2024 14:09:19 +0100 Subject: [PATCH 17/32] [extensions/observer/cfgardenobserver] Go tidy --- extension/observer/cfgardenobserver/go.mod | 27 +++++----- extension/observer/cfgardenobserver/go.sum | 58 +++++++++++----------- 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index b822e894f540..00a98b1be6e5 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -3,19 +3,19 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/obser go 1.22.0 require ( - code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb + code.cloudfoundry.org/garden v0.0.0-20240813204544-f3b1f29b4fca github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.107.0 github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/component v0.107.1-0.20240816132030-9fd84668bb02 - go.opentelemetry.io/collector/confmap v0.107.1-0.20240816132030-9fd84668bb02 - go.opentelemetry.io/collector/extension v0.107.1-0.20240816132030-9fd84668bb02 + go.opentelemetry.io/collector/component v0.107.0 + go.opentelemetry.io/collector/confmap v0.107.0 + go.opentelemetry.io/collector/extension v0.107.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) require ( - code.cloudfoundry.org/lager/v3 v3.0.3 // indirect + code.cloudfoundry.org/lager/v3 v3.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -25,9 +25,9 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect - github.com/go-viper/mapstructure/v2 v2.1.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect + github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -38,7 +38,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.11 // indirect - github.com/onsi/ginkgo/v2 v2.19.0 // indirect + github.com/onsi/ginkgo/v2 v2.20.0 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -47,7 +47,6 @@ require ( github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/tedsuo/rata v1.0.0 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.0.0-20240731165531-6d32c09daf9f // indirect go.opentelemetry.io/collector/config/configtelemetry v0.107.0 // indirect go.opentelemetry.io/collector/featuregate v1.13.0 // indirect go.opentelemetry.io/collector/internal/globalgates v0.107.0 // indirect @@ -59,15 +58,13 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect go.opentelemetry.io/otel/trace v1.28.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.27.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sys v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect - golang.org/x/tools v0.23.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer => ../ diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index ed297745dbfc..96e295549f0d 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -1,7 +1,7 @@ -code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb h1:DIWMTi2IdpmDCttJS4QSvICxmzW9ZsPSRRoUFRtRQJ0= -code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb/go.mod h1:U64KFt+62i7ZEODWue1CUv61XbKGlpNXG3ICA9SNA4E= -code.cloudfoundry.org/lager/v3 v3.0.3 h1:/UTmadZfIaKuT/whEinSxK1mzRfNu1uPfvjFfGqiwzM= -code.cloudfoundry.org/lager/v3 v3.0.3/go.mod h1:Zn5q1SrIuuHjEUE7xerMKt3ztunrJQCZETAo7rV0CH8= +code.cloudfoundry.org/garden v0.0.0-20240813204544-f3b1f29b4fca h1:p7DMt8WAKNV5Go4kvnpMQrmAt/yWFWx8bB0Oc2XX/cA= +code.cloudfoundry.org/garden v0.0.0-20240813204544-f3b1f29b4fca/go.mod h1:Jyr4jeFSMuUkdMz+yshtD9b1le4wFHQBxsrhlFkmxME= +code.cloudfoundry.org/lager/v3 v3.1.0 h1:ZB4VXLSI0bIWhDSjKdEh/Jrs2SXFLX/9+z2WEZhAf2o= +code.cloudfoundry.org/lager/v3 v3.1.0/go.mod h1:5KBxqCSNJBNf/RXCindvnyAKBWxTgMMO5mtn1qkMoEM= 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/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= @@ -26,14 +26,14 @@ github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab h1:xveKWz2iauee github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= -github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= +github.com/go-viper/mapstructure/v2 v2.0.0/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/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/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= -github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= @@ -62,10 +62,12 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= -github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= -github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= -github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= +github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.107.0 h1:TDiOlJ+AQzJXaP4YBg7H3vRM2MfcXNk38XnzN7ZlWmg= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.107.0/go.mod h1:s+suO5v6PkeVZHpiME1vOoiMSbKpbSFDW6HQhKsFkn8= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= @@ -92,16 +94,14 @@ github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.107.1-0.20240816132030-9fd84668bb02 h1:LLWhq5h/z7JdxeMIqKs49oc+xd+7oyqpnbgfFAw1L9c= -go.opentelemetry.io/collector/component v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:dJbbK7+PLB4qvX1pboKyBnpRimGCV4qFJemPiLO4rdo= -go.opentelemetry.io/collector/component/componentstatus v0.0.0-20240731165531-6d32c09daf9f h1:VuVQ+G0e7HqXTFoGbLfyXUnX2+6dieyxNNE8ITJrBX8= -go.opentelemetry.io/collector/component/componentstatus v0.0.0-20240731165531-6d32c09daf9f/go.mod h1:og4XLcnY0wAMtUK+xd2ZFexQnH5Io3AhJx0SPQLmv2Q= +go.opentelemetry.io/collector/component v0.107.0 h1:3ReaEAtKwrPj7HrlKjEGBDKbBaxdRMPC2mfZ9b6zjXE= +go.opentelemetry.io/collector/component v0.107.0/go.mod h1:1xMIYKvpnP7laipjgEw7kq1ozG7ySLkA0Evhr2Bp8M4= go.opentelemetry.io/collector/config/configtelemetry v0.107.0 h1:pSGd4FWQ/Up/Af+XZTR8JNneH/wmQ/TAU4Z16JHQeUc= go.opentelemetry.io/collector/config/configtelemetry v0.107.0/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/confmap v0.107.1-0.20240816132030-9fd84668bb02 h1:ebDK+CmU+bGm5T/hAao09vxc4SG6+qQgSuRvDGjzFyY= -go.opentelemetry.io/collector/confmap v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:3ybd6KEP2x4PcfFhrrEX86b4Y9dk6uBgFgMgK1Rc+aE= -go.opentelemetry.io/collector/extension v0.107.1-0.20240816132030-9fd84668bb02 h1:uuTR9a4mj3vPboCCivieIYa4FMfvyo+ZyqEGF1h6jkY= -go.opentelemetry.io/collector/extension v0.107.1-0.20240816132030-9fd84668bb02/go.mod h1:eH5yJAfY31Bb4x92siOxf/YVgjurqfAStDkMwlHgFZs= +go.opentelemetry.io/collector/confmap v0.107.0 h1:M2o7jvQM9bnMU3pE2N6BK4KHYtSnvsSZkegUD89y8BU= +go.opentelemetry.io/collector/confmap v0.107.0/go.mod h1:9Fs/ZEIeiMa38VqkqIpn+JKQkcPf/lhAKA9fHu6c9GY= +go.opentelemetry.io/collector/extension v0.107.0 h1:wstZXb24RwdcchZu3juTH9M0xryKG4sYmb1/w6J3tqQ= +go.opentelemetry.io/collector/extension v0.107.0/go.mod h1:w/+HXzRO7jPutUIMyBlzX6deUPl205QCEwteB0YgWOg= go.opentelemetry.io/collector/featuregate v1.13.0 h1:rc84eCf5hesXQ8/bP6Zc15wqthbomfLBHmox5tT7AwM= go.opentelemetry.io/collector/featuregate v1.13.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= go.opentelemetry.io/collector/internal/globalgates v0.107.0 h1:PaD6WgQg80YTVxg8OF+YEqgI7WRd13wMu/R6GIG7uNU= @@ -129,14 +129,16 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= 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= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= +golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= 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/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -146,18 +148,18 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220908164124-27713097b956/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/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.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.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/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.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= 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= From f1cfb86372fa76b4989f1a2f542a1bdbf3d3ecc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 29 Aug 2024 14:18:47 +0100 Subject: [PATCH 18/32] [extensions/observer/cfgardenobserver] tidy --- cmd/otelcontribcol/go.mod | 16 ++++--- cmd/otelcontribcol/go.sum | 38 +++++++++------- extension/observer/cfgardenobserver/go.mod | 27 +++++++++-- extension/observer/cfgardenobserver/go.sum | 53 +++++++++++++++------- 4 files changed, 91 insertions(+), 43 deletions(-) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 3f385ba67528..ad9c612f36b7 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -257,10 +257,10 @@ require ( cloud.google.com/go/spanner v1.67.0 // indirect cloud.google.com/go/trace v1.10.11 // indirect code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c // indirect - code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb // indirect + code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1 // indirect code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c // indirect code.cloudfoundry.org/go-loggregator v7.4.0+incompatible // indirect - code.cloudfoundry.org/lager/v3 v3.0.3 // indirect + code.cloudfoundry.org/lager/v3 v3.3.0 // indirect code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -520,7 +520,7 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect + github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect github.com/google/s2a-go v0.1.8 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect @@ -630,7 +630,7 @@ require ( github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/nginxinc/nginx-prometheus-exporter v0.11.0 // indirect github.com/oklog/ulid/v2 v2.1.0 // indirect - github.com/onsi/ginkgo/v2 v2.19.0 // indirect + github.com/onsi/ginkgo/v2 v2.20.2 // indirect github.com/open-telemetry/opamp-go v0.15.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.108.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.108.0 // indirect @@ -745,6 +745,8 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.991 // indirect github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.17.3 // indirect github.com/tidwall/match v1.1.1 // indirect @@ -827,15 +829,15 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.26.0 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/mod v0.19.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect + golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/term v0.23.0 // indirect golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.6.0 // indirect - golang.org/x/tools v0.23.0 // indirect + golang.org/x/tools v0.24.0 // indirect golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/api v0.194.0 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 20a17cb9124f..b67c8e2b29c7 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -621,14 +621,14 @@ cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c h1:5eeuG0BHx1+DHeT3AP+ISKZ2ht1UjGhm581ljqYpVeQ= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= -code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb h1:DIWMTi2IdpmDCttJS4QSvICxmzW9ZsPSRRoUFRtRQJ0= -code.cloudfoundry.org/garden v0.0.0-20240711201323-3e0daa304ebb/go.mod h1:U64KFt+62i7ZEODWue1CUv61XbKGlpNXG3ICA9SNA4E= +code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1 h1:N3ewws9VoYuHYi0cPKzpCMH5ZwjtI93mkuKxu+ufI5I= +code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1/go.mod h1:TWwWzXYhH7hrazAmPC14mKCRTs/9UumBQvqXOBY/leA= code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c h1:N2GMlHc/SJQk7BkaME/kDHaciVTy4NuRmxVJLhnqKK8= code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c/go.mod h1:o7lq/SmHshDVxHdRJ/fMT3VPcoXyE1HcRXbG8QibO3k= code.cloudfoundry.org/go-loggregator v7.4.0+incompatible h1:KqZYloMQWM5Zg/BQKunOIA4OODh7djZbk48qqbowNFI= code.cloudfoundry.org/go-loggregator v7.4.0+incompatible/go.mod h1:KPBTRqj+y738Nhf1+g4JHFaBU8j7dedirR5ETNHvMXU= -code.cloudfoundry.org/lager/v3 v3.0.3 h1:/UTmadZfIaKuT/whEinSxK1mzRfNu1uPfvjFfGqiwzM= -code.cloudfoundry.org/lager/v3 v3.0.3/go.mod h1:Zn5q1SrIuuHjEUE7xerMKt3ztunrJQCZETAo7rV0CH8= +code.cloudfoundry.org/lager/v3 v3.3.0 h1:adWGo2aBLpHVfUG+3D2FQ4B6Mf2Bcz47KITbn8V4b0k= +code.cloudfoundry.org/lager/v3 v3.3.0/go.mod h1:k/AYgZTVrwQaneNfQ2EwnZxUb9iUFE7i6AJ3KVOtAdE= code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 h1:mrZQaZmuDIPhSp6b96b+CRKC2uH44ifa5cjDV2epKis= code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78/go.mod h1:tkZo8GtzBjySJ7USvxm4E36lNQw1D3xM6oKHGqdaAJ4= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= @@ -1531,8 +1531,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= -github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= @@ -1982,16 +1982,16 @@ github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvw github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= -github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +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 v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= -github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +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/opamp-go v0.15.0 h1:X2TWhEsGQ8GP7Uos3Ic9v/1aFUqoECZXKS7xAF5HqsA= github.com/open-telemetry/opamp-go v0.15.0/go.mod h1:QyPeN56JXlcZt5yG5RMdZ50Ju+zMFs1Ihy/hwHyF8Oo= github.com/open-telemetry/otel-arrow v0.25.0 h1:jqkG+ZFJ+HT7jSkC3LtlXSX5QfSqg8rmg2LJy4CEe1M= @@ -2255,6 +2255,12 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.991 h1:0Xg2IUktDgGsjBv82WTmTQdHZFRwS2XDUnuOHexCxVw= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.991/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/testcontainers/testcontainers-go v0.33.0 h1:zJS9PfXYT5O0ZFXM2xxXfk4J5UMw/kRiISng037Gxdw= +github.com/testcontainers/testcontainers-go v0.33.0/go.mod h1:W80YpTa8D5C3Yy16icheD01UTDu+LmXIA2Keo+jWtT8= github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= github.com/tg123/go-htpasswd v1.2.2/go.mod h1:FcIrK0J+6zptgVwK1JDlqyajW/1B4PtuJ/FLWl7nx8A= github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -2589,8 +2595,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -2634,8 +2640,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -3014,8 +3020,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= 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.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= 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= diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index e9df2b7db2c2..57c2070f0326 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -3,6 +3,8 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/obser go 1.22.0 require ( + code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1 + github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.108.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.108.1 @@ -13,7 +15,7 @@ require ( ) require ( - code.cloudfoundry.org/lager/v3 v3.1.0 // indirect + code.cloudfoundry.org/lager/v3 v3.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -23,9 +25,9 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect + github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect github.com/google/uuid v1.6.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -36,13 +38,30 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.11 // indirect - github.com/onsi/ginkgo/v2 v2.20.0 // indirect + github.com/onsi/ginkgo/v2 v2.20.2 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/pmezard/go-difflib v1.0.0 // 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 + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect + go.opentelemetry.io/collector/pdata v1.14.1 // indirect + go.opentelemetry.io/otel v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.50.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/metric v1.28.0 // indirect + go.opentelemetry.io/otel/trace v1.28.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index 7b156dd872ff..c6a3fa5d4970 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -1,7 +1,7 @@ -code.cloudfoundry.org/garden v0.0.0-20240813204544-f3b1f29b4fca h1:p7DMt8WAKNV5Go4kvnpMQrmAt/yWFWx8bB0Oc2XX/cA= -code.cloudfoundry.org/garden v0.0.0-20240813204544-f3b1f29b4fca/go.mod h1:Jyr4jeFSMuUkdMz+yshtD9b1le4wFHQBxsrhlFkmxME= -code.cloudfoundry.org/lager/v3 v3.1.0 h1:ZB4VXLSI0bIWhDSjKdEh/Jrs2SXFLX/9+z2WEZhAf2o= -code.cloudfoundry.org/lager/v3 v3.1.0/go.mod h1:5KBxqCSNJBNf/RXCindvnyAKBWxTgMMO5mtn1qkMoEM= +code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1 h1:N3ewws9VoYuHYi0cPKzpCMH5ZwjtI93mkuKxu+ufI5I= +code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1/go.mod h1:TWwWzXYhH7hrazAmPC14mKCRTs/9UumBQvqXOBY/leA= +code.cloudfoundry.org/lager/v3 v3.3.0 h1:adWGo2aBLpHVfUG+3D2FQ4B6Mf2Bcz47KITbn8V4b0k= +code.cloudfoundry.org/lager/v3 v3.3.0/go.mod h1:k/AYgZTVrwQaneNfQ2EwnZxUb9iUFE7i6AJ3KVOtAdE= 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/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= @@ -26,14 +26,14 @@ github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab h1:xveKWz2iauee github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= -github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/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/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/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= -github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= 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/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -49,6 +49,11 @@ github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkX 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/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 h1:YFh+sjyJTMQSYjKwM4dFKhJPJC/wfo98tPUc17HdoYw= +github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11/go.mod h1:Ah2dBMoxZEqk118as2T4u4fjfXarE0pPnMJaArZQZsI= 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= @@ -59,12 +64,12 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.20.0 h1:PE84V2mHqoT1sglvHc8ZdQtPcwmvvt29WLEEO3xmdZw= -github.com/onsi/ginkgo/v2 v2.20.0/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= -github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.107.0 h1:TDiOlJ+AQzJXaP4YBg7H3vRM2MfcXNk38XnzN7ZlWmg= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.107.0/go.mod h1:s+suO5v6PkeVZHpiME1vOoiMSbKpbSFDW6HQhKsFkn8= +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/extension/observer v0.108.0 h1:zs0lLwZlCueFLU6J4Q70vn9skWTlTp2H6m78v6ZhPKY= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.108.0/go.mod h1:betAqGGfDFb8SLyMYBwH9BQyB9wzxWOWXXC/Ht6/kas= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= @@ -90,6 +95,19 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8 github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector/component v0.108.1 h1:X+Afj07brX0NC36t6PvAq+ehaeUO/Q9eJNOUwhInpeY= +go.opentelemetry.io/collector/component v0.108.1/go.mod h1:qrP2TiJT5qw4sSiAKne+gb+hb1qTixLXuQRZjMCnLjY= +go.opentelemetry.io/collector/component/componentstatus v0.108.1 h1:63B7/TsZ1wIT+JFopOAAvyM8GaWDyJQncQ/G12HR334= +go.opentelemetry.io/collector/component/componentstatus v0.108.1/go.mod h1:PAJmG8ip5gvEtJ9uPpLtVmwnxtjA8t4MmEbzg6nQxVs= +go.opentelemetry.io/collector/config/configtelemetry v0.108.1 h1:jjdH1R6FMz4l1nSvY7F3H0F09xW9LKTke7k3ZAPcmSU= +go.opentelemetry.io/collector/config/configtelemetry v0.108.1/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/confmap v1.14.1 h1:GPMa+q5ThiBFQaYKJ7xeomiw9tIokkTA1AiF1zwKJck= +go.opentelemetry.io/collector/confmap v1.14.1/go.mod h1:GrIZ12P/9DPOuTpe2PIS51a0P/ZM6iKtByVee1Uf3+k= +go.opentelemetry.io/collector/extension v0.108.1 h1:XNQ9bOegD38gktyLJXlGN2Wb6AbiBi2nAuiOIdg+zA0= +go.opentelemetry.io/collector/extension v0.108.1/go.mod h1:fZE5j4jL9XVbm4H53gj9y/VDhP/5assmZ4yU0EwSjBc= +go.opentelemetry.io/collector/pdata v1.14.1 h1:wXZjtQA7Vy5HFqco+yA95ENyMQU5heBB1IxMHQf6mUk= +go.opentelemetry.io/collector/pdata v1.14.1/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= 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/prometheus v0.50.0 h1:2Ewsda6hejmbhGFyUvWZjUThC98Cf8Zy6g0zkIimOng= @@ -111,8 +129,6 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= 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= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -127,6 +143,11 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ 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/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.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.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= From 83e21508a1e8adab8e5c90dea173db137a85c79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 29 Aug 2024 14:23:31 +0100 Subject: [PATCH 19/32] [extensions/observer/cfgardenobserver] Rename loadConf to loadRawConf --- extension/observer/cfgardenobserver/config_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension/observer/cfgardenobserver/config_test.go b/extension/observer/cfgardenobserver/config_test.go index 358c9842f10e..1822706aa125 100644 --- a/extension/observer/cfgardenobserver/config_test.go +++ b/extension/observer/cfgardenobserver/config_test.go @@ -190,7 +190,7 @@ func TestConfigValidate(t *testing.T) { } } -func loadConf(t testing.TB, path string, id component.ID) *confmap.Conf { +func loadRawConf(t testing.TB, path string, id component.ID) *confmap.Conf { cm, err := confmaptest.LoadConf(filepath.Join("testdata", path)) require.NoError(t, err) sub, err := cm.Sub(id.String()) @@ -201,7 +201,7 @@ func loadConf(t testing.TB, path string, id component.ID) *confmap.Conf { func loadConfig(t testing.TB, id component.ID) *Config { factory := NewFactory() cfg := factory.CreateDefaultConfig() - sub := loadConf(t, "config.yaml", id) + sub := loadRawConf(t, "config.yaml", id) require.NoError(t, sub.Unmarshal(cfg)) return cfg.(*Config) } From cfd4f1e932b1588f395930eedfda8981cc945fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 29 Aug 2024 14:46:37 +0100 Subject: [PATCH 20/32] [extensions/observer/cfgardenobserver] crosslink --- extension/observer/cfgardenobserver/go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 57c2070f0326..b65fabe10ec3 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -67,3 +67,5 @@ require ( google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer => ../ From 545ff7fa5f4d91d17f8dceb4a9feb73580bcc062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Fri, 30 Aug 2024 08:33:21 +0100 Subject: [PATCH 21/32] [extensions/observer/cfgardenobserver] gotidy --- extension/observer/cfgardenobserver/go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index c6a3fa5d4970..970564d1a8f9 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -68,8 +68,6 @@ 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/extension/observer v0.108.0 h1:zs0lLwZlCueFLU6J4Q70vn9skWTlTp2H6m78v6ZhPKY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.108.0/go.mod h1:betAqGGfDFb8SLyMYBwH9BQyB9wzxWOWXXC/Ht6/kas= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= From 0ffef6a7704cfd88842fbd5829f381debf8934b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Mon, 2 Sep 2024 09:50:32 +0100 Subject: [PATCH 22/32] [extensions/observer/cfgardenobserver] add auth section under cloud_foundry --- extension/observer/cfgardenobserver/README.md | 37 ++++++------ extension/observer/cfgardenobserver/config.go | 29 +++++---- .../observer/cfgardenobserver/config_test.go | 60 ++++++++++++------- .../observer/cfgardenobserver/extension.go | 8 +-- .../cfgardenobserver/testdata/config.yaml | 30 ++++++---- 5 files changed, 96 insertions(+), 68 deletions(-) diff --git a/extension/observer/cfgardenobserver/README.md b/extension/observer/cfgardenobserver/README.md index fb88d08c114f..737a76b63838 100644 --- a/extension/observer/cfgardenobserver/README.md +++ b/extension/observer/cfgardenobserver/README.md @@ -27,9 +27,10 @@ extensions: endpoint: my/path/to/garden.sock cloud_foundry: endpoint: https://api.cf.mydomain.com - auth_type: client_credentials - client_id: myclientid - client_secret: myclientsecret + auth: + type: client_credentials + client_id: myclientid + client_secret: myclientsecret receivers: receiver_creator: @@ -43,20 +44,22 @@ receivers: ``` ### Configuration -| Name | Type | Default | Description | -| --------------------------- | ------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------ | -| refresh_interval | string | 1m | Determines how often to look for changes in endpoints. | -| cache_sync_interval | string | 5m | Determines how often app metadata cache is refreshed | -| include_app_labels | bool | false | Determines whether or not app labels get added to container labels | -| garden.endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | -| cloud_foundry.endpoint | string | none. required when `include_app_labels` is set to `true` | CloudFoundry API endpoint | -| cloud_foundry.auth_type | string | none. required when `include_app_labels` is set to `true` | Authentication type, one of: user_pass, client_credentials, token | -| cloud_foundry.username | string | none. | Username (auth_type: user_pass) | -| cloud_foundry.password | string | none | Password (auth_type: user_pass) | -| cloud_foundry.client_id | string | none | Client ID (auth_type: client_credentials) | -| cloud_foundry.client_secret | string | none | Client Secret (auth_type: client_credentials) | -| cloud_foundry.access_token | string | none | Access Token (auth_type: token) | -| cloud_foundry.refresh_token | string | none | Refresh Token (auth_type: token) | + +| Name | Type | Default | Description | +| -------------------------------- | ------ | --------------------------------------------------------- | ------------------------------------------------------------------ | +| refresh_interval | string | 1m | Determines how often to look for changes in endpoints. | +| cache_sync_interval | string | 5m | Determines how often app metadata cache is refreshed | +| include_app_labels | bool | false | Determines whether or not app labels get added to container labels | +| garden.endpoint | string | /var/vcap/data/garden/garden.sock | Path to garden socket. | +| cloud_foundry.endpoint | string | none. required when `include_app_labels` is set to `true` | CloudFoundry API endpoint | +| cloud_foundry.auth.type | string | none. required when `include_app_labels` is set to `true` | Authentication type, one of: user_pass, client_credentials, token | +| cloud_foundry.auth.username | string | none | Username (auth.type: user_pass) | +| cloud_foundry.auth.password | string | none | Password (auth.type: user_pass) | +| cloud_foundry.auth.client_id | string | none | Client ID (auth.type: client_credentials) | +| cloud_foundry.auth.client_secret | string | none | Client Secret (auth.type: client_credentials) | +| cloud_foundry.auth.access_token | string | none | Access Token (auth.type: token) | +| cloud_foundry.auth.refresh_token | string | none | Refresh Token (auth.type: token) | + ### Endpoint Variables diff --git a/extension/observer/cfgardenobserver/config.go b/extension/observer/cfgardenobserver/config.go index ac561531fdec..ae145cff7936 100644 --- a/extension/observer/cfgardenobserver/config.go +++ b/extension/observer/cfgardenobserver/config.go @@ -42,36 +42,36 @@ func (config *Config) Validate() error { c := config.CloudFoundry if c.Endpoint == "" { - return errors.New("config.Endpoint must be specified when include_app_labels is set to true") + return errors.New("CloudFoundry.Endpoint must be specified when IncludeAppLabels is set to true") } - if c.AuthType == "" { - return errors.New("config.authType must be specified when include_app_labels is set to true") + if c.Auth.Type == "" { + return errors.New("CloudFoundry.Auth.Type must be specified when IncludeAppLabels is set to true") } - switch c.AuthType { + switch c.Auth.Type { case authTypeUserPass: - if c.Username == "" { + if c.Auth.Username == "" { return fieldError(authTypeUserPass, "username") } - if c.Password == "" { + if c.Auth.Password == "" { return fieldError(authTypeUserPass, "password") } case authTypeClientCredentials: - if c.ClientID == "" { + if c.Auth.ClientID == "" { return fieldError(authTypeClientCredentials, "client_id") } - if c.ClientSecret == "" { + if c.Auth.ClientSecret == "" { return fieldError(authTypeClientCredentials, "client_secret") } case authTypeToken: - if c.AccessToken == "" { + if c.Auth.AccessToken == "" { return fieldError(authTypeToken, "access_token") } - if c.RefreshToken == "" { + if c.Auth.RefreshToken == "" { return fieldError(authTypeToken, "refresh_token") } default: - return fmt.Errorf("configuration option `auth_type` must be set to one of the following values: [user_pass, client_credentials, token]. Specified value: %s", c.AuthType) + return fmt.Errorf("configuration option `auth_type` must be set to one of the following values: [user_pass, client_credentials, token]. Specified value: %s", c.Auth.Type) } return nil @@ -90,8 +90,13 @@ type CfConfig struct { // The URL of the CloudFoundry API Endpoint string `mapstructure:"endpoint"` + // Authentication details + Auth CfAuth `mapstructure:"auth"` +} + +type CfAuth struct { // Authentication method, there are 3 options - AuthType authType `mapstructure:"auth_type"` + Type authType `mapstructure:"type"` // Used for user_pass authentication method Username string `mapstructure:"username"` diff --git a/extension/observer/cfgardenobserver/config_test.go b/extension/observer/cfgardenobserver/config_test.go index 1822706aa125..d3cd919a06e9 100644 --- a/extension/observer/cfgardenobserver/config_test.go +++ b/extension/observer/cfgardenobserver/config_test.go @@ -46,9 +46,11 @@ func TestLoadConfig(t *testing.T) { }, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: "user_pass", - Username: "myuser", - Password: "mypass", + Auth: CfAuth{ + Type: "user_pass", + Username: "myuser", + Password: "mypass", + }, }, }, }, @@ -63,9 +65,11 @@ func TestLoadConfig(t *testing.T) { IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: "user_pass", - Username: "myuser", - Password: "mypass", + Auth: CfAuth{ + Type: "user_pass", + Username: "myuser", + Password: "mypass", + }, }, }, }, @@ -79,10 +83,12 @@ func TestLoadConfig(t *testing.T) { CacheSyncInterval: 5 * time.Minute, IncludeAppLabels: true, CloudFoundry: CfConfig{ - Endpoint: "https://api.cf.mydomain.com", - AuthType: "client_credentials", - ClientID: "myclientid", - ClientSecret: "myclientsecret", + Endpoint: "https://api.cf.mydomain.com", + Auth: CfAuth{ + Type: "client_credentials", + ClientID: "myclientid", + ClientSecret: "myclientsecret", + }, }, }, }, @@ -96,10 +102,12 @@ func TestLoadConfig(t *testing.T) { CacheSyncInterval: 5 * time.Minute, IncludeAppLabels: true, CloudFoundry: CfConfig{ - Endpoint: "https://api.cf.mydomain.com", - AuthType: "token", - AccessToken: "myaccesstoken", - RefreshToken: "myrefreshtoken", + Endpoint: "https://api.cf.mydomain.com", + Auth: CfAuth{ + Type: "token", + AccessToken: "myaccesstoken", + RefreshToken: "myrefreshtoken", + }, }, }, }, @@ -124,25 +132,27 @@ func TestConfigValidate(t *testing.T) { cfg: Config{ IncludeAppLabels: true, }, - msg: "config.Endpoint must be specified when include_app_labels is set to true", + msg: "CloudFoundry.Endpoint must be specified when IncludeAppLabels is set to true", }, { - reason: "missing auth_type", + reason: "missing cloud_foundry.auth.type", cfg: Config{ IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", }, }, - msg: "config.authType must be specified when include_app_labels is set to true", + msg: "CloudFoundry.Auth.Type must be specified when IncludeAppLabels is set to true", }, { - reason: "unknown auth_type", + reason: "unknown cloud_foundry.auth.type", cfg: Config{ IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: "unknown", + Auth: CfAuth{ + Type: "unknown", + }, }, }, msg: "configuration option `auth_type` must be set to one of the following values: [user_pass, client_credentials, token]. Specified value: unknown", @@ -153,7 +163,9 @@ func TestConfigValidate(t *testing.T) { IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: authTypeUserPass, + Auth: CfAuth{ + Type: authTypeUserPass, + }, }, }, msg: fieldError(authTypeUserPass, "username").Error(), @@ -164,7 +176,9 @@ func TestConfigValidate(t *testing.T) { IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: authTypeClientCredentials, + Auth: CfAuth{ + Type: authTypeClientCredentials, + }, }, }, msg: fieldError(authTypeClientCredentials, "client_id").Error(), @@ -175,7 +189,9 @@ func TestConfigValidate(t *testing.T) { IncludeAppLabels: true, CloudFoundry: CfConfig{ Endpoint: "https://api.cf.mydomain.com", - AuthType: authTypeToken, + Auth: CfAuth{ + Type: authTypeToken, + }, }, }, msg: fieldError(authTypeToken, "access_token").Error(), diff --git a/extension/observer/cfgardenobserver/extension.go b/extension/observer/cfgardenobserver/extension.go index 0d71dd53d784..5e247ab19a1e 100644 --- a/extension/observer/cfgardenobserver/extension.go +++ b/extension/observer/cfgardenobserver/extension.go @@ -306,13 +306,13 @@ func newCfClient(cfConfig CfConfig) (*client.Client, error) { var cfg *config.Config var err error - switch cfConfig.AuthType { + switch cfConfig.Auth.Type { case authTypeUserPass: - cfg, err = config.New(cfConfig.Endpoint, config.UserPassword(cfConfig.Username, cfConfig.Password)) + cfg, err = config.New(cfConfig.Endpoint, config.UserPassword(cfConfig.Auth.Username, cfConfig.Auth.Password)) case authTypeClientCredentials: - cfg, err = config.New(cfConfig.Endpoint, config.ClientCredentials(cfConfig.ClientID, cfConfig.ClientSecret)) + cfg, err = config.New(cfConfig.Endpoint, config.ClientCredentials(cfConfig.Auth.ClientID, cfConfig.Auth.ClientSecret)) case authTypeToken: - cfg, err = config.New(cfConfig.Endpoint, config.Token(cfConfig.AccessToken, cfConfig.RefreshToken)) + cfg, err = config.New(cfConfig.Endpoint, config.Token(cfConfig.Auth.AccessToken, cfConfig.Auth.RefreshToken)) } if err != nil { diff --git a/extension/observer/cfgardenobserver/testdata/config.yaml b/extension/observer/cfgardenobserver/testdata/config.yaml index 252ce25aa916..b8d9502727f7 100644 --- a/extension/observer/cfgardenobserver/testdata/config.yaml +++ b/extension/observer/cfgardenobserver/testdata/config.yaml @@ -3,30 +3,34 @@ cfgarden_observer/all_settings: refresh_interval: 20s include_app_labels: true garden: - endpoint: /var/vcap/data/garden/custom.sock + endpoint: /var/vcap/data/garden/custom.sock cloud_foundry: endpoint: https://api.cf.mydomain.com - auth_type: user_pass - username: myuser - password: mypass + auth: + type: user_pass + username: myuser + password: mypass cfgarden_observer/user_pass: include_app_labels: true cloud_foundry: endpoint: https://api.cf.mydomain.com - auth_type: user_pass - username: myuser - password: mypass + auth: + type: user_pass + username: myuser + password: mypass cfgarden_observer/client_credentials: include_app_labels: true cloud_foundry: endpoint: https://api.cf.mydomain.com - auth_type: client_credentials - client_id: myclientid - client_secret: myclientsecret + auth: + type: client_credentials + client_id: myclientid + client_secret: myclientsecret cfgarden_observer/token: include_app_labels: true cloud_foundry: endpoint: https://api.cf.mydomain.com - auth_type: token - access_token: myaccesstoken - refresh_token: myrefreshtoken + auth: + type: token + access_token: myaccesstoken + refresh_token: myrefreshtoken From 98e7a50024df44499c770e2b13f021e75a6dc755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Mon, 2 Sep 2024 09:52:15 +0100 Subject: [PATCH 23/32] [extensions/observer/cfgardenobserver] remove example from config comments --- extension/observer/cfgardenobserver/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/observer/cfgardenobserver/config.go b/extension/observer/cfgardenobserver/config.go index ae145cff7936..67085def9fe3 100644 --- a/extension/observer/cfgardenobserver/config.go +++ b/extension/observer/cfgardenobserver/config.go @@ -23,7 +23,7 @@ type Config struct { RefreshInterval time.Duration `mapstructure:"refresh_interval"` // The time to wait before resyncing app information on cached containers - // using the CloudFoundry API. Example: cache_sync_interval: "20m" + // using the CloudFoundry API. // Default: "5m" CacheSyncInterval time.Duration `mapstructure:"cache_sync_interval"` From 3c30e476143d72f05f2c21c2f80b6a144596640b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Mon, 2 Sep 2024 10:03:26 +0100 Subject: [PATCH 24/32] [extensions/observer/cfgardenobserver] Go tidy --- extension/observer/cfgardenobserver/go.mod | 19 ++++++++++++++++++ extension/observer/cfgardenobserver/go.sum | 23 ++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 4afc94bde2e5..55d82f0be3fe 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -43,6 +43,25 @@ require ( github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.20.2 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.56.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect + go.opentelemetry.io/collector/pdata v1.14.1 // indirect + go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.51.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/metric v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect google.golang.org/grpc v1.65.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index 0ff425df234b..513862941296 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -96,16 +96,16 @@ 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/collector/component v0.108.2-0.20240829190554-7da6b618a7ee h1:huxxQgE9nyBcwUtiJaJFTupk0MhXsy8Y3ZclJ0mCREY= go.opentelemetry.io/collector/component v0.108.2-0.20240829190554-7da6b618a7ee/go.mod h1:Z9M91arav1Mf67csQf2484IMUx5a++4oAlikGM28AoI= -go.opentelemetry.io/collector/component/componentstatus v0.108.2-0.20240829190554-7da6b618a7ee h1:SsH8uYXHWWLJRnolMW3i4EisxTkm3AQk16hPcakBvTw= -go.opentelemetry.io/collector/component/componentstatus v0.108.2-0.20240829190554-7da6b618a7ee/go.mod h1:QcQ4vrW+Z04cg7bvVuAufet3piiZv2+0ugWcLeuMfz4= -go.opentelemetry.io/collector/config/configtelemetry v0.108.2-0.20240829190554-7da6b618a7ee h1:LGoJWO9fANov2zNgtX4uYuH6YI4p+H0I/PbY2S+9wLk= -go.opentelemetry.io/collector/config/configtelemetry v0.108.2-0.20240829190554-7da6b618a7ee/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/component/componentstatus v0.108.1 h1:63B7/TsZ1wIT+JFopOAAvyM8GaWDyJQncQ/G12HR334= +go.opentelemetry.io/collector/component/componentstatus v0.108.1/go.mod h1:PAJmG8ip5gvEtJ9uPpLtVmwnxtjA8t4MmEbzg6nQxVs= +go.opentelemetry.io/collector/config/configtelemetry v0.108.1 h1:jjdH1R6FMz4l1nSvY7F3H0F09xW9LKTke7k3ZAPcmSU= +go.opentelemetry.io/collector/config/configtelemetry v0.108.1/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= go.opentelemetry.io/collector/confmap v1.14.2-0.20240829190554-7da6b618a7ee h1:+AZ6R3DhcUGDVQVya18ZVoZK863f8a1LXhHBq9TKkuw= go.opentelemetry.io/collector/confmap v1.14.2-0.20240829190554-7da6b618a7ee/go.mod h1:GrIZ12P/9DPOuTpe2PIS51a0P/ZM6iKtByVee1Uf3+k= go.opentelemetry.io/collector/extension v0.108.2-0.20240829190554-7da6b618a7ee h1:yuy6iGp41ARpBTR3E0IjwbJNps4me7QBlViAXIT00Xs= go.opentelemetry.io/collector/extension v0.108.2-0.20240829190554-7da6b618a7ee/go.mod h1:0Ialf9Lc/ESknUYJnAeQjGdQvlhLtJav0sv+Eo2xMnU= -go.opentelemetry.io/collector/pdata v1.14.2-0.20240829190554-7da6b618a7ee h1:vqnRTZckt4i+bGcR+d/LAOAe4nAAs/KkN2L2CTXvW0Q= -go.opentelemetry.io/collector/pdata v1.14.2-0.20240829190554-7da6b618a7ee/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= +go.opentelemetry.io/collector/pdata v1.14.1 h1:wXZjtQA7Vy5HFqco+yA95ENyMQU5heBB1IxMHQf6mUk= +go.opentelemetry.io/collector/pdata v1.14.1/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= 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/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= @@ -133,6 +133,17 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +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.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +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/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 758da683067b6b19b99c9841aca9ce24216e2d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Mon, 2 Sep 2024 11:34:20 +0100 Subject: [PATCH 25/32] [extensions/observer/cfgardenobserver] Go tidy --- extension/observer/cfgardenobserver/go.mod | 4 ++-- extension/observer/cfgardenobserver/go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 55d82f0be3fe..c083381c0deb 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -48,8 +48,8 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/tedsuo/rata v1.0.0 // indirect go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect - go.opentelemetry.io/collector/pdata v1.14.1 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.108.2-0.20240829190554-7da6b618a7ee // indirect + go.opentelemetry.io/collector/pdata v1.14.2-0.20240829190554-7da6b618a7ee // indirect go.opentelemetry.io/otel v1.29.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.51.0 // indirect go.opentelemetry.io/otel/metric v1.29.0 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index 513862941296..0375b27a52ce 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -98,14 +98,14 @@ go.opentelemetry.io/collector/component v0.108.2-0.20240829190554-7da6b618a7ee h go.opentelemetry.io/collector/component v0.108.2-0.20240829190554-7da6b618a7ee/go.mod h1:Z9M91arav1Mf67csQf2484IMUx5a++4oAlikGM28AoI= go.opentelemetry.io/collector/component/componentstatus v0.108.1 h1:63B7/TsZ1wIT+JFopOAAvyM8GaWDyJQncQ/G12HR334= go.opentelemetry.io/collector/component/componentstatus v0.108.1/go.mod h1:PAJmG8ip5gvEtJ9uPpLtVmwnxtjA8t4MmEbzg6nQxVs= -go.opentelemetry.io/collector/config/configtelemetry v0.108.1 h1:jjdH1R6FMz4l1nSvY7F3H0F09xW9LKTke7k3ZAPcmSU= -go.opentelemetry.io/collector/config/configtelemetry v0.108.1/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/config/configtelemetry v0.108.2-0.20240829190554-7da6b618a7ee h1:LGoJWO9fANov2zNgtX4uYuH6YI4p+H0I/PbY2S+9wLk= +go.opentelemetry.io/collector/config/configtelemetry v0.108.2-0.20240829190554-7da6b618a7ee/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= go.opentelemetry.io/collector/confmap v1.14.2-0.20240829190554-7da6b618a7ee h1:+AZ6R3DhcUGDVQVya18ZVoZK863f8a1LXhHBq9TKkuw= go.opentelemetry.io/collector/confmap v1.14.2-0.20240829190554-7da6b618a7ee/go.mod h1:GrIZ12P/9DPOuTpe2PIS51a0P/ZM6iKtByVee1Uf3+k= go.opentelemetry.io/collector/extension v0.108.2-0.20240829190554-7da6b618a7ee h1:yuy6iGp41ARpBTR3E0IjwbJNps4me7QBlViAXIT00Xs= go.opentelemetry.io/collector/extension v0.108.2-0.20240829190554-7da6b618a7ee/go.mod h1:0Ialf9Lc/ESknUYJnAeQjGdQvlhLtJav0sv+Eo2xMnU= -go.opentelemetry.io/collector/pdata v1.14.1 h1:wXZjtQA7Vy5HFqco+yA95ENyMQU5heBB1IxMHQf6mUk= -go.opentelemetry.io/collector/pdata v1.14.1/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= +go.opentelemetry.io/collector/pdata v1.14.2-0.20240829190554-7da6b618a7ee h1:vqnRTZckt4i+bGcR+d/LAOAe4nAAs/KkN2L2CTXvW0Q= +go.opentelemetry.io/collector/pdata v1.14.2-0.20240829190554-7da6b618a7ee/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= 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/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= From 6c39fc8ceb0381731a3f9b1b2805979c294e7a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 4 Sep 2024 10:50:44 +0100 Subject: [PATCH 26/32] [extensions/observer/cfgardenobserver] Go tidy --- cmd/otelcontribcol/go.mod | 2 ++ cmd/otelcontribcol/go.sum | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 90a4c800bbf8..c4c5fc954f68 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -836,6 +836,8 @@ require ( go.uber.org/fx v1.18.2 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index b4a719ba01b5..f2123906dadc 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -1089,6 +1089,10 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwNy7PA4I= github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= +github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= github.com/briandowns/spinner v1.23.0 h1:alDF2guRWqa/FOZZYWjlMIx2L6H0wyewPxo/CH4Pt2A= From 4d3f08c5b693291bb2955c525d420287b6c27213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Mon, 9 Sep 2024 10:05:50 +0100 Subject: [PATCH 27/32] [extensions/observer/cfgardenobserver] Go tidy --- cmd/otelcontribcol/go.mod | 2 ++ cmd/otelcontribcol/go.sum | 5 +++++ extension/observer/cfgardenobserver/go.mod | 18 ++++++++++++++++++ extension/observer/cfgardenobserver/go.sum | 16 ++++++++++++++++ 4 files changed, 41 insertions(+) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 7a3fb200d531..26e4cf720a23 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -751,6 +751,8 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.995 // indirect github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.17.3 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index e923f5d26555..4da214f62d8d 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -2224,6 +2224,11 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.995 h1:I1l5kl6rdQYDLEk8DqWjZgwMh0+nYnqbwq7KS4bqi/s= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.995/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.33.0 h1:zJS9PfXYT5O0ZFXM2xxXfk4J5UMw/kRiISng037Gxdw= github.com/testcontainers/testcontainers-go v0.33.0/go.mod h1:W80YpTa8D5C3Yy16icheD01UTDu+LmXIA2Keo+jWtT8= github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 324e3e04f1fc..4de64bd449e0 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -46,6 +46,24 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.57.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.108.1 // indirect + go.opentelemetry.io/collector/pdata v1.14.1 // indirect + go.opentelemetry.io/otel v1.29.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.51.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/metric v1.29.0 // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.21.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index 0002acf7c78e..98c44cce29b9 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -90,6 +90,22 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector/component v0.108.2-0.20240904075637-48b11ba1c5f8 h1:PNaXC5Engp3dOQL71NH1uZb3F2oYPVunR0qbmddPMSE= +go.opentelemetry.io/collector/component v0.108.2-0.20240904075637-48b11ba1c5f8/go.mod h1:/igI72/lALdLb0lp2v2IWSkid+BXW6OX4FnF+B1KhXw= +go.opentelemetry.io/collector/component/componentstatus v0.108.1 h1:63B7/TsZ1wIT+JFopOAAvyM8GaWDyJQncQ/G12HR334= +go.opentelemetry.io/collector/component/componentstatus v0.108.1/go.mod h1:PAJmG8ip5gvEtJ9uPpLtVmwnxtjA8t4MmEbzg6nQxVs= +go.opentelemetry.io/collector/config/configtelemetry v0.108.1 h1:jjdH1R6FMz4l1nSvY7F3H0F09xW9LKTke7k3ZAPcmSU= +go.opentelemetry.io/collector/config/configtelemetry v0.108.1/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/confmap v1.14.2-0.20240904075637-48b11ba1c5f8 h1:JbS29dahigYSVJGWcu8mWpJrAlAz9YKjDDtRwQ7nzrE= +go.opentelemetry.io/collector/confmap v1.14.2-0.20240904075637-48b11ba1c5f8/go.mod h1:GrIZ12P/9DPOuTpe2PIS51a0P/ZM6iKtByVee1Uf3+k= +go.opentelemetry.io/collector/extension v0.108.2-0.20240904075637-48b11ba1c5f8 h1:r6b9/DMOUuqL2bvYAp8cZJCqH2LtpfN9C/r9Ae09shM= +go.opentelemetry.io/collector/extension v0.108.2-0.20240904075637-48b11ba1c5f8/go.mod h1:bYUxJz7GgbmE/F/qZei1dlYEFKGeDWqOMzLVyPR/GdY= +go.opentelemetry.io/collector/pdata v1.14.1 h1:wXZjtQA7Vy5HFqco+yA95ENyMQU5heBB1IxMHQf6mUk= +go.opentelemetry.io/collector/pdata v1.14.1/go.mod h1:z1dTjwwtcoXxZx2/nkHysjxMeaxe9pEmYTEr4SMNIx8= 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/prometheus v0.51.0 h1:G7uexXb/K3T+T9fNLCCKncweEtNEBMTO+46hKX5EdKw= From 3a22d6f052122977cf6ed558b4c6e5d1afe9bd61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 11 Sep 2024 11:31:11 +0100 Subject: [PATCH 28/32] [extensions/observer/cfgardenobserver] Go tidy --- extension/observer/cfgardenobserver/go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index b99807bd7cc8..853ac76c9046 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -5,7 +5,6 @@ go 1.22.0 require ( code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1 github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.108.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.109.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.109.0 @@ -48,7 +47,6 @@ require ( github.com/prometheus/common v0.57.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/tedsuo/rata v1.0.0 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.108.1 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/otel v1.29.0 // indirect From 973a488419147230702ed845caac7ae8db49013a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 11 Sep 2024 12:33:59 +0100 Subject: [PATCH 29/32] [extensions/observer/cfgardenobserver] Go tidy --- cmd/otelcontribcol/go.mod | 2 +- cmd/otelcontribcol/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index c2f6c04311e6..f6e38f7431b7 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -843,7 +843,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/crypto v0.27.0 // indirect - golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect + golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 6dbeba617fe8..8a32d85fa63b 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -2578,8 +2578,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI= -golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= +golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= From a6f79c60373bf3fb76d85925d7156e2c47c517f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Mon, 16 Sep 2024 13:15:26 +0100 Subject: [PATCH 30/32] [extensions/observer/cfgardenobserver] Go tidy --- cmd/otelcontribcol/go.mod | 3 +++ cmd/otelcontribcol/go.sum | 7 +++++++ extension/observer/cfgardenobserver/go.mod | 20 ++++++++++++++++++++ extension/observer/cfgardenobserver/go.sum | 20 ++++++++++++++++---- 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 1bc292ae8c9b..788d9e830d7a 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -752,6 +752,9 @@ require ( github.com/stormcat24/protodep v0.1.8 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.999 // indirect github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.17.3 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 0f7a93baaec2..74cd40cf6da3 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -2226,6 +2226,13 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8 github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.999 h1:Rsa9KWHP7ZG87kaDPTrGiz6LiSkGd4S2Hlz94UtVLGY= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.999/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.33.0 h1:zJS9PfXYT5O0ZFXM2xxXfk4J5UMw/kRiISng037Gxdw= github.com/testcontainers/testcontainers-go v0.33.0/go.mod h1:W80YpTa8D5C3Yy16icheD01UTDu+LmXIA2Keo+jWtT8= github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 8dd93a288fcc..66ef52d62a1b 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -41,6 +41,26 @@ require ( github.com/onsi/ginkgo/v2 v2.20.2 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.59.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect + go.opentelemetry.io/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.17.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect google.golang.org/grpc v1.66.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index c8434afc3175..427139cbf72d 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -96,14 +96,14 @@ 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/collector/component v0.109.1-0.20240911162712-6c2697c4453c h1:+yo5UeSSHsJ0aQ87IdbdqtUKM56LxT+sQEmxO6evmZw= go.opentelemetry.io/collector/component v0.109.1-0.20240911162712-6c2697c4453c/go.mod h1:RsRAgoJl0v90zfIW9/2K8/RwYARBZbNPDf7VO7zGmmQ= -go.opentelemetry.io/collector/config/configtelemetry v0.109.1-0.20240911162712-6c2697c4453c h1:jsTKBM1sbRRraXuhHfTyfkAUh0h98q4R5rtY8i77HJA= -go.opentelemetry.io/collector/config/configtelemetry v0.109.1-0.20240911162712-6c2697c4453c/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/config/configtelemetry v0.109.0 h1:ItbYw3tgFMU+TqGcDVEOqJLKbbOpfQg3AHD8b22ygl8= +go.opentelemetry.io/collector/config/configtelemetry v0.109.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= go.opentelemetry.io/collector/confmap v1.15.1-0.20240911162712-6c2697c4453c h1:Ul41G3Rdq+AuQvin4pE2AHVgvKAYYeBzX2JhCbJ6Wss= go.opentelemetry.io/collector/confmap v1.15.1-0.20240911162712-6c2697c4453c/go.mod h1:GrIZ12P/9DPOuTpe2PIS51a0P/ZM6iKtByVee1Uf3+k= go.opentelemetry.io/collector/extension v0.109.1-0.20240911162712-6c2697c4453c h1:+xeSNlMsx1wB7HYZsCnh2aRz/pIW0DVYT/0B2gdIjjg= go.opentelemetry.io/collector/extension v0.109.1-0.20240911162712-6c2697c4453c/go.mod h1:HGo5xsW1vKESwccyAC04pxXyVlzjGosJ7dD9ox0EOTo= -go.opentelemetry.io/collector/pdata v1.15.1-0.20240911162712-6c2697c4453c h1:5lhuWFPx1JjjxxKcS/3Eqq7Tfpi+rEPtE2/XP3cZ19I= -go.opentelemetry.io/collector/pdata v1.15.1-0.20240911162712-6c2697c4453c/go.mod h1:2wcsTIiLAJSbqBq/XUUYbi+cP+N87d0jEJzmb9nT19U= +go.opentelemetry.io/collector/pdata v1.15.0 h1:q/T1sFpRKJnjDrUsHdJ6mq4uSqViR/f92yvGwDby/gY= +go.opentelemetry.io/collector/pdata v1.15.0/go.mod h1:2wcsTIiLAJSbqBq/XUUYbi+cP+N87d0jEJzmb9nT19U= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= @@ -132,6 +132,18 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 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.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= +golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +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/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= From e5e3a7767bbd08c39525b1f220f7cd4952011c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Wed, 18 Sep 2024 14:06:54 +0100 Subject: [PATCH 31/32] gotidy --- cmd/otelcontribcol/go.mod | 3 +++ cmd/otelcontribcol/go.sum | 6 ++++++ extension/observer/cfgardenobserver/go.mod | 3 +++ extension/observer/cfgardenobserver/go.sum | 10 ++++++++++ 4 files changed, 22 insertions(+) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 946d8ae403d3..33acbc316c1a 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -753,6 +753,9 @@ require ( github.com/stormcat24/protodep v0.1.8 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004 // indirect github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.17.3 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index c6a4564cc7f6..191c20bd30de 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -2227,6 +2227,12 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= +github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004 h1:ErJuCtb6/7GtunW3N3Ps2IJ9c8KK6zjcrZX/S1Oo8sU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1004/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.33.0 h1:zJS9PfXYT5O0ZFXM2xxXfk4J5UMw/kRiISng037Gxdw= github.com/testcontainers/testcontainers-go v0.33.0/go.mod h1:W80YpTa8D5C3Yy16icheD01UTDu+LmXIA2Keo+jWtT8= github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 4752b19dfd3f..f55aa063cb19 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -46,6 +46,9 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.52.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index 893a03b7c2af..3bf9296ece74 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -94,6 +94,16 @@ github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector/component v0.109.1-0.20240916171416-d3a171889c53 h1:431Gh5hBCoSLC8XNcPP14SSyk3eakfNUb53pJyO+UZI= +go.opentelemetry.io/collector/component v0.109.1-0.20240916171416-d3a171889c53/go.mod h1:RsRAgoJl0v90zfIW9/2K8/RwYARBZbNPDf7VO7zGmmQ= +go.opentelemetry.io/collector/config/configtelemetry v0.109.0 h1:ItbYw3tgFMU+TqGcDVEOqJLKbbOpfQg3AHD8b22ygl8= +go.opentelemetry.io/collector/config/configtelemetry v0.109.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/confmap v1.15.1-0.20240916171416-d3a171889c53 h1:jHqX8y/wZqSYZRpSCUK9AzyNPYt0DLw5KW+hK8OJuw0= +go.opentelemetry.io/collector/confmap v1.15.1-0.20240916171416-d3a171889c53/go.mod h1:GrIZ12P/9DPOuTpe2PIS51a0P/ZM6iKtByVee1Uf3+k= +go.opentelemetry.io/collector/extension v0.109.1-0.20240916171416-d3a171889c53 h1:CkNDr+aF/V/xVr1n8JF/271pNbfV4g0TDoqSK0dZsFc= +go.opentelemetry.io/collector/extension v0.109.1-0.20240916171416-d3a171889c53/go.mod h1:HGo5xsW1vKESwccyAC04pxXyVlzjGosJ7dD9ox0EOTo= +go.opentelemetry.io/collector/pdata v1.15.0 h1:q/T1sFpRKJnjDrUsHdJ6mq4uSqViR/f92yvGwDby/gY= +go.opentelemetry.io/collector/pdata v1.15.0/go.mod h1:2wcsTIiLAJSbqBq/XUUYbi+cP+N87d0jEJzmb9nT19U= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/exporters/prometheus v0.52.0 h1:kmU3H0b9ufFSi8IQCcxack+sWUblKkFbqWYs6YiACGQ= From 7c60c3a843efd14468a95ee6f3ff1a83dfcb5c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Mota?= Date: Thu, 19 Sep 2024 12:24:03 +0100 Subject: [PATCH 32/32] [extensions/observer/cfgardenobserver] Go tidy --- extension/observer/cfgardenobserver/go.mod | 11 ++++++ extension/observer/cfgardenobserver/go.sum | 41 ++++++++++++++++++---- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/extension/observer/cfgardenobserver/go.mod b/extension/observer/cfgardenobserver/go.mod index 39712d7afe9b..2b908996b15d 100644 --- a/extension/observer/cfgardenobserver/go.mod +++ b/extension/observer/cfgardenobserver/go.mod @@ -15,6 +15,9 @@ require ( ) require ( + code.cloudfoundry.org/lager/v3 v3.3.0 // indirect + github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f // indirect + github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -30,6 +33,14 @@ require ( github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect + github.com/nxadm/tail v1.4.11 // indirect + github.com/onsi/ginkgo/v2 v2.20.2 // indirect + github.com/openzipkin/zipkin-go v0.4.3 // indirect + github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/tedsuo/rata v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.109.0 // indirect + go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/metric v1.30.0 // indirect go.opentelemetry.io/otel/sdk v1.30.0 // indirect diff --git a/extension/observer/cfgardenobserver/go.sum b/extension/observer/cfgardenobserver/go.sum index f5b351120c64..cef9d6802e88 100644 --- a/extension/observer/cfgardenobserver/go.sum +++ b/extension/observer/cfgardenobserver/go.sum @@ -1,3 +1,14 @@ +code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1 h1:N3ewws9VoYuHYi0cPKzpCMH5ZwjtI93mkuKxu+ufI5I= +code.cloudfoundry.org/garden v0.0.0-20240828205541-a750c1e932f1/go.mod h1:TWwWzXYhH7hrazAmPC14mKCRTs/9UumBQvqXOBY/leA= +code.cloudfoundry.org/lager/v3 v3.3.0 h1:adWGo2aBLpHVfUG+3D2FQ4B6Mf2Bcz47KITbn8V4b0k= +code.cloudfoundry.org/lager/v3 v3.3.0/go.mod h1:k/AYgZTVrwQaneNfQ2EwnZxUb9iUFE7i6AJ3KVOtAdE= +github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f h1:gOO/tNZMjjvTKZWpY7YnXC72ULNLErRtp94LountVE8= +github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9 h1:HK3+nJEPgwlhc5H74aw/V4mVowqWaTKGjHONdVQQ2Vw= +github.com/cloudfoundry/go-cfclient/v3 v3.0.0-alpha.9/go.mod h1:eUjFfpsU3lRv388wKlXMmkQfsJ9pveUHZEia7AoBCPY= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +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/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -33,8 +44,12 @@ 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/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/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 h1:YFh+sjyJTMQSYjKwM4dFKhJPJC/wfo98tPUc17HdoYw= +github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11/go.mod h1:Ah2dBMoxZEqk118as2T4u4fjfXarE0pPnMJaArZQZsI= +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/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= @@ -47,16 +62,30 @@ github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7s github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= +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.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= +github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/collector/component v0.109.1-0.20240918193345-a3c0565031b0 h1:EMCrB+XCK6L9Mm1Djf+K7G2hBp9i/30geloesMzhDm4= go.opentelemetry.io/collector/component v0.109.1-0.20240918193345-a3c0565031b0/go.mod h1:kMqUSLsNi4Bk/uYVAf9FNgXvqxVM1Jau3zaj6inIqlo= -go.opentelemetry.io/collector/config/configtelemetry v0.109.1-0.20240918193345-a3c0565031b0 h1:ZpOgqkcRXuTVP03w9g9tlDMF5pgYApByZ390TbM3VyI= -go.opentelemetry.io/collector/config/configtelemetry v0.109.1-0.20240918193345-a3c0565031b0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= +go.opentelemetry.io/collector/config/configtelemetry v0.109.0 h1:ItbYw3tgFMU+TqGcDVEOqJLKbbOpfQg3AHD8b22ygl8= +go.opentelemetry.io/collector/config/configtelemetry v0.109.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= go.opentelemetry.io/collector/confmap v1.15.1-0.20240918193345-a3c0565031b0 h1:4yH2rB065AWf9b+QVCCexXc+3DUxy/5hsyyVH/aRS3M= go.opentelemetry.io/collector/confmap v1.15.1-0.20240918193345-a3c0565031b0/go.mod h1:GrIZ12P/9DPOuTpe2PIS51a0P/ZM6iKtByVee1Uf3+k= go.opentelemetry.io/collector/extension v0.109.1-0.20240918193345-a3c0565031b0 h1:ireOWZJlxsWMenWKfKVvA1ooH+SwpM7qktgXGXMzQqk= go.opentelemetry.io/collector/extension v0.109.1-0.20240918193345-a3c0565031b0/go.mod h1:pzCsTIP1PWzg4GGmHQBezGunArCSaiI5wJGzvU68qAg= -go.opentelemetry.io/collector/pdata v1.15.1-0.20240918193345-a3c0565031b0 h1:DsH0WYkRYWjCg0my1gPqfCBRmsSI67Z2e+gTuOnPrvE= -go.opentelemetry.io/collector/pdata v1.15.1-0.20240918193345-a3c0565031b0/go.mod h1:YZZJIt2ehxosYf/Y1pbvexjNWsIGNNrzzlCTO9jC1F4= +go.opentelemetry.io/collector/pdata v1.15.0 h1:q/T1sFpRKJnjDrUsHdJ6mq4uSqViR/f92yvGwDby/gY= +go.opentelemetry.io/collector/pdata v1.15.0/go.mod h1:2wcsTIiLAJSbqBq/XUUYbi+cP+N87d0jEJzmb9nT19U= go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w=