From 9bbefc6cc31995c7bdd37c69eb153fc2201c3562 Mon Sep 17 00:00:00 2001 From: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com> Date: Tue, 26 Sep 2023 07:55:54 -0700 Subject: [PATCH 1/4] dependabot updates Tue Sep 26 14:35:10 UTC 2023 (#4559) Bump go.opentelemetry.io/build-tools/dbotconf from 0.11.0 to 0.12.0 in /internal/tools Bump go.opentelemetry.io/build-tools/gotmpl from 0.11.0 to 0.12.0 in /internal/tools Bump go.opentelemetry.io/build-tools/multimod from 0.11.0 to 0.12.0 in /internal/tools Bump go.opentelemetry.io/build-tools/crosslink from 0.11.0 to 0.12.0 in /internal/tools Bump go.opentelemetry.io/build-tools/semconvgen from 0.11.0 to 0.12.0 in /internal/tools --- internal/tools/go.mod | 22 ++++++++--------- internal/tools/go.sum | 56 +++++++++++++++++++------------------------ 2 files changed, 36 insertions(+), 42 deletions(-) diff --git a/internal/tools/go.mod b/internal/tools/go.mod index ae996729f3d..b8713b02069 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -9,11 +9,11 @@ require ( github.com/itchyny/gojq v0.12.13 github.com/jcchavezs/porto v0.4.0 github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad - go.opentelemetry.io/build-tools/crosslink v0.11.0 - go.opentelemetry.io/build-tools/dbotconf v0.11.0 - go.opentelemetry.io/build-tools/gotmpl v0.11.0 - go.opentelemetry.io/build-tools/multimod v0.11.0 - go.opentelemetry.io/build-tools/semconvgen v0.11.0 + go.opentelemetry.io/build-tools/crosslink v0.12.0 + go.opentelemetry.io/build-tools/dbotconf v0.12.0 + go.opentelemetry.io/build-tools/gotmpl v0.12.0 + go.opentelemetry.io/build-tools/multimod v0.12.0 + go.opentelemetry.io/build-tools/semconvgen v0.12.0 golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea golang.org/x/tools v0.13.0 ) @@ -32,7 +32,7 @@ require ( github.com/Masterminds/semver v1.5.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/acomagu/bufpipe v1.0.4 // indirect github.com/alexkohler/nakedret/v2 v2.0.2 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect @@ -53,6 +53,7 @@ require ( github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect + github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/daixiang0/gci v0.11.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/denis-tingaikin/go-header v0.4.3 // indirect @@ -66,8 +67,8 @@ require ( github.com/fzipp/gocyclo v0.6.0 // indirect github.com/go-critic/go-critic v0.9.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.4.1 // indirect - github.com/go-git/go-git/v5 v5.8.1 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-git/go-git/v5 v5.9.0 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.1.0 // indirect @@ -191,11 +192,10 @@ require ( github.com/yeya24/promlinter v0.2.0 // indirect github.com/ykadowak/zerologlint v0.1.3 // indirect gitlab.com/bosi/decorder v0.4.0 // indirect - go.opentelemetry.io/build-tools v0.11.0 // indirect + go.opentelemetry.io/build-tools v0.12.0 // indirect go.tmz.dev/musttag v0.7.2 // indirect - go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.24.0 // indirect + go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.12.0 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 6ce63a44950..6b4c7209fe2 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -65,8 +65,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OpenPeeDeeP/depguard/v2 v2.1.0 h1:aQl70G173h/GZYhWf36aE5H0KaujXfVMnn/f1kSDVYY= github.com/OpenPeeDeeP/depguard/v2 v2.1.0/go.mod h1:PUBgk35fX4i7JDmwzlJwJ+GMe6NfO1723wmJMgPThNQ= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ= github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -86,7 +86,6 @@ github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8ger github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -128,9 +127,10 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX 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= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/daixiang0/gci v0.11.0 h1:XeQbFKkCRxvVyn06EOuNY6LPGBLVuB/W130c8FrnX6A= github.com/daixiang0/gci v0.11.0/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -138,7 +138,7 @@ 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/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= -github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 h1:RIB4cRk+lBqKK3Oy0r2gRX4ui7tuhiZq2SuTtTCi0/0= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -167,11 +167,11 @@ github.com/go-critic/go-critic v0.9.0 h1:Pmys9qvU3pSML/3GEQ2Xd9RZ/ip+aXHKILuxczK github.com/go-critic/go-critic v0.9.0/go.mod h1:5P8tdXL7m/6qnyG6oRAlYLORvoXH0WDypYgAEmagT40= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.4.1 h1:Uwp5tDRkPr+l/TnbHOQzp+tmJfLceOlbVucgpTz8ix4= -github.com/go-git/go-billy/v5 v5.4.1/go.mod h1:vjbugF6Fz7JIflbVpl1hJsGjSHNltrSw45YK/ukIvQg= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f h1:Pz0DHeFij3XFhoBRGUDPzSJ+w2UcK5/0JvF8DRI58r8= -github.com/go-git/go-git/v5 v5.8.1 h1:Zo79E4p7TRk0xoRgMq0RShiTHGKcKI4+DI6BfJc/Q+A= -github.com/go-git/go-git/v5 v5.8.1/go.mod h1:FHFuoD6yGz5OSKEBK+aWN9Oah0q54Jxl0abmj6GnqAo= +github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY= +github.com/go-git/go-git/v5 v5.9.0/go.mod h1:RKIqga24sWdMGZF+1Ekv9kylsDz6LzdTSI2s/OsZWE0= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -366,12 +366,10 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= github.com/kunwardeep/paralleltest v1.0.8 h1:Ul2KsqtzFxTlSU7IP0JusWlLiNqQaloB9vguyjbE558= @@ -427,7 +425,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8pzda2l0= github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= @@ -495,7 +492,7 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= @@ -620,27 +617,25 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opentelemetry.io/build-tools v0.11.0 h1:yXTgCJM/vxWZEB8FbgVhKOAFnRlacG2Z3eoTQZ0/gYE= -go.opentelemetry.io/build-tools v0.11.0/go.mod h1:GFpz8YD/DG5shfY1J2f3uuK88zr61U5rVRGOhKMDE9M= -go.opentelemetry.io/build-tools/crosslink v0.11.0 h1:K0eJY/AT6SiIaoJSrQyiVquGErcJEHsx4oHkhxvpj9k= -go.opentelemetry.io/build-tools/crosslink v0.11.0/go.mod h1:h5oxbHx+O50aO0/M7mFejZmd7cMONdsmmC+IOmgWoWw= -go.opentelemetry.io/build-tools/dbotconf v0.11.0 h1:hG0Zyln9Vv+kwNC+ip/EUcLnd9osTZ8dOYOxe/lHZy4= -go.opentelemetry.io/build-tools/dbotconf v0.11.0/go.mod h1:BxYX1iAki4EWzIVXeEPFM75ZWr9e9koqT7pTU5xzad4= -go.opentelemetry.io/build-tools/gotmpl v0.11.0 h1:T2KJ7Eli7wLrp+8TXpUQ+Q+wAdZZDiyHYSvrpeER7Pc= -go.opentelemetry.io/build-tools/gotmpl v0.11.0/go.mod h1:FzweYUfAJC1i5ATrtFI4KJggnO9QQGPdSVKWA8RHjdE= -go.opentelemetry.io/build-tools/multimod v0.11.0 h1:QMo2Y4BlsTsWUR0LXV4gmiv5yEiX2iPLn2qAdAcCE6k= -go.opentelemetry.io/build-tools/multimod v0.11.0/go.mod h1:EID7sjEGyk1FWzRdsV6rlWp43IIn8iHXGE5pM4TytyQ= -go.opentelemetry.io/build-tools/semconvgen v0.11.0 h1:gQsNzy49l9JjNozybaRUl+vy0EMxYasV8w6aK+IWquc= -go.opentelemetry.io/build-tools/semconvgen v0.11.0/go.mod h1:Zy04Bw3w3lT7mORe23V2BwjfJYpoza6Xz1XSMIrLTCg= +go.opentelemetry.io/build-tools v0.12.0 h1:ZqK1GuqBp9Mf1RthYO3/jjf9tPWzeHMcVDo0itFi/lI= +go.opentelemetry.io/build-tools v0.12.0/go.mod h1:I76Qvv9cN055XJfTHw9t257EUd5Yp0EofeTMESlZuRU= +go.opentelemetry.io/build-tools/crosslink v0.12.0 h1:GNJQURuabE5rAkIbnrqndIKyXrr7wFy54e/8ujkgjHg= +go.opentelemetry.io/build-tools/crosslink v0.12.0/go.mod h1:QE8Kxf4Ygg2ltSHE+Vdys/67jtQM26j7spJLyjNA2DU= +go.opentelemetry.io/build-tools/dbotconf v0.12.0 h1:I+oaEtAMK+nd660l//r14d3AI1A8BB3A4hKArvUX/n4= +go.opentelemetry.io/build-tools/dbotconf v0.12.0/go.mod h1:K0Xszcb11bbFtVpjieY8gzGWLw9SNarDKvFW1Ti7w4U= +go.opentelemetry.io/build-tools/gotmpl v0.12.0 h1:ysCtNFkoJddyaAdemtdbI6Qn7nb7GYn2WbHmajTW+pM= +go.opentelemetry.io/build-tools/gotmpl v0.12.0/go.mod h1:FzweYUfAJC1i5ATrtFI4KJggnO9QQGPdSVKWA8RHjdE= +go.opentelemetry.io/build-tools/multimod v0.12.0 h1:DKi+A+4EaKrOZDTNDDZz3ijiAduEQDo8j1rzWUaGUHo= +go.opentelemetry.io/build-tools/multimod v0.12.0/go.mod h1:w03q3WgZs7reoBNnmfdClkKdTIA/IHM8ric5E2jEDD0= +go.opentelemetry.io/build-tools/semconvgen v0.12.0 h1:AsjYFwo8sSLAjwjklj+yVwm2xogJUxRf5pxflATg9N0= +go.opentelemetry.io/build-tools/semconvgen v0.12.0/go.mod h1:SRmou8pp+7gBmf1AvdxOTwVts74Syyrgm1/Qx7R8mis= go.tmz.dev/musttag v0.7.2 h1:1J6S9ipDbalBSODNT5jCep8dhZyMr4ttnjQagmGYR5s= go.tmz.dev/musttag v0.7.2/go.mod h1:m6q5NiiSKMnQYokefa2xGoyoXnrswCbJ0AWYzf4Zs28= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1035,7 +1030,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= From 1410496022e9697d0796b69788373994dd9f1e9d Mon Sep 17 00:00:00 2001 From: Damien Mathieu Date: Wed, 27 Sep 2023 16:45:10 +0200 Subject: [PATCH 2/4] stdoutmetric: Add WithWriter and WithPrettyPrint options (#4507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add WithWriter and WithPrettyOptions to stdoutmetric * add changelog * make WithWriter a shortcut to WithEncoder * Update exporters/stdout/stdoutmetric/config.go --------- Co-authored-by: Robert PajÄ…k --- CHANGELOG.md | 5 +++ exporters/stdout/stdoutmetric/config.go | 25 +++++++++++- .../stdout/stdoutmetric/exporter_test.go | 38 +++++++++++++++++++ 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75e6a83b813..5befdf6241c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Changed + +- `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` does not prettifies the output by default anymore. (#4507) + ### Added - Add the "Roll the dice" getting started application example in `go.opentelemetry.io/otel/example/dice`. (#4539) +- The `WithWriter` and `WithPrettyPrint` options to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to set a custom `io.Writer`, and allow displaying the output in human-readable JSON (#4507). ## [1.19.0-rc.1/0.42.0-rc.1] 2023-09-14 diff --git a/exporters/stdout/stdoutmetric/config.go b/exporters/stdout/stdoutmetric/config.go index 6189c019f37..cac5afeeb67 100644 --- a/exporters/stdout/stdoutmetric/config.go +++ b/exporters/stdout/stdoutmetric/config.go @@ -15,6 +15,7 @@ package stdoutmetric // import "go.opentelemetry.io/otel/exporters/stdout/stdout import ( "encoding/json" + "io" "os" "go.opentelemetry.io/otel/sdk/metric" @@ -22,6 +23,7 @@ import ( // config contains options for the exporter. type config struct { + prettyPrint bool encoder *encoderHolder temporalitySelector metric.TemporalitySelector aggregationSelector metric.AggregationSelector @@ -37,10 +39,15 @@ func newConfig(options ...Option) config { if cfg.encoder == nil { enc := json.NewEncoder(os.Stdout) - enc.SetIndent("", "\t") cfg.encoder = &encoderHolder{encoder: enc} } + if cfg.prettyPrint { + if e, ok := cfg.encoder.encoder.(*json.Encoder); ok { + e.SetIndent("", "\t") + } + } + if cfg.temporalitySelector == nil { cfg.temporalitySelector = metric.DefaultTemporalitySelector } @@ -74,6 +81,22 @@ func WithEncoder(encoder Encoder) Option { }) } +// WithWriter sets the export stream destination. +// Using this option overrides any previously set encoder. +func WithWriter(w io.Writer) Option { + return WithEncoder(json.NewEncoder(w)) +} + +// WithPrettyPrint prettifies the emitted output. +// This option only works if the encoder is a *json.Encoder, as is the case +// when using `WithWriter`. +func WithPrettyPrint() Option { + return optionFunc(func(c config) config { + c.prettyPrint = true + return c + }) +} + // WithTemporalitySelector sets the TemporalitySelector the exporter will use // to determine the Temporality of an instrument based on its kind. If this // option is not used, the exporter will use the DefaultTemporalitySelector diff --git a/exporters/stdout/stdoutmetric/exporter_test.go b/exporters/stdout/stdoutmetric/exporter_test.go index 71679d623a1..2dbfe6357a2 100644 --- a/exporters/stdout/stdoutmetric/exporter_test.go +++ b/exporters/stdout/stdoutmetric/exporter_test.go @@ -15,6 +15,7 @@ package stdoutmetric_test // import "go.opentelemetry.io/otel/exporters/stdout/stdoutmetric" import ( + "bytes" "context" "encoding/json" "io" @@ -103,6 +104,43 @@ func deltaSelector(metric.InstrumentKind) metricdata.Temporality { return metricdata.DeltaTemporality } +func TestExportWithOptions(t *testing.T) { + var ( + data = new(metricdata.ResourceMetrics) + ctx = context.Background() + ) + + for _, tt := range []struct { + name string + opts []stdoutmetric.Option + + expectedData string + }{ + { + name: "with no options", + expectedData: "{\"Resource\":null,\"ScopeMetrics\":null}\n", + }, + { + name: "with pretty print", + opts: []stdoutmetric.Option{ + stdoutmetric.WithPrettyPrint(), + }, + expectedData: "{\n\t\"Resource\": null,\n\t\"ScopeMetrics\": null\n}\n", + }, + } { + t.Run(tt.name, func(t *testing.T) { + var b bytes.Buffer + opts := append(tt.opts, stdoutmetric.WithWriter(&b)) + + exp, err := stdoutmetric.New(opts...) + require.NoError(t, err) + require.NoError(t, exp.Export(ctx, data)) + + assert.Equal(t, tt.expectedData, b.String()) + }) + } +} + func TestTemporalitySelector(t *testing.T) { exp, err := stdoutmetric.New( testEncoderOption(), From d3e31c3d939ecb4bc270bafd2b6e45df90339bcc Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 28 Sep 2023 04:19:31 -0400 Subject: [PATCH 3/4] Remove deprecated opencensus.NewMetricExporter (#4566) --- CHANGELOG.md | 4 + bridge/opencensus/metric.go | 40 ---------- bridge/opencensus/metric_test.go | 127 ------------------------------- 3 files changed, 4 insertions(+), 167 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5befdf6241c..47844f6b57f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Add the "Roll the dice" getting started application example in `go.opentelemetry.io/otel/example/dice`. (#4539) - The `WithWriter` and `WithPrettyPrint` options to `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` to set a custom `io.Writer`, and allow displaying the output in human-readable JSON (#4507). +### Removed + +- Remove `"go.opentelemetry.io/otel/bridge/opencensus".NewMetricExporter`, which is replaced by `NewMetricProducer`. (#4566) + ## [1.19.0-rc.1/0.42.0-rc.1] 2023-09-14 This is a release candidate for the v1.19.0/v0.42.0 release. diff --git a/bridge/opencensus/metric.go b/bridge/opencensus/metric.go index c2e0be49052..1c2496d8c9b 100644 --- a/bridge/opencensus/metric.go +++ b/bridge/opencensus/metric.go @@ -18,15 +18,12 @@ import ( "context" ocmetricdata "go.opencensus.io/metric/metricdata" - "go.opencensus.io/metric/metricexport" "go.opencensus.io/metric/metricproducer" - "go.opentelemetry.io/otel" internal "go.opentelemetry.io/otel/bridge/opencensus/internal/ocmetric" "go.opentelemetry.io/otel/sdk/instrumentation" "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/metric/metricdata" - "go.opentelemetry.io/otel/sdk/resource" ) const scopeName = "go.opentelemetry.io/otel/bridge/opencensus" @@ -60,40 +57,3 @@ func (p *producer) Produce(context.Context) ([]metricdata.ScopeMetrics, error) { Metrics: otelmetrics, }}, err } - -// exporter implements the OpenCensus metric Exporter interface using an -// OpenTelemetry base exporter. -type exporter struct { - base metric.Exporter - res *resource.Resource -} - -// NewMetricExporter returns an OpenCensus exporter that exports to an -// OpenTelemetry (push) exporter. -// -// Deprecated: Use [NewMetricProducer] instead. -func NewMetricExporter(base metric.Exporter, res *resource.Resource) metricexport.Exporter { - return &exporter{base: base, res: res} -} - -// ExportMetrics implements the OpenCensus metric Exporter interface by sending -// to an OpenTelemetry exporter. -func (e *exporter) ExportMetrics(ctx context.Context, ocmetrics []*ocmetricdata.Metric) error { - otelmetrics, err := internal.ConvertMetrics(ocmetrics) - if err != nil { - otel.Handle(err) - } - if len(otelmetrics) == 0 { - return nil - } - return e.base.Export(ctx, &metricdata.ResourceMetrics{ - Resource: e.res, - ScopeMetrics: []metricdata.ScopeMetrics{ - { - Scope: instrumentation.Scope{ - Name: scopeName, - }, - Metrics: otelmetrics, - }, - }}) -} diff --git a/bridge/opencensus/metric_test.go b/bridge/opencensus/metric_test.go index 58c11aadc0a..29ec835c8ba 100644 --- a/bridge/opencensus/metric_test.go +++ b/bridge/opencensus/metric_test.go @@ -16,7 +16,6 @@ package opencensus // import "go.opentelemetry.io/otel/bridge/opencensus" import ( "context" - "fmt" "testing" "time" @@ -27,10 +26,8 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/instrumentation" - "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/metric/metricdata" "go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest" - "go.opentelemetry.io/otel/sdk/resource" ) func TestMetricProducer(t *testing.T) { @@ -160,127 +157,3 @@ type fakeOCProducer struct { func (f *fakeOCProducer) Read() []*ocmetricdata.Metric { return f.metrics } - -func TestPushMetricsExporter(t *testing.T) { - now := time.Now() - for _, tc := range []struct { - desc string - input []*ocmetricdata.Metric - inputResource *resource.Resource - exportErr error - expected *metricdata.ResourceMetrics - expectErr bool - }{ - { - desc: "empty batch isn't sent", - }, - { - desc: "export error", - exportErr: fmt.Errorf("failed to export"), - input: []*ocmetricdata.Metric{ - { - Resource: &ocresource.Resource{ - Labels: map[string]string{ - "R1": "V1", - "R2": "V2", - }, - }, - TimeSeries: []*ocmetricdata.TimeSeries{ - { - StartTime: now, - Points: []ocmetricdata.Point{ - {Value: int64(123), Time: now}, - }, - }, - }, - }, - }, - expectErr: true, - }, - { - desc: "success", - input: []*ocmetricdata.Metric{ - { - Resource: &ocresource.Resource{ - Labels: map[string]string{ - "R1": "V1", - "R2": "V2", - }, - }, - TimeSeries: []*ocmetricdata.TimeSeries{ - { - StartTime: now, - Points: []ocmetricdata.Point{ - {Value: int64(123), Time: now}, - }, - }, - }, - }, - }, - inputResource: resource.NewSchemaless( - attribute.String("R1", "V1"), - attribute.String("R2", "V2"), - ), - expected: &metricdata.ResourceMetrics{ - Resource: resource.NewSchemaless( - attribute.String("R1", "V1"), - attribute.String("R2", "V2"), - ), - ScopeMetrics: []metricdata.ScopeMetrics{ - { - Scope: instrumentation.Scope{ - Name: scopeName, - }, - Metrics: []metricdata.Metrics{ - { - Name: "", - Description: "", - Unit: "", - Data: metricdata.Gauge[int64]{ - DataPoints: []metricdata.DataPoint[int64]{ - { - Attributes: attribute.NewSet(), - StartTime: now, - Time: now, - Value: 123, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } { - t.Run(tc.desc, func(t *testing.T) { - fake := &fakeExporter{err: tc.exportErr} - exporter := NewMetricExporter(fake, tc.inputResource) - err := exporter.ExportMetrics(context.Background(), tc.input) - if tc.expectErr { - require.Error(t, err) - } else { - require.NoError(t, err) - } - if tc.expected != nil { - require.NotNil(t, fake.data) - metricdatatest.AssertEqual(t, *tc.expected, *fake.data) - } else { - require.Nil(t, fake.data) - } - }) - } -} - -type fakeExporter struct { - metric.Exporter - data *metricdata.ResourceMetrics - err error -} - -func (f *fakeExporter) Export(ctx context.Context, data *metricdata.ResourceMetrics) error { - if f.err == nil { - f.data = data - } - return f.err -} From acf7146b566054dac9e10576a285bd11ed87b7e2 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 28 Sep 2023 04:31:00 -0400 Subject: [PATCH 4/4] Opencensus bridge: migrate from README to Go docs (#4561) --- bridge/opencensus/README.md | 81 ----------------------- bridge/opencensus/doc.go | 58 +++++++++++----- bridge/opencensus/example_test.go | 44 ++++++++++++ bridge/opencensus/{bridge.go => trace.go} | 0 4 files changed, 87 insertions(+), 96 deletions(-) delete mode 100644 bridge/opencensus/README.md create mode 100644 bridge/opencensus/example_test.go rename bridge/opencensus/{bridge.go => trace.go} (100%) diff --git a/bridge/opencensus/README.md b/bridge/opencensus/README.md deleted file mode 100644 index 3df9dc7eb07..00000000000 --- a/bridge/opencensus/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# OpenCensus Bridge - -The OpenCensus Bridge helps facilitate the migration of an application from OpenCensus to OpenTelemetry. - -## Caveat about OpenCensus - -Installing a metric or tracing bridge will cause OpenCensus telemetry to be exported by OpenTelemetry exporters. Since OpenCensus telemetry uses globals, installing a bridge will result in telemetry collection from _all_ libraries that use OpenCensus, including some you may not expect. For example ([#1928](https://github.com/open-telemetry/opentelemetry-go/issues/1928)), if a client library generates traces with OpenCensus, installing the bridge will cause those traces to be exported by OpenTelemetry. - -## Tracing - -### The Problem: Mixing OpenCensus and OpenTelemetry libraries - -In a perfect world, one would simply migrate their entire go application --including custom instrumentation, libraries, and exporters-- from OpenCensus to OpenTelemetry all at once. In the real world, dependency constraints, third-party ownership of libraries, or other reasons may require mixing OpenCensus and OpenTelemetry libraries in a single application. - -However, if you create the following spans in a go application: - -```go -ctx, ocSpan := opencensus.StartSpan(context.Background(), "OuterSpan") -defer ocSpan.End() -ctx, otSpan := opentelemetryTracer.Start(ctx, "MiddleSpan") -defer otSpan.End() -ctx, ocSpan := opencensus.StartSpan(ctx, "InnerSpan") -defer ocSpan.End() -``` - -OpenCensus reports (to OpenCensus exporters): - -``` -[--------OuterSpan------------] - [----InnerSpan------] -``` - -OpenTelemetry reports (to OpenTelemetry exporters): - -``` - [-----MiddleSpan--------] -``` - -Instead, I would prefer (to a single set of exporters): - -``` -[--------OuterSpan------------] - [-----MiddleSpan--------] - [----InnerSpan------] -``` - -### The bridge solution - -The bridge implements the OpenCensus trace API using OpenTelemetry. This would cause, for example, a span recorded with OpenCensus' `StartSpan()` method to be equivalent to recording a span using OpenTelemetry's `tracer.Start()` method. Funneling all tracing API calls to OpenTelemetry APIs results in the desired unified span hierarchy. - -### User Journey - -Starting from an application using entirely OpenCensus APIs: - -1. Instantiate OpenTelemetry SDK and Exporters -2. Override OpenCensus' DefaultTracer with the bridge -3. Migrate libraries individually from OpenCensus to OpenTelemetry -4. Remove OpenCensus exporters and configuration - -To override OpenCensus' DefaultTracer with the bridge: - -```go -import ( - octrace "go.opencensus.io/trace" - "go.opentelemetry.io/otel/bridge/opencensus" - "go.opentelemetry.io/otel" -) - -tracer := otel.GetTracerProvider().Tracer("bridge") -octrace.DefaultTracer = opencensus.NewTracer(tracer) -``` - -Be sure to set the `Tracer` name to your instrumentation package name instead of `"bridge"`. - -#### Incompatibilities - -OpenCensus and OpenTelemetry APIs are not entirely compatible. If the bridge finds any incompatibilities, it will log them. Incompatibilities include: - -* Custom OpenCensus Samplers specified during StartSpan are ignored. -* Links cannot be added to OpenCensus spans. -* OpenTelemetry Debug or Deferred trace flags are dropped after an OpenCensus span is created. diff --git a/bridge/opencensus/doc.go b/bridge/opencensus/doc.go index 80d80da6f78..ed2a4cfd935 100644 --- a/bridge/opencensus/doc.go +++ b/bridge/opencensus/doc.go @@ -13,23 +13,51 @@ // limitations under the License. // Package opencensus provides a migration bridge from OpenCensus to -// OpenTelemetry. The NewTracer function should be used to create an -// OpenCensus Tracer from an OpenTelemetry Tracer. This Tracer can be use in -// place of any existing OpenCensus Tracer and will generate OpenTelemetry -// spans for traces. These spans will be exported by the OpenTelemetry -// TracerProvider the original OpenTelemetry Tracer came from. +// OpenTelemetry for metrics and traces. The bridge incorporates metrics and +// traces from OpenCensus into the OpenTelemetry SDK, combining them with +// metrics and traces from OpenTelemetry instrumentation. // -// There are known limitations to this bridge: +// # Migration Guide // -// - The AddLink method for OpenCensus Spans is not compatible with the -// OpenTelemetry Span. No link can be added to an OpenTelemetry Span once it -// is started. Any calls to this method for the OpenCensus Span will result -// in an error being sent to the OpenTelemetry default ErrorHandler. +// For most applications, it would be difficult to migrate an application +// from OpenCensus to OpenTelemetry all-at-once. Libraries used by the +// application may still be using OpenCensus, and the application itself may +// have many lines of instrumentation. // -// - The NewContext method of the OpenCensus Tracer cannot embed an OpenCensus -// Span in a context unless that Span was created by that Tracer. +// Bridges help in this situation by allowing your application to have "mixed" +// instrumentation, while incorporating all instrumentation into a single +// export path. To migrate with bridges, a user would: // -// - Conversion of custom OpenCensus Samplers to OpenTelemetry is not -// implemented. An error will be sent to the OpenTelemetry default -// ErrorHandler if this is attempted. +// 1. Configure the OpenTelemetry SDK for metrics and traces, with the OpenTelemetry exporters matching to your current OpenCensus exporters. +// 2. Install this OpenCensus bridge, which sends OpenCensus telemetry to your new OpenTelemetry exporters. +// 3. Over time, migrate your instrumentation from OpenCensus to OpenTelemetry. +// 4. Once all instrumentation is migrated, remove the OpenCensus bridge. +// +// With this approach, you can migrate your telemetry, including in dependent +// libraries over time without disruption. +// +// # Warnings +// +// Installing a metric or tracing bridge will cause OpenCensus telemetry to be +// exported by OpenTelemetry exporters. Since OpenCensus telemetry uses globals, +// installing a bridge will result in telemetry collection from _all_ libraries +// that use OpenCensus, including some you may not expect, such as the +// telemetry exporter itself. +// +// # Limitations +// +// There are known limitations to the trace bridge: +// +// - The AddLink method for OpenCensus Spans is ignored, and an error is sent +// to the OpenTelemetry ErrorHandler. +// - The NewContext method of the OpenCensus Tracer cannot embed an OpenCensus +// Span in a context unless that Span was created by that Tracer. +// - Conversion of custom OpenCensus Samplers to OpenTelemetry is not +// implemented, and An error will be sent to the OpenTelemetry ErrorHandler. +// +// There are known limitations to the metric bridge: +// - Summary-typed metrics are dropped +// - GaugeDistribution-typed metrics are dropped +// - Histogram's SumOfSquaredDeviation field is dropped +// - Exemplars on Histograms are dropped package opencensus // import "go.opentelemetry.io/otel/bridge/opencensus" diff --git a/bridge/opencensus/example_test.go b/bridge/opencensus/example_test.go new file mode 100644 index 00000000000..57fef19e168 --- /dev/null +++ b/bridge/opencensus/example_test.go @@ -0,0 +1,44 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package opencensus_test + +import ( + octrace "go.opencensus.io/trace" + + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/bridge/opencensus" + "go.opentelemetry.io/otel/sdk/metric" +) + +func ExampleNewTracer() { + // Create an OpenTelemetry Tracer to use to record spans. + tracer := otel.GetTracerProvider().Tracer("go.opentelemetry.io/otel/bridge/opencensus") + // Overwrite the OpenCensus DefaultTracer so that it uses OpenTelemetry + // rather than OpenCensus. + octrace.DefaultTracer = opencensus.NewTracer(tracer) +} + +func ExampleNewMetricProducer() { + // Create the OpenCensus Metric bridge. + bridge := opencensus.NewMetricProducer() + // Add the bridge as a producer to your reader. + // If using a push exporter, such as OTLP exporter, + // use metric.NewPeriodicReader with metric.WithProducer option. + // If using a pull exporter which acts as a reader, such as prometheus exporter, + // use a dedicated option like prometheus.WithProducer. + reader := metric.NewManualReader(metric.WithProducer(bridge)) + // Add the reader to your MeterProvider. + _ = metric.NewMeterProvider(metric.WithReader(reader)) +} diff --git a/bridge/opencensus/bridge.go b/bridge/opencensus/trace.go similarity index 100% rename from bridge/opencensus/bridge.go rename to bridge/opencensus/trace.go