From 0db5dbb069882f550df0a044af1cba274637c9f7 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Mon, 25 Apr 2022 22:28:36 +1000 Subject: [PATCH 1/5] updating proto generation switching over to using opentelemetry-proto's own mechanism for generating protobuf interfaces, and updating interfaces to latest version --- .phan/config.php | 4 +- Makefile | 2 +- README.md | 5 +- docker-compose.proto.yaml | 7 - proto/otel/.gitignore | 1 + .../Proto/Collector/Logs/V1/LogsService.php | Bin 1991 -> 1149 bytes .../Collector/Metrics/V1/MetricsService.php | Bin 2139 -> 1214 bytes .../Proto/Collector/Trace/V1/TraceService.php | Bin 2046 -> 1170 bytes .../Opentelemetry/Proto/Common/V1/Common.php | Bin 2602 -> 1343 bytes .../Opentelemetry/Proto/Logs/V1/Logs.php | Bin 5419 -> 2777 bytes .../Experimental/MetricsConfigService.php | 59 --- .../Proto/Metrics/V1/Metrics.php | Bin 14187 -> 4620 bytes .../Proto/Resource/V1/Resource.php | 23 +- .../Opentelemetry/Proto/Trace/V1/Trace.php | Bin 7638 -> 2792 bytes .../Proto/Trace/V1/TraceConfig.php | Bin 2929 -> 1465 bytes .../Collector/Logs/V1/LogsServiceClient.php | 1 + .../Metrics/V1/MetricsServiceClient.php | 1 + .../Collector/Trace/V1/TraceServiceClient.php | 1 + .../Proto/Common/V1/AnyValue.php | 39 +- .../Common/V1/InstrumentationLibrary.php | 17 +- .../Proto/Common/V1/InstrumentationScope.php | 95 +++++ .../Proto/Common/V1/KeyValue.php | 16 +- .../Proto/Common/V1/KeyValueList.php | 8 + .../Proto/Common/V1/StringKeyValue.php | 88 ---- .../Logs/V1/InstrumentationLibraryLogs.php | 45 +- .../Opentelemetry/Proto/Logs/V1/LogRecord.php | 160 ++++--- .../Proto/Logs/V1/LogRecordFlags.php | 27 ++ .../Proto/Logs/V1/ResourceLogs.php | 159 ++++++- .../Opentelemetry/Proto/Logs/V1/ScopeLogs.php | 153 +++++++ .../Proto/Logs/V1/SeverityNumber.php | 50 +++ .../Experimental/MetricConfigClient.php | 53 --- .../Experimental/MetricConfigRequest.php | 103 ----- .../Experimental/MetricConfigResponse.php | 201 --------- .../MetricConfigResponse/Schedule.php | 149 ------- .../MetricConfigResponse/Schedule/Pattern.php | 103 ----- .../MetricConfigResponse_Schedule.php | 16 - .../MetricConfigResponse_Schedule_Pattern.php | 16 - .../Metrics/V1/AggregationTemporality.php | 28 ++ .../Proto/Metrics/V1/DataPointFlags.php | 27 ++ .../Proto/Metrics/V1/Exemplar.php | 78 +--- .../Proto/Metrics/V1/ExponentialHistogram.php | 2 +- .../V1/ExponentialHistogramDataPoint.php | 54 ++- .../ExponentialHistogramDataPoint/Buckets.php | 2 +- .../Proto/Metrics/V1/Histogram.php | 2 +- .../Proto/Metrics/V1/HistogramDataPoint.php | 94 ++--- .../V1/InstrumentationLibraryMetrics.php | 19 +- .../Proto/Metrics/V1/IntDataPoint.php | 227 ---------- .../Proto/Metrics/V1/IntExemplar.php | 235 ----------- .../Proto/Metrics/V1/IntGauge.php | 60 --- .../Proto/Metrics/V1/IntHistogram.php | 99 ----- .../Metrics/V1/IntHistogramDataPoint.php | 393 ------------------ .../Opentelemetry/Proto/Metrics/V1/IntSum.php | 132 ------ .../Opentelemetry/Proto/Metrics/V1/Metric.php | 164 ++------ .../Proto/Metrics/V1/NumberDataPoint.php | 82 +--- .../Proto/Metrics/V1/ResourceMetrics.php | 163 +++++++- .../Proto/Metrics/V1/ScopeMetrics.php | 153 +++++++ .../Opentelemetry/Proto/Metrics/V1/Sum.php | 4 +- .../Proto/Metrics/V1/SummaryDataPoint.php | 76 +--- .../V1/SummaryDataPoint/ValueAtQuantile.php | 4 +- .../Proto/Resource/V1/Resource.php | 18 +- .../Proto/Trace/V1/ConstantSampler.php | 4 +- .../V1/ConstantSampler/ConstantDecision.php | 28 ++ .../Trace/V1/InstrumentationLibrarySpans.php | 19 +- .../Proto/Trace/V1/RateLimitingSampler.php | 2 +- .../Proto/Trace/V1/ResourceSpans.php | 159 ++++++- .../Proto/Trace/V1/ScopeSpans.php | 153 +++++++ .../Opentelemetry/Proto/Trace/V1/Span.php | 46 +- .../Proto/Trace/V1/Span/Event.php | 14 +- .../Proto/Trace/V1/Span/Link.php | 16 +- .../Proto/Trace/V1/Span/SpanKind.php | 31 ++ .../Opentelemetry/Proto/Trace/V1/Status.php | 56 +-- .../Trace/V1/Status/DeprecatedStatusCode.php | 84 ---- .../Proto/Trace/V1/Status/StatusCode.php | 28 ++ .../Trace/V1/Status_DeprecatedStatusCode.php | 16 - .../Proto/Trace/V1/TraceConfig.php | 31 +- .../Proto/Trace/V1/TraceIdRatioBased.php | 2 +- proto/otel/VERSION | 2 +- script/proto_gen.sh | 49 ++- 78 files changed, 1746 insertions(+), 2712 deletions(-) delete mode 100644 docker-compose.proto.yaml create mode 100644 proto/otel/.gitignore delete mode 100644 proto/otel/GPBMetadata/Opentelemetry/Proto/Metrics/Experimental/MetricsConfigService.php create mode 100644 proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationScope.php delete mode 100644 proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php create mode 100644 proto/otel/Opentelemetry/Proto/Logs/V1/ScopeLogs.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigClient.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule_Pattern.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php delete mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php create mode 100644 proto/otel/Opentelemetry/Proto/Trace/V1/ScopeSpans.php delete mode 100644 proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php delete mode 100644 proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php diff --git a/.phan/config.php b/.phan/config.php index 5285ca791..72986eefc 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -359,10 +359,12 @@ // your application should be included in this list. 'directory_list' => [ 'src', - 'proto', + 'proto/otel/GPBMetadata', + 'proto/otel/Opentelemetry', 'thrift', 'vendor/packaged/thrift', 'vendor/composer', + 'vendor/grpc/grpc/src/lib', 'vendor/guzzlehttp', 'vendor/psr', 'vendor/php-http', diff --git a/Makefile b/Makefile index b315ae670..32717ec5c 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ metrics-prometheus-example: stop-prometheus: @docker-compose -f docker-compose.prometheus.yaml -p opentelemetry-php_metrics-prometheus-example stop protobuf: - @docker-compose -f docker-compose.proto.yaml up proto + ./script/proto_gen.sh thrift: ./script/thrift_gen.sh bash: diff --git a/README.md b/README.md index c41b594b7..38cf9fb28 100644 --- a/README.md +++ b/README.md @@ -205,9 +205,8 @@ To generate protobuf files for use with this repository, you can run the followi make protobuf ``` -Change into the root of this directory. This will create a `/proto` folder in the root -directory of the -repository. +This will replace `proto/otel/Opentelemetry` and `proto/otel/GPBMetadata` with freshly generated code based on the latest +tag from `opentelemetry-proto`, which can then be committed. ## Semantic Conventions Generation diff --git a/docker-compose.proto.yaml b/docker-compose.proto.yaml deleted file mode 100644 index 803de76d9..000000000 --- a/docker-compose.proto.yaml +++ /dev/null @@ -1,7 +0,0 @@ -version: '3.7' -services: - proto: - image: socialpoint/protobuf-tools - volumes: - - ./:/mnt - command: sh -c "/mnt/script/proto_gen.sh" diff --git a/proto/otel/.gitignore b/proto/otel/.gitignore new file mode 100644 index 000000000..b02a72bf6 --- /dev/null +++ b/proto/otel/.gitignore @@ -0,0 +1 @@ +opentelemetry-proto diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Collector/Logs/V1/LogsService.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Collector/Logs/V1/LogsService.php index 267c550d8a5f2c2b80e42179614d5ea3e67e4b1e..ac9bbb1acbb00a753589a70b700ddb5d9895fd8b 100644 GIT binary patch literal 1149 zcmbW0QE$^Q5XY$|?ZFcg>eGOiqYN#TAf@94Wh)z{qnZS?8WRu5Qst(X&XOA&+o>3+ zAAyg+*W?*H30a^;pykC$boaaeo&R@qtS%LK2t!O!GmA5rUV*(tP+D3UO99g?Nl-&9 z7m5qiA;4e+??xAJIyk#{;8Kmubc_*5g{eh>3$*&GljnCFKwxa8?g%+Ion<#aCkFMB z#~9{8grsbNMzI)SIPSki%Vx|nI;!*N*z2LMe(~rV$D<#*hlIp}83X?NeSsxk3AjgP zQ^8{}mRWb~aWmm5x10(7#kJXkgb9N#e?2zI(%5pDf=?KwF$QfYm_Bw-NjH`r(4mxb zfrTYbEtNHprLAxyLaXf*b&=^H)B70zUhV|+I8f~W2 z!(6uqtg1Kqukn>b%ZC?5*WF#i^5&kr;AJZ>XR}KAYj^!YRm)f2CqK5x^PAp#^U-ga zg&D%iF`;)%xa_tlCA+7emDIL&$LIJdLt~pKt z)_rn!1KlW@8a(*kAUn0H&2J5|T|_sJH((j$z98joh-Rdh6aQT0n{+(JQ v`8JIkAD_N0eE#|WzdMfiAFI2{drKBjK&=fVWc5hQ9gwOnO&OOtS*_C)Y7&?CRhC12O31~M z{9Im>uNRlsZ*Xfb-an7vr&_P_ zEGCW71~121bCVUB$#kCmMVsd&)p-NB-;GVzMQpONAa=vDh+%RM)@J)qW^bMWv9S0{o8gFOfn8imMsN6~%EqkSR~4FH>B{h$C{k3zNPLQ5=I}3{uL+ ztbIgQ7*tsidtj&vdR5S>;v%M+g@I5ZT1VX~ z2sXOKNTmxCf};th1b*Xbj0coznqZFb9zkf(niG8*SV$SC)aRiCqbr~D8EQM6{#~Qn z%%TSehN*^D+epRM66b7%c4vp|I;^eL zopIk*?p5OstZl?+CAal+Dh%V}I;}3u-xdF?wmP7PHM%gYz|*ja6- z4F%!YTmcWI%`skPGId~wP2dCmispT=Q5*U!;Ee8X1<_9qK`9eDaGO>tIm3#E_&C`L z+VPU$#Mrb2PjJl{NZVCM*`DBJR1h3WcE%xI?as2pQ=@-~yICeVl>^ZCkNOdKGJZE4 Qd@r=Gg>Gs;c~74AANb?&p8x;= diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Collector/Metrics/V1/MetricsService.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Collector/Metrics/V1/MetricsService.php index e641622aadb75bb62f31e33788c283d21aaccf83..6c1abcc08bfd39ea4f0162a0f47004299fc34682 100644 GIT binary patch literal 1214 zcmbtTU5gVj6tyV(5J9BAh>Be6!p@@3(A~FLyJBs(^g&zJ#RnNEX?oiR(n(A*#VY+F z{sEu-k!C(RZQT)totFvW-gC}9IrsG&HCN<0^e{$EElyy(0y{@gT3X4ZfN?UNq6Q`x ziVM^}KxY6S23OGS^sk<|RwEP5Fa)VEwkU9cREr@zj z&IIQAoMTbnS)pSpq7E9SxpEc^U1=E3(3W1OH{NkUo5Jxac)7+fye6^*Rwua24xrH{ zIzG#ErvU5n6#dJ@t#un0!*Dy}7BU<0)j2N)dOMkv`Y&7{ypl2HKO#Txkn@`*q3-SV z=kf5%B>9W{&HZJwF(;3^UzOB$|Ish;OM=GM`{cgHJf5SX>tPLUdv{L)zlvjv>|Yjr z1#sgjc~Z?}l#C6Y{Hl?A`y%Q;YUCjAsdp>ssz&mwS+aQ^UECBV7u&eiUXd4E{x@3t y!TxC377lBlPiKE(a9J$Av_e&G|M(zV_tT>?H!t&C@2tUJS0Jm*qq!z)LVg3fIi+U+ literal 2139 zcmb_dO>dkq5WVv&+%$*Hp;=?Vu%v0#Hf@wcyOA38gcKPwBuE4hc%!6M{(Hy30=p(j z4_#?l)*iok^X9|vKUTMu^_HAN0ku$&kob|PTOd_ks#2CYi8pBqHIe0AmE}+$6LPjD zKh{^|>)FNC8$8;Sn_5Ch$_fevIoyG&AD8X-&|0r7j(WEmE=$Rx;~0hp$y1{04NScg zQiIym#YxLs13V3H(Q6`((rr}?!!gDYvJLUwhpZ3iQ<4n)zhOZvZsCE&S+N*AYaRzw z#0hn&aDb;i-hnSfsy#G zo6IoNx^$s=lMuM)F$~D|J$#}RHgi`9r?tcX2#3L%U17AhW|TTCps|B$Vo0;e zF~Hhv?P{@`h%QWMdG?GjpPq|WCfE=pV>VzQa#t4&YOvUs!2oL&K}oT`(4WJEq&5{4 zwCCqwY_?iyD+7%3DHD_#OJ!amQxF4etmjvX1Ex+p-Uiq|m4$Hm9A5*hQwIBQH={%U zy~Ni5!~UBI;03;p?tm^`1{lNYbXkz?(-Fnr~o^Z={bP`CODS*<}$!oGB*sj<}-WAIIv8x6uskoMSuS893AqwHwL<~ g$rPK%38-mG)B_}HBMxY#;5d`il4Bd&8&OcM z+<66_6z@9OE+hy9ds)kx`DXs{KQCVCOHCd_4<#Dva025iaF+<$D5sbbFixjaG{Dqc zbAcuT==R}le+Z}Dv*9D3YE^0&#-KDxhXUv5%vCebZ+d`0=9FnVLm4&~t#BAwGz-o! z%EJhebdFa02Rbu{UhiOC@AC^=aZlVL_o-nEVhVS-u<`Nc&5lP?7Pr_-_E z46LKh|Ms{YamgL0f`9f>+c2fVq6cioPE*MoR}!*>zGPT$KwxIEds_L?v?1v!H4_+m z^OH)>{0NMsBI%-KhHEc<;6vkhhOU@#c2jSx%4Rq|g?i{QjyIZYgEJ|Xs{J4s@pA>co&Q0E7Hc;;mNdBfOH$`v wSx&xRgUb8X?ALs*R_m;s&|7wTypyl-;eO$ZXTh^2i~rW%d1SEOk}L`N0d;MWI{*Lx literal 2046 zcma)7QBT`25Pr|E@E8x}VPIbpyD4MSHa5h=R-~alMM7?Jfk+{V5*Lk4{P&%cHVrjp zt<*HN@4oxK&-VHK$NH}J-m(iUvC#%ows>Ub4q4q)rb?=UEtXk^4NI!~Ixny}X6$^< ze$21g*YnHkH@`o52Am$X|Z|86Flz1 zJg?OE*wz%mF0MX*N2611bUYs;##fe6{AG<8Ut7fZmpJvjq|j~4x`CfPu=m$v^r@GN zB2QRrw4tBFyuHcG+~m5*|B%!(mg%BJ0&ruqWto_~Dw$1~mkCaeSdVFA59^AoIb-of zRoxcYb0eqXOR}ITbrGLqn>2Y%(yu6VHoHYLcx*=|N2{_HF3;Gc=Qx`=B+r;>mN>4? zSc7KSl&2kU3-C0&#s4#KZCmf(Y_`$2f$QYG`;f21d`i=S`#0JIlRNwki@cl+RV{}D zuA`I(T>DyPipx-<3h0^8Hrz+Da35wQZ(xQUGmxBX5e1=|k^#hC1>q1A z5>toShI$AjM5vISBwaw@bIp+o(0_s=kyfA;OwfY7^&K!V_lh19WcN#gSCKdzFRA;1F$?Du$@O}51uaA`Uv$Kb$_0;G!EE$t$;RL z0Mp2t4-uWf%r$&;^j|xhlsNQ)-G&Ds#Mo7r*{BzUL!${f7oiT6R5GHjGNnUiEw=?z zYC@}K<$yu@QvX_qzc80>dYcQDQFUsGR8Ku`eS=)5(@Eg+m44>?2Sd+18ebD&C1_vCs10LYK^OaK4? diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Common/V1/Common.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Common/V1/Common.php index b8a8802a6d04ccc04831f919c1e10fdb27e2a37f..6b973ada671fd8603ba753109f769d8c9819ed87 100644 GIT binary patch literal 1343 zcmb7E?@tp!5Tz6fOq-aTNcdv1RuYOo+MrRBA}R$eM6^vLe9%kC-gR0wTz4;fdreNm zf8a;|VCVL(r9uR`FSqw@-kY~GnR)v@JPYA5YokQX4fdFqFmr}1)XFGd1x}Jn*q6>R+uu7peniwr#oEUvQz1%&0S?jVq+$6DVhxpSj5hOA-NFEp4>1b4 zkF4EoeMZB3+;F!ut>AW32kx#_a8EY30Q`VQ5z7$x35=dF_5$Iv$Z$iiH4&W(DU9HO z_(6BsW_=z+NYv}G{aE@&D9KVnNBUUXV3}qbyA~?C`!;jiN(}okNlFJ@1zWCjTCmFay|+~G|pJE5>IcD_=K6j5fMq`0hGPOV3gZfAdSkwOltw= z?TxGZ0GCOfH&C*0M3pF#Uw8eMY~xB++fbR#e0QZWyV`-p@!2Uu@f?$^EzaxQ^J?0U zyLj7zl|xB=j)yefG-XO22~TsKI2D*n=QvMr4;DtKBl>SsEH!6W3)NS!e1-hgrzYM) zZG8tO)Xl|fm9sryw?wz_tv0wy5Gr3n$^_x%Ch|&l2fbXM49c@?{-(zDpQCCcv#Gp* G3xGe`Eu`N7 literal 2602 zcmb7GU2o$=6n*!v7|K4R5484t+F1$$3e`S9`>^6E5*m-kTT8BOISyhM^}ln*p4i?@ z0&Jut*37-b^bn#%@X5*=De{eX&FT@pja|h1N^k-2R#Prc5_nkJD zJUspQs~vQq2fce-BkZ0WgWXRf!tVFvZ4{YW@AqUniT;iVKHVX&D?|2!9`N_3+W%2C z)lliW`UGF@NU7_+g=#2U9vU-LZ9|;GV`J>*noO8Z_D$Eq_dBwCXxk69oyZ^*yLa%h zZ*;x8w|mo9-O%<=5Z!J+*kKN$JK0=&vktB*$!6lX-3BD@$j~3`+BzY<9S(i-cI52< zUgxKg**D)+p2rVGF`NAb3EDi{zi3`Hn_0oBU&UG{v5YmYsU^@Ju+JZC5X8!fL?sa-6Opw19YO-y4Q zr#u1kOh}nXqeK8E1uVnO*eK?ll9{wp39y|MaG%Brjqy$6jHm7);gHvohF~QkU`~{& zS5Cb$gL3A~D87~qz+jhoRpwPko)W=ULQeCT`ohgL>N{8j%Xb3jvMhef;Maak;DKIi~X*uC3k30h~5YHFlU&b>48w=L* z9M!(&=sEe6h%ut*1!qjLBhwH}jFqH3b>q~LE(LY5)EcGS0qSG4Cc^=kt7KQW%&E&o zT`^y*48`iQsKQ``U`spyk1Vd6NrvqN2OKAJDQf@5Ibe3#iPZ?Yz&QY$Cqs}?a4x|) zJ>`t9&vDLV9)h7H)^h=Fx!zo561T_3KS@LY_GM-2tI|)k0PHxmC}pnMtyoR9%MQ8{ zPtpKv8GMLEanZqy>6nh;7%MW79MdfTo8~JD7xgwSlLU@u7?_r$rQ|e{&`2<4V2Wc7 zCr;J@2VlO9oUqHCLJtT`H8ugRf}e4!5^S;9-AvsOfL&N_7b@#mNa)_2vk=VhKxxIi z8wIw8&Xjc;%n_a#=MpR=?Gz|NG$EPm#$SoSGBvxJp%6!z5T+uEJEs=`>6 c3jkwR^A5jWznNToD;Zx(rWcUc=rxM|0WcL~tN;K2 diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Logs/V1/Logs.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Logs/V1/Logs.php index 1af54337882bf05cc31561182d2b57d96b796e72..a7e879307b6b27bf252d2e78439794eef875377e 100644 GIT binary patch literal 2777 zcmb_e-A?016mEb(82+a20xneDS-OR=ZG%X%suW7wg#0MokRS)>k0M!)GXYDE#~P2( zrWNnfn?6ae`X;^WBW!2JPC~NwvXz>f*z=w9o%5YJGd|yZ=ia*DGgQM4rUt`3)Ey#r zi;+tSBPOv?*YEc+MJ5@zmW^o!p>hi~TbHO(u3tXmt{(BJi3^Ch*kRbl1I*~~Nctby zA)VXCo*qAa6f+PJXWnUG8hnt*Q*me6$%rD6T(MnG#qTGAR0YKQ^{I= z^{o|Frr7I^3sL2*k{+ingdBiBAlQGu9#M9u?1IM0h+fLv9q(kOz_8J1n6+rO(R1Lp z*8nNeIAz{t%J*PxgzAD%O`!SoO7?J?b2?yVR0YAZ_a*^WA1){-AT^@oY>8O5kr9_L zW>g9QcqZ2qBr_+I*?(s;ZDB4lQM%w0%kg*%4fwg^$ACDxZFQ+ZhXLE)OOo#Echc3T z85#kB;4jUo2}Ke4-Qt0v`_xwFxxD4Q-xFYYl0^w5rGij>g z-wd5%lhB^0zE2r=hMF{wO!2P-*qMp+K$&t4wqq(6s(AU|RD|6ByN&|ig1vv{!16@x z7FcK20PDVEz1AJWAu{7dSnRe*YlrG99SR1o2{F((Vp}YhOUD6w>N!kCMgGkCr6BM1{wPE|17YrDT zQLF1S?5T^gUmx{;g+p%y)E*_S%Oy`(bd&fFQg!EvbiXEn;WiaO4gL?q}1yyTUAOHXW literal 5419 zcmb7|+iu%N5Qgvd6l|Ic=b{exNK$E9v`rfXXltVgdL^LXVVMY!MM0v2rbXVp|16K< zP?VcMwk+*_GxN{v>~g>T{_ydz`Z{>)_U@S0t_ZTvLH*GMhhtS&d9@3&$Fg+CAg>+{ z+nqb!2Em)V;P<=t!Ow5rz5fbRPu1fwck7@!xP9$*?!nc^&oBM_m%Hl2>E$Qkf8Y9# zR;zvb;7*4$cfs5HAAfUoTBLQlxf{>k+>`aqub930Q@mQO@?Cm51@!mo-&KHrhsSKU z&4W{&*7)^&d-`j;-`3l7xBUk(ybj8AcXF7>$Ci)#yxvy(fF|7Sb9eJ1XqYti`JqD0 zuY=9os`{{VjU$j?^A52c_vvo)#+~xx_E1;HdkkH#Ke)OVk3PA1(V8XPwhV3>AJ=Q< zAUL}E@wk8G{U*Sd{@v!9T0d0}57i!eZJKxM^$_6zyo&k5H3=n9_kJGb zwfg3}ZL7==MbQiK3rgkYqx)NC+x<-+0tNIeOfwa_FqPJpQD}{Ik;cy)ufm#0M>0wz zzKJBh*S3@;zAJ4MDOo-XZqH$nRbn*24by}a*@6L#n%DmAX4cTP~KMt>zqdz zCQ|sz;GMDtp?RO#=Of=4OiG=HX&CEP39YSwHbO`p;`3q(GreXaX0TAmFjO)QGbLrR z7~04ujDv9o^Lgfr;3AFSz#%Hd9q+;Y`tT z6a|NkGAN`e!c^ooLFp=Au)cJCAyZlsl&kY8NUV$`gCTdQ@o|nqIiy5IODSP6xIHYD zN#RPT7ky+f$nRZlJRFjNib=y1Wvp!M*Qqc~LFY(_g6~KOgM~?#c#$sq!Ob!l)ft4h z5I%aU@J$q#RzO=r$}Gt}Q5RLfJuA?+knpa4{!ge3hPu~~T6YZy@{USF+9h8ZY~p;^ zMcX=WvP&xxSuL>|G+Jh#X9l~Rc*=8OLz_3Z(%Cw$zhIMO}!Mq<* z7`R__?stMGT#2mk<5PL!)G7e8s183!Tc;XDez&E|4wk1R<oJO?M)#Trk$L9XS%?Ej0fdd_GKl6eSg+LpB88}h^SG9$BF;bZJ$ziak`r@U?I!rT*!G@J~DI_lh7Csk(!DzuwF=(&?%gI3*G^EQy zaM*Z}w-B$4Tf#K!hQZoi(P5}a%IlbB7K3#mkuvzd5LDw$gYiFkY3S0RJBW*IW~yg{ zp;?NM9Hd4Mtl8 zQ>e#Kxrj+unS-@^%>sxNn&~PW<~OYc5GfSP)S#<`?)*5)U^oikNxI*=rSLnX&UL9H zY<$=Nu}9Hw92C%eawtci`wfx7=66Vmjai1*kQ~-;BqPfT?+av5=}d%WiAs6(^{{vLWPsykdyJ2;>vLFpNn)^bn^ff%k7Fmk;T|J zhc&0|e)xDW9h-0yRE!>PaSMc}6$gAY^B^|52l96;IB(ivvQp3btD_g=E4qu`m$R62Z!{!&j0`b diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Metrics/Experimental/MetricsConfigService.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Metrics/Experimental/MetricsConfigService.php deleted file mode 100644 index 20949ab85..000000000 --- a/proto/otel/GPBMetadata/Opentelemetry/Proto/Metrics/Experimental/MetricsConfigService.php +++ /dev/null @@ -1,59 +0,0 @@ -internalAddGeneratedFile(hex2bin( - "0a8b080a456f70656e74656c656d657472792f70726f746f2f6d65747269" . - "63732f6578706572696d656e74616c2f6d6574726963735f636f6e666967" . - "5f736572766963652e70726f746f12286f70656e74656c656d657472792e" . - "70726f746f2e6d6574726963732e6578706572696d656e74616c22720a13" . - "4d6574726963436f6e66696752657175657374123b0a087265736f757263" . - "6518012001280b32292e6f70656e74656c656d657472792e70726f746f2e" . - "7265736f757263652e76312e5265736f75726365121e0a166c6173745f6b" . - "6e6f776e5f66696e6765727072696e7418022001280c22e0030a144d6574" . - "726963436f6e666967526573706f6e736512130a0b66696e676572707269" . - "6e7418012001280c125a0a097363686564756c657318022003280b32472e" . - "6f70656e74656c656d657472792e70726f746f2e6d6574726963732e6578" . - "706572696d656e74616c2e4d6574726963436f6e666967526573706f6e73" . - "652e5363686564756c65121f0a177375676765737465645f776169745f74" . - "696d655f7365631803200128051ab5020a085363686564756c65126b0a12" . - "6578636c7573696f6e5f7061747465726e7318012003280b324f2e6f7065" . - "6e74656c656d657472792e70726f746f2e6d6574726963732e6578706572" . - "696d656e74616c2e4d6574726963436f6e666967526573706f6e73652e53" . - "63686564756c652e5061747465726e126b0a12696e636c7573696f6e5f70" . - "61747465726e7318022003280b324f2e6f70656e74656c656d657472792e" . - "70726f746f2e6d6574726963732e6578706572696d656e74616c2e4d6574" . - "726963436f6e666967526573706f6e73652e5363686564756c652e506174" . - "7465726e12120a0a706572696f645f7365631803200128051a3b0a075061" . - "747465726e12100a06657175616c73180120012809480012150a0b737461" . - "7274735f77697468180220012809480042070a056d6174636832a1010a0c" . - "4d6574726963436f6e6669671290010a0f4765744d6574726963436f6e66" . - "6967123d2e6f70656e74656c656d657472792e70726f746f2e6d65747269" . - "63732e6578706572696d656e74616c2e4d6574726963436f6e6669675265" . - "71756573741a3e2e6f70656e74656c656d657472792e70726f746f2e6d65" . - "74726963732e6578706572696d656e74616c2e4d6574726963436f6e6669" . - "67526573706f6e73654294010a2b696f2e6f70656e74656c656d65747279" . - "2e70726f746f2e6d6574726963732e6578706572696d656e74616c42184d" . - "6574726963436f6e6669675365727669636550726f746f50015a49676974" . - "6875622e636f6d2f6f70656e2d74656c656d657472792f6f70656e74656c" . - "656d657472792d70726f746f2f67656e2f676f2f6d6574726963732f6578" . - "706572696d656e74616c620670726f746f33" - )); - - static::$is_initialized = true; - } -} - diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Metrics/V1/Metrics.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Metrics/V1/Metrics.php index 21cec1de513c6804d6f9605da284b50e925b9b89..38c0f7905c8d163c72d85b90c3049a4ff243436a 100644 GIT binary patch literal 4620 zcmc&&TXWk)6s{a!k8^R=nXs(y6sL8e%s8ZA$BJu6Vv{C;G9EOtymmCz4P7!# znLhBs@W2zpJHLPz9(iLJ27U@ZgR?7HzC@`hw51QJvN`A5bH4rd+m+t`z&fOwU$GSuibP zxI`m5aqZ((mcL4$RmE97x-)nzvOfSAvQ8XJR)|n~ z2Y1#06is#N*U?l(a9r8N|E{Z!q#CNL%9{EV`&k!yvgQ!XJsI2c48>JV zL!b#wLm|s6f{#gKuUjVezb>@vrrFnsUk=jIZeX9bA#3d#aTHs%T+?o0Xt~@cZb&2@ zSzZaIrEqFbSoUiymroSAF1WTwMrRiUo4B5Btg*T&z_akFJ&m&sQ`b!cDQo*rdS)UE(h;1sXg@Lou%2zOM$%RJz@eh)tBua#%WTWC{Mb0=Hg7FZ`9UXkSFdKwZV7 zJB!7!zX$5GgYv2T2G4$K;WNkvBC4V8_y*(#0aAdP=Y*N%Y-x2I`NYh{0WSeu;fEM3 zOpNhskRHGzEQhcwk+6dx>?p+LH(<_Du)VOb7%S{nB*KuA;zODgRK-7rH&w$yjp?{a zai5rmq^TWSwvR*Dzfuf$eHw0K9B0di2_~w>@*K|tILaZ>Wy!O({0ugnDg4O6>{vxr zNU*j7LheRRi>`w@rgTiq%Aol7AQd#6_er@Ci84ZpUuI;5e{yhnVwUmV_yf3f3W-4z z??z64Y7+tcOKqc!3sCre29iOivk<3N%L>f!=OEh+JPRd&q~X%=7~-M-`3uG0gG68U z`XrxVLVYW;r4dH!H2A?8z63Llr{_~F>)N!ehn|i(_aSqrI%<3H+JNrSNAumnm#Rf|147a1}5_vP|?#2bbm_8O@HTcZf~xszvh(zi=>v)4m)u z{!_Rl_xm>K`{v*h-7;-FLfvDglKIlTX%tk3>3hR${yfa$iHy4#&vHXmn99YT+9^ z?IwhYrya;H-q|{yOB^%=s_s*E(9jw`CdUV|<`Mo4IFGj^+m&2ZClVUd6UmSblc_Mt zUxfLIaeBNY(bzJwBXv!@3X*&rhd8u{93*iN_ewsABRL#dgA93s;?!i@L4%`}El=xN z3=;S`Nc1$h@8r{nHdjqS;)qs^yPM0!3O~nyk5J?|8JX8Y1{SKA9=1)1NFoi)nW>*6 zE8lV)e*xw?p7NNu5{q+?pBW6i1Pf@Vc$ZdPse=GrfAzR=+S31)HfqXq)E_0s(*xGN zj>F~WZ-#LKeXo4gYMLN0J3=5;fuqQ%GODSw^d|9?*rrb;JN=UALTSr%@D=2UFs)=u z;&hRP$Jj{`6{~Eq913hOhelxkxO_>#p|sf=jjwn1#nyZAHlzmi&O_4d^&H}|>&MxX zx}&$Yc;WXLS2Z}-Q#E{3C0*%1`0+`{rMJcj$E7A5?YIkg zm$GC-QoGEJX3>q(u8r^gbc9;c?1Yit{EmZ*r`#plOK`1HukVWW%3h$iJ ztFiY;+TVHD5;q!~4Y8Ix!(WBVrv=u;t-VT)<8MIWw2+Pc?fosB;y}#BZmz+6c;0PN z|3~gKn_HE-wA0)Xajr$U82l>jiW|+{npl$#DqH(vj;nqFS5N>@7K5d4+$gR9Zvn`z#{#x0ngwWz~8}8zf%AJ literal 14187 zcmeHOO^@5i5xvi^V4OYJhuCDZn-pi`1WBA2d)U|r7C8+NP!zQmFqQ@yO|YB5|9#)< z53J$F^X7~87-F|o4)%UyqK%ckCw!VLC@veM! z`?POPyTd-=3m^7P`|?%dF!}5^4+rS~Ho1F$IQ)3uI&ol*yYHaqabMrxy=xzvf zIDW*Vx3@pGr_PZ4$;(%MS;FnM$xA2W?X3{0w`O{|88RBnno0p&3pVWG{ zf7z)(g&46{H9d+y)L$D8-89?FOt_oup%#W zJY3{i{Fwb|+e2h3Yvp1REUX^As@i^a4~xaJ8b2RMKLHkA9IFGxOqt_#gHL&3g8co@ z1(<&@mP?scTBmF6ZB|s2PU|9r&9Y2sSU95%jRcFfwndArY4Ay5nT#>vwn~8Ub+`FYP4#=1 zZ>Cj?H4$Jw;%4?vpOsgD>4EseeMLknY)_3i$cvRVdS+ZiG|(d#U{H*ER>2`O9U|MD zmnL3ZfR)u)8p91Kmu!dt>vw4ATeB@Q^OrBBM0Xc2rm@$M4n! zQVo5MF@yY|1sLoCllxGz9v5IsWGcL*>7GF{@GQxxvW_Fc5V9qL*Wh1Dqy1}S)>Uun zY0C=9AhOGc=b}^VZb7W3Xac=TQvn8dfXAnlte4M3@||&B0fq#(#1*=wC=mqMK!8$! zIa7iQa@cJH1&T?N0y#ip-&RdRjK^v==~VBE`D zhnhKx|bORhp%lV*fY&fXO>`0Z+3l321g+wX%Mun zV3pG32h;NzxRyD96rKq%Sd8@p_sqKHzgzw*^E6Fs4vx=N@mhYr*~XP7PG*}#GMPw1-%4|SYXZt=2RA75tq%nz|@YLbSgGW zN7Erkfv!;+EQ?qnS)NXX@Un;%V1CG8%g`X5+&k;Y^uujT>;g=_h{BwMlbU2nMgh+$ zOsWt*Hm9=c_0u5%)>jVG!93W>QG+YMFwtxE8mm^OVD*J$Yka#^U@(#~@#3fBiIoi~ z0X92l9FpZoCW>I>D8gH%Ey}Tcq1r{aiB2@rwkl_dqfwhM^-R$=#~!w`Tp{PMbp_i; zd9nZ)Dl+jK1RrmGh-1V@Suu&>(E z3NQJVEK7Y&Nr$PhRd$dATQ@>704Tdx>@mZ1@nR3`T3!iuwm61cuHCc#uW$1-qV$&0hAv@tKI72wDknH)v zR8G{iOR|%YiNQ26aj_KhtYDhR=zVYuVj&crXM)L0Wb{57qhRtL1@#!Wb{-Uh2=FOm z0cEw=06ffTMwqc+L=Qh4px&7;r%L z6aYEiW~7i@7$GcR>av~)bf$(lT)d~VvqWsLS;g58yH6Vxh>XI5TdEh5xx*lRX68BX z)&gwo=ad4`=qS?;lBQCL%Nzo%PbDDmh$#@-UP%k>TU)QBpQQ;f9_c+#$zp=f`pJQ# zpv6j_8bb~{^$h^_Eq%( zzZz{Do=9v<9vz`yv7HIX8^u>wIJ@#ix<(g+`s$uofZ571sw##)E?pW0XeXZl(YBjcA2zvpB>;xY0nX*#=kB6!@LztKBQqmRc zp|}AOU~cT3Q5^I zHj&Y1T2;Bn0xZm>=6F6H*NpdBfLV)i<7ehQ1AwsOc%IZC!J;Wfzl#~x@TagNrm%$V zr!x|aR~FV+3?!l&Nq|LdpgTq$Ns`y@;(}6!mn&A@P3-jn0ftkZFc!2Yg9xwl2Z7OH zxBw#^vJ2sujb1)q^$&`CtAzlQe%&j!Zfyh z*&yr}AGMu16%b&aHJ)`UAi&1ufxhBYK!71CM`wc|ZJRXk|L7>N-{-1fT9#nO`?R*i?W zJ^|+ajNIwxb;I!-X>x8nC%`yt16y#|=I3?G$8!Q~Ft2mhWk&R97mCMo9WM*81=FaA zsE52Pz)E{0N^*o}+39-k=j(Ei(S=(JFpwP!yG4{ezDOy+o=e%B!w9g;W5VH0h?wmJ z7|SS2#|v*l0F2#~O+pgvx~w!{I{}7O+%03SCZy|k7Gn%1;k73$>x%-ccM0q(i8); zIb`49Z{rkalZ*v$&nI6CF!+2cbGPnKFI@jl0{{*dg%xQ@LP{`ZAJ8NAaPT4|j(g|q-on14$MsK?B?BGg8X6l^RpK&Ht ztdJt5WTDo;H+TG3Y1Af=UsQp2zm0zinternalAddGeneratedFile(hex2bin( - "0abd020a2e6f70656e74656c656d657472792f70726f746f2f7265736f75" . - "7263652f76312f7265736f757263652e70726f746f121f6f70656e74656c" . - "656d657472792e70726f746f2e7265736f757263652e763122690a085265" . - "736f75726365123b0a0a6174747269627574657318012003280b32272e6f" . - "70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e76312e4b" . - "657956616c756512200a1864726f707065645f617474726962757465735f" . - "636f756e7418022001280d42770a22696f2e6f70656e74656c656d657472" . - "792e70726f746f2e7265736f757263652e7631420d5265736f7572636550" . - "726f746f50015a406769746875622e636f6d2f6f70656e2d74656c656d65" . - "7472792f6f70656e74656c656d657472792d70726f746f2f67656e2f676f" . - "2f7265736f757263652f7631620670726f746f33" - )); + $pool->internalAddGeneratedFile( + ' +§ +.opentelemetry/proto/resource/v1/resource.protoopentelemetry.proto.resource.v1"i +Resource; + +attributes ( 2\'.opentelemetry.proto.common.v1.KeyValue +dropped_attributes_count ( Ba +"io.opentelemetry.proto.resource.v1B ResourceProtoPZ*go.opentelemetry.io/proto/otlp/resource/v1bproto3' + , true); static::$is_initialized = true; } diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php index 100f24de8f19c6453f4694da03925fbf67d2163e..b492fad4d3190a30898c3ed1816261f48fdd0e63 100644 GIT binary patch literal 2792 zcmb_eU2o$=6vb(pwzq9IJG%>}yNDrFYAPUAyMWk~g4!fog?5u{l2!;=vK(jHj@Gd) zdt6aaUwPsk@xV`j-@vay{0#1lozKm-71}ddOTBSc3Iv z_lk-OM*YAOp6xlb8=al8fZAT)=MD>slvWzF-ssS3rPlcfOG7UTY*wP4&s@PA)@LHP z+EVpfBCu?>b-5is6jczwwfZddafBW=4_+`~^(|>9fSx(5X^7Y)a$h8IcTq+A1uFVRYG{%&< z>%ND5?@{B>^UfU>Q$ZPw8uk~smSa>{Xb0REUeLtUQt6zDp@1?{*i5FCaQuuGVveQK zYb5um2qHE-V)$?_+;FsSJ~_LJr@Nt;-^w+)Zqy5R+tux7gYico@YZT ztv>sPC(7*idP5avjy_%jEEyZVGYnaGUIQ&f&BUT&`yCq@&$1qpF!xxsT> zn12bN%oA47Y@`g?!MKT5bVFUEbA{!dPbOifCM^!cXv>oPFDY1^h>%@a9Ka%=hJc$h z0S8Ig$Pkn4!E$J0R|%n%B2<`JKTx6AmIaCpVekQWL$p&L_aSZx&ov$14XofQ0sMDC zAwIhqu{Mcu97Cun4pO>C2ta6Gu)bwRfuql1lS}#EG=MQC2QaT1NhEkWb3!~&(5g~^ zsTmaz*+vYtF0l;xnHVD(Fm)!gzcqL~g+JaAIfeJ$AX-BHi(bAkRr)I3KwF9Jb>jmMIJaTULEo-WPK|@Qz#$E-5Fo0D632IiMehwMA zZc(V;!}sN#^_fD9P*v{QuNut9oN=M2RzRLX88TRC>5(NoqsBF#yQzVZ&F`eSwAJd` z9~z`pum9JtlLXUmk)U+?YW{Z(7Kh$_A0D-v`*riERR^>(vbu05|+E4g=Y-;mKz zt=_4&>ifqzjXZ?hDBiBNPOGh4YBE|ru2t)u+}tEav(>1alrcL!880{L?UNT6pU?lL zL8h(NRc>y)CWY2HQ=5AUzYl5K>&3e|yR&r{a};B&GM44*ct$H^`9>bW{dQ-+bJ8}; zjY?H^UhQDd1hV7d#u4^Am0E4J8rbl6=|wGIj>3r@b qpKnh%{_xJ&&8X|*(~aRB;?wxDGF07k{bd z!}IXvWU?&o{dSEj(VKTa{_1x{RqTrC-EjT%9rvHU=lba%>g8loE{g3o3SUhAokaL= z{V-e1%V@hRcKG#lzWsB)obTqvV*U?!yo%~#vGrIf@2ww}SYq?9%Zu6e*8Y-DQzmL_n! zg4+|7#Y)FGEsbeq^U~zSNkVgc4hEhK`ZrnHOWLRBuOS3?SiWDcn5z!kIJ)(4@{ z`_Lpk3t`!4`J7E;?M-W^0D~0+!#g|8p_P3cQC^z)h{R4@Ccr{LE0AK&mxxmWLJDEY zk!mFqK+QT!jyINI!DFW_u?}$Q{|rEvOHJw|b}V(IWu0anI2|6Tp=TB2+~~*N?R&BU zjHNv8cH}>cAH_YW-a(3JEx^Xi?-lmI+GDNLUVzzl-@~Avi?Mfc3X6?R1Xx1>P$(Oe zbgyTqh}@Y$7)oSVjeF9L_K2RfOXv$`7nUeW;cN)YstlgB!#q^dX9{@)6@@@jXjokP zs_d;Z`>o;<_Z#OSsFk4UxSQ>=9udsL%`>KHpy}FcUaGGIJM54b;@5=>Vuip-FzCPO z>_C@9@tD>}I#8xWp&he&VQZddAWxELfdUL9)0T*X^Pvb3L@uN6&H!PZRE<4Q(EEZ> z3z4KyqSV;lurSAcUEfN(L>HD_7RS*#onez)fLRCrCH!F(bFEOBW8$*UbBqDmFjTr~)ju2eE9_?R-sgB&3i! z0fs9BxeMynscsJXoX<|xtLy=%!hSx=O}z@sjv8$!;K$ah07Fp^#O5dgI_hbumOv4 zOg?3)1gkCP7E{x9z%;v?(*W>Yg1hN6c}6!?3t+XbsxT9}1MLDq1gLiG?L78dqz|WH z@E)-&KxVwDG0IYMSl%eKuDmsRC0E$mD7_B*Uy*0LJ0D3H8@gLoe5OZh>k3BCr5MoM=23 zLZ{#{CMVJp)HG!VCs{ngjWH=oH4$LvtB+fRoX<^#l%Y_e&$61CA_5G%;=#xl)qy+- zH@komrWzEAgcm@~ zqg0GlgO?z-e^q2LPTL}>FkH!`#Xyu?zYktsHSc_!>`r)Q&{If~C;c0)XTvv%C*LB5mx#^#z0Z@+lgWSlv3&&q diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/TraceConfig.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/TraceConfig.php index 81d9b675ac9ef64da15e116b15728690f7f0f020..cf25a1656e8934b0f71d79edafd1f50de329af35 100644 GIT binary patch literal 1465 zcmb7EZ%@-e9A-@U^CRFWk~C`KQArp^Hiz$qU^WN11lad9e11WiNqe3xZfF->335b{az~5|4`cla04s^(gSa`8vFpHo;Yy=>LMYr zRIg1cY#LEXaX`PTqV|!G13?u3F4j*XS5g+Cl+cM>QrZ5Yzv0lGpavw>akkQo<;zTAq z+S9&Mf$RKBJKH&+Lmv&#%a=V;NtJV8O51{;^HBZIh>Ry=ge~SXSG~) zx}5gZ_RdmXGo>lPGgwcLw;j+>or-9X8!T$Y+H^%FMNWpyTayUP5P!3yBy6{OvZ*4o`cfS?f8h-bvV4hh<%hidN^Y z9TzMM*8Y;6u>{4hvCx=e^8%hyHnp;5Y2=vej?^uDt_>zhlnuKclR;cny)z)L>I!)i ebmny9d$pC{%oo{(AL$SO>3wSjB62KWQpR^Oih literal 2929 zcmai0O>g5i5WVYHu<0J0Llb_9l)O!gwrPVsw8dgq+&NYTD*s@ir} zgxubfzwRH&@3)^Gzr)sTyXy+OB<;pFy{+ww?Yl46!~W~OGljkWhm8-Pi?(sq)77w+ zB#n8o+YJoJ-NUbc+TN6=H>>*)X7%7{tR6kg>TmWjNs8KRw`6$n+klq*mk@k5yLDX^ zWZRn_|2|aP&s9_Pm8q+*5OqVGskavUV_UatioR+a;y2tkgLWs%g6U26nsaLmlTXfZ?Z@UMWE|*WXpQ7pCEH3wMJzV9;V&u47MkH@Y-|cMZ zosiDB0ho7oFk6+4ia{C7|wRpDw@^#fLrVW1k1vR;)ni}qu(^RF( zYKiXxf2B&b)LiErE1F|nDu-vhQ%nh!UXZI}Ff1y;LX*_N&?&2w%9ZAJ24b8Qq00#D z8xFx%z)T$Q>|OFAqkmQ;AR@1e&vqvIvY* z%6LZCg7cEwP{jM3BQPJxy$Cxp4A>lTk(u`^9eB$z04Ko^@?3c#$P#4b%HfTFh9e~* zhzI=L%s&DH&JJ#n8MvW3>>Ux9 zM%GMD84TU|gU)!0G|)`>PAqT=PShEWwX)#A_8hF>!oFSgVUb77(ADFP`c5readOneof(1); } + public function hasStringValue() + { + return $this->hasOneof(1); + } + /** * Generated from protobuf field string string_value = 1; * @param string $var @@ -70,6 +75,11 @@ public function getBoolValue() return $this->readOneof(2); } + public function hasBoolValue() + { + return $this->hasOneof(2); + } + /** * Generated from protobuf field bool bool_value = 2; * @param bool $var @@ -92,6 +102,11 @@ public function getIntValue() return $this->readOneof(3); } + public function hasIntValue() + { + return $this->hasOneof(3); + } + /** * Generated from protobuf field int64 int_value = 3; * @param int|string $var @@ -114,6 +129,11 @@ public function getDoubleValue() return $this->readOneof(4); } + public function hasDoubleValue() + { + return $this->hasOneof(4); + } + /** * Generated from protobuf field double double_value = 4; * @param float $var @@ -129,13 +149,18 @@ public function setDoubleValue($var) /** * Generated from protobuf field .opentelemetry.proto.common.v1.ArrayValue array_value = 5; - * @return \Opentelemetry\Proto\Common\V1\ArrayValue + * @return \Opentelemetry\Proto\Common\V1\ArrayValue|null */ public function getArrayValue() { return $this->readOneof(5); } + public function hasArrayValue() + { + return $this->hasOneof(5); + } + /** * Generated from protobuf field .opentelemetry.proto.common.v1.ArrayValue array_value = 5; * @param \Opentelemetry\Proto\Common\V1\ArrayValue $var @@ -151,13 +176,18 @@ public function setArrayValue($var) /** * Generated from protobuf field .opentelemetry.proto.common.v1.KeyValueList kvlist_value = 6; - * @return \Opentelemetry\Proto\Common\V1\KeyValueList + * @return \Opentelemetry\Proto\Common\V1\KeyValueList|null */ public function getKvlistValue() { return $this->readOneof(6); } + public function hasKvlistValue() + { + return $this->hasOneof(6); + } + /** * Generated from protobuf field .opentelemetry.proto.common.v1.KeyValueList kvlist_value = 6; * @param \Opentelemetry\Proto\Common\V1\KeyValueList $var @@ -180,6 +210,11 @@ public function getBytesValue() return $this->readOneof(7); } + public function hasBytesValue() + { + return $this->hasOneof(7); + } + /** * Generated from protobuf field bytes bytes_value = 7; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php b/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php index 1a977a8e6..7d012ad19 100644 --- a/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php +++ b/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php @@ -10,22 +10,25 @@ /** * InstrumentationLibrary is a message representing the instrumentation library information - * such as the fully qualified name and version. + * such as the fully qualified name and version. + * InstrumentationLibrary is wire-compatible with InstrumentationScope for binary + * Protobuf format. + * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.common.v1.InstrumentationLibrary */ class InstrumentationLibrary extends \Google\Protobuf\Internal\Message { /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * Generated from protobuf field string version = 2; */ - private $version = ''; + protected $version = ''; /** * Constructor. @@ -34,7 +37,7 @@ class InstrumentationLibrary extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * @type string $version * } */ @@ -44,7 +47,7 @@ public function __construct($data = NULL) { } /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; * @return string @@ -55,7 +58,7 @@ public function getName() } /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationScope.php b/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationScope.php new file mode 100644 index 000000000..ee6cc1ed7 --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationScope.php @@ -0,0 +1,95 @@ +opentelemetry.proto.common.v1.InstrumentationScope + */ +class InstrumentationScope extends \Google\Protobuf\Internal\Message +{ + /** + * An empty instrumentation scope name means the name is unknown. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * An empty instrumentation scope name means the name is unknown. + * @type string $version + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * An empty instrumentation scope name means the name is unknown. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * An empty instrumentation scope name means the name is unknown. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Common/V1/KeyValue.php b/proto/otel/Opentelemetry/Proto/Common/V1/KeyValue.php index 6ca4567f2..6dfbdeb40 100644 --- a/proto/otel/Opentelemetry/Proto/Common/V1/KeyValue.php +++ b/proto/otel/Opentelemetry/Proto/Common/V1/KeyValue.php @@ -19,11 +19,11 @@ class KeyValue extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field string key = 1; */ - private $key = ''; + protected $key = ''; /** * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue value = 2; */ - private $value = null; + protected $value = null; /** * Constructor. @@ -64,13 +64,23 @@ public function setKey($var) /** * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue value = 2; - * @return \Opentelemetry\Proto\Common\V1\AnyValue + * @return \Opentelemetry\Proto\Common\V1\AnyValue|null */ public function getValue() { return $this->value; } + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + /** * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue value = 2; * @param \Opentelemetry\Proto\Common\V1\AnyValue $var diff --git a/proto/otel/Opentelemetry/Proto/Common/V1/KeyValueList.php b/proto/otel/Opentelemetry/Proto/Common/V1/KeyValueList.php index e581f862a..51fb628ae 100644 --- a/proto/otel/Opentelemetry/Proto/Common/V1/KeyValueList.php +++ b/proto/otel/Opentelemetry/Proto/Common/V1/KeyValueList.php @@ -22,6 +22,8 @@ class KeyValueList extends \Google\Protobuf\Internal\Message /** * A collection of key/value pairs of key-value pairs. The list may be empty (may * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue values = 1; */ @@ -36,6 +38,8 @@ class KeyValueList extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $values * A collection of key/value pairs of key-value pairs. The list may be empty (may * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). * } */ public function __construct($data = NULL) { @@ -46,6 +50,8 @@ public function __construct($data = NULL) { /** * A collection of key/value pairs of key-value pairs. The list may be empty (may * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue values = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -58,6 +64,8 @@ public function getValues() /** * A collection of key/value pairs of key-value pairs. The list may be empty (may * contain 0 elements). + * The keys MUST be unique (it is not allowed to have more than one + * value with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue values = 1; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php b/proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php deleted file mode 100644 index 37acf4b08..000000000 --- a/proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php +++ /dev/null @@ -1,88 +0,0 @@ -opentelemetry.proto.common.v1.StringKeyValue - */ -class StringKeyValue extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field string key = 1; - */ - private $key = ''; - /** - * Generated from protobuf field string value = 2; - */ - private $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $key - * @type string $value - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field string key = 1; - * @return string - */ - public function getKey() - { - return $this->key; - } - - /** - * Generated from protobuf field string key = 1; - * @param string $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkString($var, True); - $this->key = $var; - - return $this; - } - - /** - * Generated from protobuf field string value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Generated from protobuf field string value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php b/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php index 1bd7516fb..e43654641 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php @@ -10,6 +10,9 @@ /** * A collection of Logs produced by an InstrumentationLibrary. + * InstrumentationLibraryLogs is wire-compatible with ScopeLogs for binary + * Protobuf format. + * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.logs.v1.InstrumentationLibraryLogs */ @@ -22,19 +25,19 @@ class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; */ - private $instrumentation_library = null; + protected $instrumentation_library = null; /** - * A list of log records. + * A list of logs that originate from an instrumentation library. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; */ - private $logs; + private $log_records; /** * This schema_url applies to all logs in the "logs" field. * * Generated from protobuf field string schema_url = 3; */ - private $schema_url = ''; + protected $schema_url = ''; /** * Constructor. @@ -46,8 +49,8 @@ class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message * The instrumentation library information for the logs in this message. * Semantically when InstrumentationLibrary isn't set, it is equivalent with * an empty instrumentation library name (unknown). - * @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $logs - * A list of log records. + * @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $log_records + * A list of logs that originate from an instrumentation library. * @type string $schema_url * This schema_url applies to all logs in the "logs" field. * } @@ -63,13 +66,23 @@ public function __construct($data = NULL) { * an empty instrumentation library name (unknown). * * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; - * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary + * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary|null */ public function getInstrumentationLibrary() { return $this->instrumentation_library; } + public function hasInstrumentationLibrary() + { + return isset($this->instrumentation_library); + } + + public function clearInstrumentationLibrary() + { + unset($this->instrumentation_library); + } + /** * The instrumentation library information for the logs in this message. * Semantically when InstrumentationLibrary isn't set, it is equivalent with @@ -88,27 +101,27 @@ public function setInstrumentationLibrary($var) } /** - * A list of log records. + * A list of logs that originate from an instrumentation library. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; * @return \Google\Protobuf\Internal\RepeatedField */ - public function getLogs() + public function getLogRecords() { - return $this->logs; + return $this->log_records; } /** - * A list of log records. + * A list of logs that originate from an instrumentation library. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; * @param \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ - public function setLogs($var) + public function setLogRecords($var) { $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\LogRecord::class); - $this->logs = $arr; + $this->log_records = $arr; return $this; } diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php index 5cb639338..e05c1060c 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php @@ -23,29 +23,39 @@ class LogRecord extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 time_unix_nano = 1; */ - private $time_unix_nano = 0; + protected $time_unix_nano = 0; + /** + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 observed_time_unix_nano = 11; + */ + protected $observed_time_unix_nano = 0; /** * Numerical value of the severity, normalized to values described in Log Data Model. * [Optional]. * * Generated from protobuf field .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2; */ - private $severity_number = 0; + protected $severity_number = 0; /** * The severity text (also known as log level). The original string representation as * it is known at the source. [Optional]. * * Generated from protobuf field string severity_text = 3; */ - private $severity_text = ''; - /** - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. - * - * Generated from protobuf field string name = 4; - */ - private $name = ''; + protected $severity_text = ''; /** * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can @@ -53,9 +63,11 @@ class LogRecord extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue body = 5; */ - private $body = null; + protected $body = null; /** * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6; */ @@ -63,7 +75,7 @@ class LogRecord extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field uint32 dropped_attributes_count = 7; */ - private $dropped_attributes_count = 0; + protected $dropped_attributes_count = 0; /** * Flags, a bit field. 8 least significant bits are the trace flags as * defined in W3C Trace Context specification. 24 most significant bits are reserved @@ -73,7 +85,7 @@ class LogRecord extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed32 flags = 8; */ - private $flags = 0; + protected $flags = 0; /** * A unique identifier for a trace. All logs from the same trace share * the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes @@ -82,7 +94,7 @@ class LogRecord extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes trace_id = 9; */ - private $trace_id = ''; + protected $trace_id = ''; /** * A unique identifier for a span within a trace, assigned when the span * is created. The ID is an 8-byte array. An ID with all zeroes is considered @@ -91,7 +103,7 @@ class LogRecord extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes span_id = 10; */ - private $span_id = ''; + protected $span_id = ''; /** * Constructor. @@ -103,22 +115,34 @@ class LogRecord extends \Google\Protobuf\Internal\Message * time_unix_nano is the time when the event occurred. * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. * Value of 0 indicates unknown or missing timestamp. + * @type int|string $observed_time_unix_nano + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. * @type int $severity_number * Numerical value of the severity, normalized to values described in Log Data Model. * [Optional]. * @type string $severity_text * The severity text (also known as log level). The original string representation as * it is known at the source. [Optional]. - * @type string $name - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. * @type \Opentelemetry\Proto\Common\V1\AnyValue $body * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can * be a structured data composed of arrays and maps of other values. [Optional]. * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int $dropped_attributes_count * @type int $flags * Flags, a bit field. 8 least significant bits are the trace flags as @@ -173,6 +197,56 @@ public function setTimeUnixNano($var) return $this; } + /** + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 observed_time_unix_nano = 11; + * @return int|string + */ + public function getObservedTimeUnixNano() + { + return $this->observed_time_unix_nano; + } + + /** + * Time when the event was observed by the collection system. + * For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) + * this timestamp is typically set at the generation time and is equal to Timestamp. + * For events originating externally and collected by OpenTelemetry (e.g. using + * Collector) this is the time when OpenTelemetry's code observed the event measured + * by the clock of the OpenTelemetry code. This field MUST be set once the event is + * observed by OpenTelemetry. + * For converting OpenTelemetry log data to formats that support only one timestamp or + * when receiving OpenTelemetry log data by recipients that support only one timestamp + * internally the following logic is recommended: + * - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + * Value of 0 indicates unknown or missing timestamp. + * + * Generated from protobuf field fixed64 observed_time_unix_nano = 11; + * @param int|string $var + * @return $this + */ + public function setObservedTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->observed_time_unix_nano = $var; + + return $this; + } + /** * Numerical value of the severity, normalized to values described in Log Data Model. * [Optional]. @@ -229,49 +303,29 @@ public function setSeverityText($var) return $this; } - /** - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. - * - * Generated from protobuf field string name = 4; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. - * - * Generated from protobuf field string name = 4; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - /** * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can * be a structured data composed of arrays and maps of other values. [Optional]. * * Generated from protobuf field .opentelemetry.proto.common.v1.AnyValue body = 5; - * @return \Opentelemetry\Proto\Common\V1\AnyValue + * @return \Opentelemetry\Proto\Common\V1\AnyValue|null */ public function getBody() { return $this->body; } + public function hasBody() + { + return isset($this->body); + } + + public function clearBody() + { + unset($this->body); + } + /** * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can @@ -291,6 +345,8 @@ public function setBody($var) /** * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6; * @return \Google\Protobuf\Internal\RepeatedField @@ -302,6 +358,8 @@ public function getAttributes() /** * Additional attributes that describe the specific event occurrence. [Optional]. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php index 8f4664868..992740091 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecordFlags.php @@ -4,6 +4,8 @@ namespace Opentelemetry\Proto\Logs\V1; +use UnexpectedValueException; + /** * Masks for LogRecord.flags field. * @@ -19,5 +21,30 @@ class LogRecordFlags * Generated from protobuf enum LOG_RECORD_FLAG_TRACE_FLAGS_MASK = 255; */ const LOG_RECORD_FLAG_TRACE_FLAGS_MASK = 255; + + private static $valueToName = [ + self::LOG_RECORD_FLAG_UNSPECIFIED => 'LOG_RECORD_FLAG_UNSPECIFIED', + self::LOG_RECORD_FLAG_TRACE_FLAGS_MASK => 'LOG_RECORD_FLAG_TRACE_FLAGS_MASK', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } } diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php b/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php index 724b98afb..70b399b61 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of InstrumentationLibraryLogs from a Resource. + * A collection of ScopeLogs from a Resource. * * Generated from protobuf message opentelemetry.proto.logs.v1.ResourceLogs */ @@ -21,21 +21,48 @@ class ResourceLogs extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; */ - private $resource = null; + protected $resource = null; + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + */ + private $scope_logs; /** * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; + * @deprecated */ private $instrumentation_library_logs; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; */ - private $schema_url = ''; + protected $schema_url = ''; /** * Constructor. @@ -46,12 +73,34 @@ class ResourceLogs extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the logs in this message. * If this field is not set then resource info is unknown. + * @type \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $scope_logs + * A list of ScopeLogs that originate from a resource. * @type \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_logs * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * } */ public function __construct($data = NULL) { @@ -64,13 +113,23 @@ public function __construct($data = NULL) { * If this field is not set then resource info is unknown. * * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; - * @return \Opentelemetry\Proto\Resource\V1\Resource + * @return \Opentelemetry\Proto\Resource\V1\Resource|null */ public function getResource() { return $this->resource; } + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + /** * The resource for the logs in this message. * If this field is not set then resource info is unknown. @@ -87,26 +146,98 @@ public function setResource($var) return $this; } + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeLogs() + { + return $this->scope_logs; + } + + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + * @param \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeLogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\ScopeLogs::class); + $this->scope_logs = $arr; + + return $this; + } + /** * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated */ public function getInstrumentationLibraryLogs() { + @trigger_error('instrumentation_library_logs is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_logs; } /** * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; * @param \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setInstrumentationLibraryLogs($var) { + @trigger_error('instrumentation_library_logs is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs::class); $this->instrumentation_library_logs = $arr; @@ -115,8 +246,7 @@ public function setInstrumentationLibraryLogs($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -128,8 +258,7 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/ScopeLogs.php b/proto/otel/Opentelemetry/Proto/Logs/V1/ScopeLogs.php new file mode 100644 index 000000000..8c5a94821 --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/ScopeLogs.php @@ -0,0 +1,153 @@ +opentelemetry.proto.logs.v1.ScopeLogs + */ +class ScopeLogs extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + */ + protected $scope = null; + /** + * A list of log records. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + */ + private $log_records; + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationScope $scope + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $log_records + * A list of log records. + * @type string $schema_url + * This schema_url applies to all logs in the "logs" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationScope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * The instrumentation scope information for the logs in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationScope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationScope::class); + $this->scope = $var; + + return $this; + } + + /** + * A list of log records. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogRecords() + { + return $this->log_records; + } + + /** + * A list of log records. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; + * @param \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogRecords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\LogRecord::class); + $this->log_records = $arr; + + return $this; + } + + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all logs in the "logs" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/SeverityNumber.php b/proto/otel/Opentelemetry/Proto/Logs/V1/SeverityNumber.php index 4d22d9b5b..ad89442b0 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/SeverityNumber.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/SeverityNumber.php @@ -4,6 +4,8 @@ namespace Opentelemetry\Proto\Logs\V1; +use UnexpectedValueException; + /** * Possible values for LogRecord.SeverityNumber. * @@ -113,5 +115,53 @@ class SeverityNumber * Generated from protobuf enum SEVERITY_NUMBER_FATAL4 = 24; */ const SEVERITY_NUMBER_FATAL4 = 24; + + private static $valueToName = [ + self::SEVERITY_NUMBER_UNSPECIFIED => 'SEVERITY_NUMBER_UNSPECIFIED', + self::SEVERITY_NUMBER_TRACE => 'SEVERITY_NUMBER_TRACE', + self::SEVERITY_NUMBER_TRACE2 => 'SEVERITY_NUMBER_TRACE2', + self::SEVERITY_NUMBER_TRACE3 => 'SEVERITY_NUMBER_TRACE3', + self::SEVERITY_NUMBER_TRACE4 => 'SEVERITY_NUMBER_TRACE4', + self::SEVERITY_NUMBER_DEBUG => 'SEVERITY_NUMBER_DEBUG', + self::SEVERITY_NUMBER_DEBUG2 => 'SEVERITY_NUMBER_DEBUG2', + self::SEVERITY_NUMBER_DEBUG3 => 'SEVERITY_NUMBER_DEBUG3', + self::SEVERITY_NUMBER_DEBUG4 => 'SEVERITY_NUMBER_DEBUG4', + self::SEVERITY_NUMBER_INFO => 'SEVERITY_NUMBER_INFO', + self::SEVERITY_NUMBER_INFO2 => 'SEVERITY_NUMBER_INFO2', + self::SEVERITY_NUMBER_INFO3 => 'SEVERITY_NUMBER_INFO3', + self::SEVERITY_NUMBER_INFO4 => 'SEVERITY_NUMBER_INFO4', + self::SEVERITY_NUMBER_WARN => 'SEVERITY_NUMBER_WARN', + self::SEVERITY_NUMBER_WARN2 => 'SEVERITY_NUMBER_WARN2', + self::SEVERITY_NUMBER_WARN3 => 'SEVERITY_NUMBER_WARN3', + self::SEVERITY_NUMBER_WARN4 => 'SEVERITY_NUMBER_WARN4', + self::SEVERITY_NUMBER_ERROR => 'SEVERITY_NUMBER_ERROR', + self::SEVERITY_NUMBER_ERROR2 => 'SEVERITY_NUMBER_ERROR2', + self::SEVERITY_NUMBER_ERROR3 => 'SEVERITY_NUMBER_ERROR3', + self::SEVERITY_NUMBER_ERROR4 => 'SEVERITY_NUMBER_ERROR4', + self::SEVERITY_NUMBER_FATAL => 'SEVERITY_NUMBER_FATAL', + self::SEVERITY_NUMBER_FATAL2 => 'SEVERITY_NUMBER_FATAL2', + self::SEVERITY_NUMBER_FATAL3 => 'SEVERITY_NUMBER_FATAL3', + self::SEVERITY_NUMBER_FATAL4 => 'SEVERITY_NUMBER_FATAL4', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } } diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigClient.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigClient.php deleted file mode 100644 index b2dca8b6d..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigClient.php +++ /dev/null @@ -1,53 +0,0 @@ -_simpleRequest('/opentelemetry.proto.metrics.experimental.MetricConfig/GetMetricConfig', - $argument, - ['\Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse', 'decode'], - $metadata, $options); - } - -} diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php deleted file mode 100644 index d1288f05b..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php +++ /dev/null @@ -1,103 +0,0 @@ -opentelemetry.proto.metrics.experimental.MetricConfigRequest - */ -class MetricConfigRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource for which configuration should be returned. - * - * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; - */ - private $resource = null; - /** - * Optional. The value of MetricConfigResponse.fingerprint for the last - * configuration that the caller received and successfully applied. - * - * Generated from protobuf field bytes last_known_fingerprint = 2; - */ - private $last_known_fingerprint = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Resource\V1\Resource $resource - * Required. The resource for which configuration should be returned. - * @type string $last_known_fingerprint - * Optional. The value of MetricConfigResponse.fingerprint for the last - * configuration that the caller received and successfully applied. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource for which configuration should be returned. - * - * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; - * @return \Opentelemetry\Proto\Resource\V1\Resource - */ - public function getResource() - { - return $this->resource; - } - - /** - * Required. The resource for which configuration should be returned. - * - * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; - * @param \Opentelemetry\Proto\Resource\V1\Resource $var - * @return $this - */ - public function setResource($var) - { - GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class); - $this->resource = $var; - - return $this; - } - - /** - * Optional. The value of MetricConfigResponse.fingerprint for the last - * configuration that the caller received and successfully applied. - * - * Generated from protobuf field bytes last_known_fingerprint = 2; - * @return string - */ - public function getLastKnownFingerprint() - { - return $this->last_known_fingerprint; - } - - /** - * Optional. The value of MetricConfigResponse.fingerprint for the last - * configuration that the caller received and successfully applied. - * - * Generated from protobuf field bytes last_known_fingerprint = 2; - * @param string $var - * @return $this - */ - public function setLastKnownFingerprint($var) - { - GPBUtil::checkString($var, False); - $this->last_known_fingerprint = $var; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php deleted file mode 100644 index ba5f7216f..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php +++ /dev/null @@ -1,201 +0,0 @@ -opentelemetry.proto.metrics.experimental.MetricConfigResponse - */ -class MetricConfigResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The fingerprint associated with this MetricConfigResponse. Each - * change in configs yields a different fingerprint. The resource SHOULD copy - * this value to MetricConfigRequest.last_known_fingerprint for the next - * configuration request. If there are no changes between fingerprint and - * MetricConfigRequest.last_known_fingerprint, then all other fields besides - * fingerprint in the response are optional, or the same as the last update if - * present. - * The exact mechanics of generating the fingerprint is up to the - * implementation. However, a fingerprint must be deterministically determined - * by the configurations -- the same configuration will generate the same - * fingerprint on any instance of an implementation. Hence using a timestamp is - * unacceptable, but a deterministic hash is fine. - * - * Generated from protobuf field bytes fingerprint = 1; - */ - private $fingerprint = ''; - /** - * A single metric may match multiple schedules. In such cases, the schedule - * that specifies the smallest period is applied. - * Note, for optimization purposes, it is recommended to use as few schedules - * as possible to capture all required metric updates. Where you can be - * conservative, do take full advantage of the inclusion/exclusion patterns to - * capture as much of your targeted metrics. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; - */ - private $schedules; - /** - * Optional. The client is suggested to wait this long (in seconds) before - * pinging the configuration service again. - * - * Generated from protobuf field int32 suggested_wait_time_sec = 3; - */ - private $suggested_wait_time_sec = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $fingerprint - * Optional. The fingerprint associated with this MetricConfigResponse. Each - * change in configs yields a different fingerprint. The resource SHOULD copy - * this value to MetricConfigRequest.last_known_fingerprint for the next - * configuration request. If there are no changes between fingerprint and - * MetricConfigRequest.last_known_fingerprint, then all other fields besides - * fingerprint in the response are optional, or the same as the last update if - * present. - * The exact mechanics of generating the fingerprint is up to the - * implementation. However, a fingerprint must be deterministically determined - * by the configurations -- the same configuration will generate the same - * fingerprint on any instance of an implementation. Hence using a timestamp is - * unacceptable, but a deterministic hash is fine. - * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $schedules - * A single metric may match multiple schedules. In such cases, the schedule - * that specifies the smallest period is applied. - * Note, for optimization purposes, it is recommended to use as few schedules - * as possible to capture all required metric updates. Where you can be - * conservative, do take full advantage of the inclusion/exclusion patterns to - * capture as much of your targeted metrics. - * @type int $suggested_wait_time_sec - * Optional. The client is suggested to wait this long (in seconds) before - * pinging the configuration service again. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The fingerprint associated with this MetricConfigResponse. Each - * change in configs yields a different fingerprint. The resource SHOULD copy - * this value to MetricConfigRequest.last_known_fingerprint for the next - * configuration request. If there are no changes between fingerprint and - * MetricConfigRequest.last_known_fingerprint, then all other fields besides - * fingerprint in the response are optional, or the same as the last update if - * present. - * The exact mechanics of generating the fingerprint is up to the - * implementation. However, a fingerprint must be deterministically determined - * by the configurations -- the same configuration will generate the same - * fingerprint on any instance of an implementation. Hence using a timestamp is - * unacceptable, but a deterministic hash is fine. - * - * Generated from protobuf field bytes fingerprint = 1; - * @return string - */ - public function getFingerprint() - { - return $this->fingerprint; - } - - /** - * Optional. The fingerprint associated with this MetricConfigResponse. Each - * change in configs yields a different fingerprint. The resource SHOULD copy - * this value to MetricConfigRequest.last_known_fingerprint for the next - * configuration request. If there are no changes between fingerprint and - * MetricConfigRequest.last_known_fingerprint, then all other fields besides - * fingerprint in the response are optional, or the same as the last update if - * present. - * The exact mechanics of generating the fingerprint is up to the - * implementation. However, a fingerprint must be deterministically determined - * by the configurations -- the same configuration will generate the same - * fingerprint on any instance of an implementation. Hence using a timestamp is - * unacceptable, but a deterministic hash is fine. - * - * Generated from protobuf field bytes fingerprint = 1; - * @param string $var - * @return $this - */ - public function setFingerprint($var) - { - GPBUtil::checkString($var, False); - $this->fingerprint = $var; - - return $this; - } - - /** - * A single metric may match multiple schedules. In such cases, the schedule - * that specifies the smallest period is applied. - * Note, for optimization purposes, it is recommended to use as few schedules - * as possible to capture all required metric updates. Where you can be - * conservative, do take full advantage of the inclusion/exclusion patterns to - * capture as much of your targeted metrics. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSchedules() - { - return $this->schedules; - } - - /** - * A single metric may match multiple schedules. In such cases, the schedule - * that specifies the smallest period is applied. - * Note, for optimization purposes, it is recommended to use as few schedules - * as possible to capture all required metric updates. Where you can be - * conservative, do take full advantage of the inclusion/exclusion patterns to - * capture as much of your targeted metrics. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; - * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSchedules($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule::class); - $this->schedules = $arr; - - return $this; - } - - /** - * Optional. The client is suggested to wait this long (in seconds) before - * pinging the configuration service again. - * - * Generated from protobuf field int32 suggested_wait_time_sec = 3; - * @return int - */ - public function getSuggestedWaitTimeSec() - { - return $this->suggested_wait_time_sec; - } - - /** - * Optional. The client is suggested to wait this long (in seconds) before - * pinging the configuration service again. - * - * Generated from protobuf field int32 suggested_wait_time_sec = 3; - * @param int $var - * @return $this - */ - public function setSuggestedWaitTimeSec($var) - { - GPBUtil::checkInt32($var); - $this->suggested_wait_time_sec = $var; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php deleted file mode 100644 index 4e825dc2a..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php +++ /dev/null @@ -1,149 +0,0 @@ -opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule - */ -class Schedule extends \Google\Protobuf\Internal\Message -{ - /** - * Metrics with names that match a rule in the inclusion_patterns are - * targeted by this schedule. Metrics that match the exclusion_patterns - * are not targeted for this schedule, even if they match an inclusion - * pattern. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; - */ - private $exclusion_patterns; - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; - */ - private $inclusion_patterns; - /** - * Describes the collection period for each metric in seconds. - * A period of 0 means to not export. - * - * Generated from protobuf field int32 period_sec = 3; - */ - private $period_sec = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $exclusion_patterns - * Metrics with names that match a rule in the inclusion_patterns are - * targeted by this schedule. Metrics that match the exclusion_patterns - * are not targeted for this schedule, even if they match an inclusion - * pattern. - * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $inclusion_patterns - * @type int $period_sec - * Describes the collection period for each metric in seconds. - * A period of 0 means to not export. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); - parent::__construct($data); - } - - /** - * Metrics with names that match a rule in the inclusion_patterns are - * targeted by this schedule. Metrics that match the exclusion_patterns - * are not targeted for this schedule, even if they match an inclusion - * pattern. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExclusionPatterns() - { - return $this->exclusion_patterns; - } - - /** - * Metrics with names that match a rule in the inclusion_patterns are - * targeted by this schedule. Metrics that match the exclusion_patterns - * are not targeted for this schedule, even if they match an inclusion - * pattern. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; - * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExclusionPatterns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class); - $this->exclusion_patterns = $arr; - - return $this; - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInclusionPatterns() - { - return $this->inclusion_patterns; - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; - * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInclusionPatterns($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class); - $this->inclusion_patterns = $arr; - - return $this; - } - - /** - * Describes the collection period for each metric in seconds. - * A period of 0 means to not export. - * - * Generated from protobuf field int32 period_sec = 3; - * @return int - */ - public function getPeriodSec() - { - return $this->period_sec; - } - - /** - * Describes the collection period for each metric in seconds. - * A period of 0 means to not export. - * - * Generated from protobuf field int32 period_sec = 3; - * @param int $var - * @return $this - */ - public function setPeriodSec($var) - { - GPBUtil::checkInt32($var); - $this->period_sec = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Schedule::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule::class); - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php deleted file mode 100644 index 131a0a839..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php +++ /dev/null @@ -1,103 +0,0 @@ -opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern - */ -class Pattern extends \Google\Protobuf\Internal\Message -{ - protected $match; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $equals - * matches the metric name exactly - * @type string $starts_with - * prefix-matches the metric name - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); - parent::__construct($data); - } - - /** - * matches the metric name exactly - * - * Generated from protobuf field string equals = 1; - * @return string - */ - public function getEquals() - { - return $this->readOneof(1); - } - - /** - * matches the metric name exactly - * - * Generated from protobuf field string equals = 1; - * @param string $var - * @return $this - */ - public function setEquals($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * prefix-matches the metric name - * - * Generated from protobuf field string starts_with = 2; - * @return string - */ - public function getStartsWith() - { - return $this->readOneof(2); - } - - /** - * prefix-matches the metric name - * - * Generated from protobuf field string starts_with = 2; - * @param string $var - * @return $this - */ - public function setStartsWith($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getMatch() - { - return $this->whichOneof("match"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Pattern::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule_Pattern::class); - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php deleted file mode 100644 index 5486976fc..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php +++ /dev/null @@ -1,16 +0,0 @@ -AGGREGATION_TEMPORALITY_CUMULATIVE = 2; */ const AGGREGATION_TEMPORALITY_CUMULATIVE = 2; + + private static $valueToName = [ + self::AGGREGATION_TEMPORALITY_UNSPECIFIED => 'AGGREGATION_TEMPORALITY_UNSPECIFIED', + self::AGGREGATION_TEMPORALITY_DELTA => 'AGGREGATION_TEMPORALITY_DELTA', + self::AGGREGATION_TEMPORALITY_CUMULATIVE => 'AGGREGATION_TEMPORALITY_CUMULATIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } } diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php index 3009c2483..f0f082b46 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/DataPointFlags.php @@ -4,6 +4,8 @@ namespace Opentelemetry\Proto\Metrics\V1; +use UnexpectedValueException; + /** * DataPointFlags is defined as a protobuf 'uint32' type and is to be used as a * bit-field representing 32 distinct boolean flags. Each flag defined in this @@ -27,5 +29,30 @@ class DataPointFlags * Generated from protobuf enum FLAG_NO_RECORDED_VALUE = 1; */ const FLAG_NO_RECORDED_VALUE = 1; + + private static $valueToName = [ + self::FLAG_NONE => 'FLAG_NONE', + self::FLAG_NO_RECORDED_VALUE => 'FLAG_NO_RECORDED_VALUE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } } diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/Exemplar.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/Exemplar.php index 32263d7bd..a0387ede1 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/Exemplar.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/Exemplar.php @@ -26,19 +26,6 @@ class Exemplar extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue filtered_attributes = 7; */ private $filtered_attributes; - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `filtered_labels` field. - * 2. New senders, which are aware of this change MUST send only - * `filtered_attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `filtered_labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1 [deprecated = true]; - */ - private $filtered_labels; /** * time_unix_nano is the exact time when this exemplar was recorded * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -46,7 +33,7 @@ class Exemplar extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 time_unix_nano = 2; */ - private $time_unix_nano = 0; + protected $time_unix_nano = 0; /** * (Optional) Span ID of the exemplar trace. * span_id may be missing if the measurement is not recorded inside a trace @@ -54,7 +41,7 @@ class Exemplar extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes span_id = 4; */ - private $span_id = ''; + protected $span_id = ''; /** * (Optional) Trace ID of the exemplar trace. * trace_id may be missing if the measurement is not recorded inside a trace @@ -62,7 +49,7 @@ class Exemplar extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes trace_id = 5; */ - private $trace_id = ''; + protected $trace_id = ''; protected $value; /** @@ -75,15 +62,6 @@ class Exemplar extends \Google\Protobuf\Internal\Message * The set of key/value pairs that were filtered out by the aggregator, but * recorded alongside the original measurement. Only key/value pairs that were * filtered out by the aggregator should be included - * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $filtered_labels - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `filtered_labels` field. - * 2. New senders, which are aware of this change MUST send only - * `filtered_attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `filtered_labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. * @type int|string $time_unix_nano * time_unix_nano is the exact time when this exemplar was recorded * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -135,46 +113,6 @@ public function setFilteredAttributes($var) return $this; } - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `filtered_labels` field. - * 2. New senders, which are aware of this change MUST send only - * `filtered_attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `filtered_labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFilteredLabels() - { - return $this->filtered_labels; - } - - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `filtered_labels` field. - * 2. New senders, which are aware of this change MUST send only - * `filtered_attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `filtered_labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1 [deprecated = true]; - * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFilteredLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); - $this->filtered_labels = $arr; - - return $this; - } - /** * time_unix_nano is the exact time when this exemplar was recorded * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -214,6 +152,11 @@ public function getAsDouble() return $this->readOneof(3); } + public function hasAsDouble() + { + return $this->hasOneof(3); + } + /** * Generated from protobuf field double as_double = 3; * @param float $var @@ -236,6 +179,11 @@ public function getAsInt() return $this->readOneof(6); } + public function hasAsInt() + { + return $this->hasOneof(6); + } + /** * Generated from protobuf field sfixed64 as_int = 6; * @param int|string $var diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php index d8bd7a60e..2a5c4cc90 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogram.php @@ -26,7 +26,7 @@ class ExponentialHistogram extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; */ - private $aggregation_temporality = 0; + protected $aggregation_temporality = 0; /** * Constructor. diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php index a3738bb67..2ad3ee655 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint.php @@ -21,6 +21,8 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; */ @@ -33,7 +35,7 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 start_time_unix_nano = 2; */ - private $start_time_unix_nano = 0; + protected $start_time_unix_nano = 0; /** * TimeUnixNano is required, see the detailed comments above Metric. * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -41,7 +43,7 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 time_unix_nano = 3; */ - private $time_unix_nano = 0; + protected $time_unix_nano = 0; /** * count is the number of values in the population. Must be * non-negative. This value must be equal to the sum of the "bucket_counts" @@ -49,7 +51,7 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 count = 4; */ - private $count = 0; + protected $count = 0; /** * sum of the values in the population. If count is zero then this field * must be zero. @@ -61,7 +63,7 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double sum = 5; */ - private $sum = 0.0; + protected $sum = 0.0; /** * scale describes the resolution of the histogram. Boundaries are * located at powers of the base, where: @@ -77,7 +79,7 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field sint32 scale = 6; */ - private $scale = 0; + protected $scale = 0; /** * zero_count is the count of values that are either exactly zero or * within the region considered zero by the instrumentation at the @@ -89,26 +91,26 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 zero_count = 7; */ - private $zero_count = 0; + protected $zero_count = 0; /** * positive carries the positive range of exponential bucket counts. * * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets positive = 8; */ - private $positive = null; + protected $positive = null; /** * negative carries the negative range of exponential bucket counts. * * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets negative = 9; */ - private $negative = null; + protected $negative = null; /** * Flags that apply to this specific data point. See DataPointFlags * for the available flags and their meaning. * * Generated from protobuf field uint32 flags = 10; */ - private $flags = 0; + protected $flags = 0; /** * (Optional) List of exemplars collected from * measurements that were used to form the data point @@ -126,6 +128,8 @@ class ExponentialHistogramDataPoint extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int|string $start_time_unix_nano * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -187,6 +191,8 @@ public function __construct($data = NULL) { /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -199,6 +205,8 @@ public function getAttributes() /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var @@ -430,13 +438,23 @@ public function setZeroCount($var) * positive carries the positive range of exponential bucket counts. * * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets positive = 8; - * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets + * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets|null */ public function getPositive() { return $this->positive; } + public function hasPositive() + { + return isset($this->positive); + } + + public function clearPositive() + { + unset($this->positive); + } + /** * positive carries the positive range of exponential bucket counts. * @@ -446,7 +464,7 @@ public function getPositive() */ public function setPositive($var) { - GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint_Buckets::class); + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets::class); $this->positive = $var; return $this; @@ -456,13 +474,23 @@ public function setPositive($var) * negative carries the negative range of exponential bucket counts. * * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets negative = 9; - * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets + * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets|null */ public function getNegative() { return $this->negative; } + public function hasNegative() + { + return isset($this->negative); + } + + public function clearNegative() + { + unset($this->negative); + } + /** * negative carries the negative range of exponential bucket counts. * @@ -472,7 +500,7 @@ public function getNegative() */ public function setNegative($var) { - GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint_Buckets::class); + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\ExponentialHistogramDataPoint\Buckets::class); $this->negative = $var; return $this; diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php index ff70f73a9..b9e7f0199 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/ExponentialHistogramDataPoint/Buckets.php @@ -23,7 +23,7 @@ class Buckets extends \Google\Protobuf\Internal\Message * * Generated from protobuf field sint32 offset = 1; */ - private $offset = 0; + protected $offset = 0; /** * Count is an array of counts, where count[i] carries the count * of the bucket at index (offset+i). count[i] is the count of diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/Histogram.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/Histogram.php index f62a10340..e6643b89e 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/Histogram.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/Histogram.php @@ -26,7 +26,7 @@ class Histogram extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; */ - private $aggregation_temporality = 0; + protected $aggregation_temporality = 0; /** * Constructor. diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php index fb5f40be5..2d2933c4a 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php @@ -26,22 +26,12 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; */ private $attributes; - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - */ - private $labels; /** * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -50,7 +40,7 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 start_time_unix_nano = 2; */ - private $start_time_unix_nano = 0; + protected $start_time_unix_nano = 0; /** * TimeUnixNano is required, see the detailed comments above Metric. * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -58,7 +48,7 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 time_unix_nano = 3; */ - private $time_unix_nano = 0; + protected $time_unix_nano = 0; /** * count is the number of values in the population. Must be non-negative. This * value must be equal to the sum of the "count" fields in buckets if a @@ -66,7 +56,7 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 count = 4; */ - private $count = 0; + protected $count = 0; /** * sum of the values in the population. If count is zero then this field * must be zero. @@ -76,9 +66,9 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field double sum = 5; + * Generated from protobuf field optional double sum = 5; */ - private $sum = 0.0; + protected $sum = null; /** * bucket_counts is an optional field contains the count values of histogram * for each bucket. @@ -116,7 +106,7 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 flags = 10; */ - private $flags = 0; + protected $flags = 0; /** * Constructor. @@ -127,14 +117,8 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). - * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int|string $start_time_unix_nano * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -188,6 +172,8 @@ public function __construct($data = NULL) { /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; * @return \Google\Protobuf\Internal\RepeatedField @@ -200,6 +186,8 @@ public function getAttributes() /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var @@ -213,44 +201,6 @@ public function setAttributes($var) return $this; } - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); - $this->labels = $arr; - - return $this; - } - /** * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -352,12 +302,22 @@ public function setCount($var) * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field double sum = 5; + * Generated from protobuf field optional double sum = 5; * @return float */ public function getSum() { - return $this->sum; + return isset($this->sum) ? $this->sum : 0.0; + } + + public function hasSum() + { + return isset($this->sum); + } + + public function clearSum() + { + unset($this->sum); } /** @@ -369,7 +329,7 @@ public function getSum() * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field double sum = 5; + * Generated from protobuf field optional double sum = 5; * @param float $var * @return $this */ diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php index 02103fd87..807aa1054 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php @@ -10,6 +10,9 @@ /** * A collection of Metrics produced by an InstrumentationLibrary. + * InstrumentationLibraryMetrics is wire-compatible with ScopeMetrics for binary + * Protobuf format. + * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics */ @@ -22,7 +25,7 @@ class InstrumentationLibraryMetrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; */ - private $instrumentation_library = null; + protected $instrumentation_library = null; /** * A list of metrics that originate from an instrumentation library. * @@ -34,7 +37,7 @@ class InstrumentationLibraryMetrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_url = 3; */ - private $schema_url = ''; + protected $schema_url = ''; /** * Constructor. @@ -63,13 +66,23 @@ public function __construct($data = NULL) { * an empty instrumentation library name (unknown). * * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; - * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary + * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary|null */ public function getInstrumentationLibrary() { return $this->instrumentation_library; } + public function hasInstrumentationLibrary() + { + return isset($this->instrumentation_library); + } + + public function clearInstrumentationLibrary() + { + unset($this->instrumentation_library); + } + /** * The instrumentation library information for the metrics in this message. * Semantically when InstrumentationLibrary isn't set, it is equivalent with diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php deleted file mode 100644 index e1f9e87a5..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php +++ /dev/null @@ -1,227 +0,0 @@ -opentelemetry.proto.metrics.v1.IntDataPoint - */ -class IntDataPoint extends \Google\Protobuf\Internal\Message -{ - /** - * The set of labels that uniquely identify this timeseries. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; - */ - private $labels; - /** - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 start_time_unix_nano = 2; - */ - private $start_time_unix_nano = 0; - /** - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 3; - */ - private $time_unix_nano = 0; - /** - * value itself. - * - * Generated from protobuf field sfixed64 value = 4; - */ - private $value = 0; - /** - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; - */ - private $exemplars; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels - * The set of labels that uniquely identify this timeseries. - * @type int|string $start_time_unix_nano - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * @type int|string $time_unix_nano - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * @type int|string $value - * value itself. - * @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); - parent::__construct($data); - } - - /** - * The set of labels that uniquely identify this timeseries. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * The set of labels that uniquely identify this timeseries. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; - * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); - $this->labels = $arr; - - return $this; - } - - /** - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 start_time_unix_nano = 2; - * @return int|string - */ - public function getStartTimeUnixNano() - { - return $this->start_time_unix_nano; - } - - /** - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 start_time_unix_nano = 2; - * @param int|string $var - * @return $this - */ - public function setStartTimeUnixNano($var) - { - GPBUtil::checkUint64($var); - $this->start_time_unix_nano = $var; - - return $this; - } - - /** - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 3; - * @return int|string - */ - public function getTimeUnixNano() - { - return $this->time_unix_nano; - } - - /** - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 3; - * @param int|string $var - * @return $this - */ - public function setTimeUnixNano($var) - { - GPBUtil::checkUint64($var); - $this->time_unix_nano = $var; - - return $this; - } - - /** - * value itself. - * - * Generated from protobuf field sfixed64 value = 4; - * @return int|string - */ - public function getValue() - { - return $this->value; - } - - /** - * value itself. - * - * Generated from protobuf field sfixed64 value = 4; - * @param int|string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkInt64($var); - $this->value = $var; - - return $this; - } - - /** - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExemplars() - { - return $this->exemplars; - } - - /** - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; - * @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExemplars($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class); - $this->exemplars = $arr; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php deleted file mode 100644 index 1a54076af..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php +++ /dev/null @@ -1,235 +0,0 @@ -opentelemetry.proto.metrics.v1.IntExemplar - */ -class IntExemplar extends \Google\Protobuf\Internal\Message -{ - /** - * The set of labels that were filtered out by the aggregator, but recorded - * alongside the original measurement. Only labels that were filtered out - * by the aggregator should be included - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; - */ - private $filtered_labels; - /** - * time_unix_nano is the exact time when this exemplar was recorded - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 2; - */ - private $time_unix_nano = 0; - /** - * Numerical int value of the measurement that was recorded. - * - * Generated from protobuf field sfixed64 value = 3; - */ - private $value = 0; - /** - * (Optional) Span ID of the exemplar trace. - * span_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * - * Generated from protobuf field bytes span_id = 4; - */ - private $span_id = ''; - /** - * (Optional) Trace ID of the exemplar trace. - * trace_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * - * Generated from protobuf field bytes trace_id = 5; - */ - private $trace_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $filtered_labels - * The set of labels that were filtered out by the aggregator, but recorded - * alongside the original measurement. Only labels that were filtered out - * by the aggregator should be included - * @type int|string $time_unix_nano - * time_unix_nano is the exact time when this exemplar was recorded - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * @type int|string $value - * Numerical int value of the measurement that was recorded. - * @type string $span_id - * (Optional) Span ID of the exemplar trace. - * span_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * @type string $trace_id - * (Optional) Trace ID of the exemplar trace. - * trace_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); - parent::__construct($data); - } - - /** - * The set of labels that were filtered out by the aggregator, but recorded - * alongside the original measurement. Only labels that were filtered out - * by the aggregator should be included - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFilteredLabels() - { - return $this->filtered_labels; - } - - /** - * The set of labels that were filtered out by the aggregator, but recorded - * alongside the original measurement. Only labels that were filtered out - * by the aggregator should be included - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; - * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFilteredLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); - $this->filtered_labels = $arr; - - return $this; - } - - /** - * time_unix_nano is the exact time when this exemplar was recorded - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 2; - * @return int|string - */ - public function getTimeUnixNano() - { - return $this->time_unix_nano; - } - - /** - * time_unix_nano is the exact time when this exemplar was recorded - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 2; - * @param int|string $var - * @return $this - */ - public function setTimeUnixNano($var) - { - GPBUtil::checkUint64($var); - $this->time_unix_nano = $var; - - return $this; - } - - /** - * Numerical int value of the measurement that was recorded. - * - * Generated from protobuf field sfixed64 value = 3; - * @return int|string - */ - public function getValue() - { - return $this->value; - } - - /** - * Numerical int value of the measurement that was recorded. - * - * Generated from protobuf field sfixed64 value = 3; - * @param int|string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkInt64($var); - $this->value = $var; - - return $this; - } - - /** - * (Optional) Span ID of the exemplar trace. - * span_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * - * Generated from protobuf field bytes span_id = 4; - * @return string - */ - public function getSpanId() - { - return $this->span_id; - } - - /** - * (Optional) Span ID of the exemplar trace. - * span_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * - * Generated from protobuf field bytes span_id = 4; - * @param string $var - * @return $this - */ - public function setSpanId($var) - { - GPBUtil::checkString($var, False); - $this->span_id = $var; - - return $this; - } - - /** - * (Optional) Trace ID of the exemplar trace. - * trace_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * - * Generated from protobuf field bytes trace_id = 5; - * @return string - */ - public function getTraceId() - { - return $this->trace_id; - } - - /** - * (Optional) Trace ID of the exemplar trace. - * trace_id may be missing if the measurement is not recorded inside a trace - * or if the trace is not sampled. - * - * Generated from protobuf field bytes trace_id = 5; - * @param string $var - * @return $this - */ - public function setTraceId($var) - { - GPBUtil::checkString($var, False); - $this->trace_id = $var; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php deleted file mode 100644 index 37fece6dd..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php +++ /dev/null @@ -1,60 +0,0 @@ -opentelemetry.proto.metrics.v1.IntGauge - */ -class IntGauge extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; - */ - private $data_points; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDataPoints() - { - return $this->data_points; - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; - * @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDataPoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class); - $this->data_points = $arr; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php deleted file mode 100644 index e0ab5e54a..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php +++ /dev/null @@ -1,99 +0,0 @@ -opentelemetry.proto.metrics.v1.IntHistogram - */ -class IntHistogram extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; - */ - private $data_points; - /** - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; - */ - private $aggregation_temporality = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points - * @type int $aggregation_temporality - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDataPoints() - { - return $this->data_points; - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; - * @param \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDataPoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint::class); - $this->data_points = $arr; - - return $this; - } - - /** - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; - * @return int - */ - public function getAggregationTemporality() - { - return $this->aggregation_temporality; - } - - /** - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; - * @param int $var - * @return $this - */ - public function setAggregationTemporality($var) - { - GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); - $this->aggregation_temporality = $var; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php deleted file mode 100644 index 301b26447..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php +++ /dev/null @@ -1,393 +0,0 @@ -opentelemetry.proto.metrics.v1.IntHistogramDataPoint - */ -class IntHistogramDataPoint extends \Google\Protobuf\Internal\Message -{ - /** - * The set of labels that uniquely identify this timeseries. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; - */ - private $labels; - /** - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 start_time_unix_nano = 2; - */ - private $start_time_unix_nano = 0; - /** - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 3; - */ - private $time_unix_nano = 0; - /** - * count is the number of values in the population. Must be non-negative. This - * value must be equal to the sum of the "count" fields in buckets if a - * histogram is provided. - * - * Generated from protobuf field fixed64 count = 4; - */ - private $count = 0; - /** - * sum of the values in the population. If count is zero then this field - * must be zero. This value must be equal to the sum of the "sum" fields in - * buckets if a histogram is provided. - * - * Generated from protobuf field sfixed64 sum = 5; - */ - private $sum = 0; - /** - * bucket_counts is an optional field contains the count values of histogram - * for each bucket. - * The sum of the bucket_counts must equal the value in the count field. - * The number of elements in bucket_counts array must be by one greater than - * the number of elements in explicit_bounds array. - * - * Generated from protobuf field repeated fixed64 bucket_counts = 6; - */ - private $bucket_counts; - /** - * explicit_bounds specifies buckets with explicitly defined bounds for values. - * The boundaries for bucket at index i are: - * (-infinity, explicit_bounds[i]] for i == 0 - * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) - * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) - * The values in the explicit_bounds array must be strictly increasing. - * Histogram buckets are inclusive of their upper boundary, except the last - * bucket where the boundary is at infinity. This format is intentionally - * compatible with the OpenMetrics histogram definition. - * - * Generated from protobuf field repeated double explicit_bounds = 7; - */ - private $explicit_bounds; - /** - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; - */ - private $exemplars; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels - * The set of labels that uniquely identify this timeseries. - * @type int|string $start_time_unix_nano - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * @type int|string $time_unix_nano - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * @type int|string $count - * count is the number of values in the population. Must be non-negative. This - * value must be equal to the sum of the "count" fields in buckets if a - * histogram is provided. - * @type int|string $sum - * sum of the values in the population. If count is zero then this field - * must be zero. This value must be equal to the sum of the "sum" fields in - * buckets if a histogram is provided. - * @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts - * bucket_counts is an optional field contains the count values of histogram - * for each bucket. - * The sum of the bucket_counts must equal the value in the count field. - * The number of elements in bucket_counts array must be by one greater than - * the number of elements in explicit_bounds array. - * @type float[]|\Google\Protobuf\Internal\RepeatedField $explicit_bounds - * explicit_bounds specifies buckets with explicitly defined bounds for values. - * The boundaries for bucket at index i are: - * (-infinity, explicit_bounds[i]] for i == 0 - * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) - * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) - * The values in the explicit_bounds array must be strictly increasing. - * Histogram buckets are inclusive of their upper boundary, except the last - * bucket where the boundary is at infinity. This format is intentionally - * compatible with the OpenMetrics histogram definition. - * @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); - parent::__construct($data); - } - - /** - * The set of labels that uniquely identify this timeseries. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * The set of labels that uniquely identify this timeseries. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; - * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); - $this->labels = $arr; - - return $this; - } - - /** - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 start_time_unix_nano = 2; - * @return int|string - */ - public function getStartTimeUnixNano() - { - return $this->start_time_unix_nano; - } - - /** - * StartTimeUnixNano is optional but strongly encouraged, see the - * the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 start_time_unix_nano = 2; - * @param int|string $var - * @return $this - */ - public function setStartTimeUnixNano($var) - { - GPBUtil::checkUint64($var); - $this->start_time_unix_nano = $var; - - return $this; - } - - /** - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 3; - * @return int|string - */ - public function getTimeUnixNano() - { - return $this->time_unix_nano; - } - - /** - * TimeUnixNano is required, see the detailed comments above Metric. - * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January - * 1970. - * - * Generated from protobuf field fixed64 time_unix_nano = 3; - * @param int|string $var - * @return $this - */ - public function setTimeUnixNano($var) - { - GPBUtil::checkUint64($var); - $this->time_unix_nano = $var; - - return $this; - } - - /** - * count is the number of values in the population. Must be non-negative. This - * value must be equal to the sum of the "count" fields in buckets if a - * histogram is provided. - * - * Generated from protobuf field fixed64 count = 4; - * @return int|string - */ - public function getCount() - { - return $this->count; - } - - /** - * count is the number of values in the population. Must be non-negative. This - * value must be equal to the sum of the "count" fields in buckets if a - * histogram is provided. - * - * Generated from protobuf field fixed64 count = 4; - * @param int|string $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkUint64($var); - $this->count = $var; - - return $this; - } - - /** - * sum of the values in the population. If count is zero then this field - * must be zero. This value must be equal to the sum of the "sum" fields in - * buckets if a histogram is provided. - * - * Generated from protobuf field sfixed64 sum = 5; - * @return int|string - */ - public function getSum() - { - return $this->sum; - } - - /** - * sum of the values in the population. If count is zero then this field - * must be zero. This value must be equal to the sum of the "sum" fields in - * buckets if a histogram is provided. - * - * Generated from protobuf field sfixed64 sum = 5; - * @param int|string $var - * @return $this - */ - public function setSum($var) - { - GPBUtil::checkInt64($var); - $this->sum = $var; - - return $this; - } - - /** - * bucket_counts is an optional field contains the count values of histogram - * for each bucket. - * The sum of the bucket_counts must equal the value in the count field. - * The number of elements in bucket_counts array must be by one greater than - * the number of elements in explicit_bounds array. - * - * Generated from protobuf field repeated fixed64 bucket_counts = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBucketCounts() - { - return $this->bucket_counts; - } - - /** - * bucket_counts is an optional field contains the count values of histogram - * for each bucket. - * The sum of the bucket_counts must equal the value in the count field. - * The number of elements in bucket_counts array must be by one greater than - * the number of elements in explicit_bounds array. - * - * Generated from protobuf field repeated fixed64 bucket_counts = 6; - * @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBucketCounts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FIXED64); - $this->bucket_counts = $arr; - - return $this; - } - - /** - * explicit_bounds specifies buckets with explicitly defined bounds for values. - * The boundaries for bucket at index i are: - * (-infinity, explicit_bounds[i]] for i == 0 - * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) - * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) - * The values in the explicit_bounds array must be strictly increasing. - * Histogram buckets are inclusive of their upper boundary, except the last - * bucket where the boundary is at infinity. This format is intentionally - * compatible with the OpenMetrics histogram definition. - * - * Generated from protobuf field repeated double explicit_bounds = 7; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExplicitBounds() - { - return $this->explicit_bounds; - } - - /** - * explicit_bounds specifies buckets with explicitly defined bounds for values. - * The boundaries for bucket at index i are: - * (-infinity, explicit_bounds[i]] for i == 0 - * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) - * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) - * The values in the explicit_bounds array must be strictly increasing. - * Histogram buckets are inclusive of their upper boundary, except the last - * bucket where the boundary is at infinity. This format is intentionally - * compatible with the OpenMetrics histogram definition. - * - * Generated from protobuf field repeated double explicit_bounds = 7; - * @param float[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExplicitBounds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); - $this->explicit_bounds = $arr; - - return $this; - } - - /** - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getExemplars() - { - return $this->exemplars; - } - - /** - * (Optional) List of exemplars collected from - * measurements that were used to form the data point - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; - * @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setExemplars($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class); - $this->exemplars = $arr; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php deleted file mode 100644 index d72d2bfd6..000000000 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php +++ /dev/null @@ -1,132 +0,0 @@ -opentelemetry.proto.metrics.v1.IntSum - */ -class IntSum extends \Google\Protobuf\Internal\Message -{ - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; - */ - private $data_points; - /** - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; - */ - private $aggregation_temporality = 0; - /** - * If "true" means that the sum is monotonic. - * - * Generated from protobuf field bool is_monotonic = 3; - */ - private $is_monotonic = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points - * @type int $aggregation_temporality - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * @type bool $is_monotonic - * If "true" means that the sum is monotonic. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); - parent::__construct($data); - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDataPoints() - { - return $this->data_points; - } - - /** - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; - * @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDataPoints($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class); - $this->data_points = $arr; - - return $this; - } - - /** - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; - * @return int - */ - public function getAggregationTemporality() - { - return $this->aggregation_temporality; - } - - /** - * aggregation_temporality describes if the aggregator reports delta changes - * since last report time, or cumulative changes since a fixed start time. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; - * @param int $var - * @return $this - */ - public function setAggregationTemporality($var) - { - GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); - $this->aggregation_temporality = $var; - - return $this; - } - - /** - * If "true" means that the sum is monotonic. - * - * Generated from protobuf field bool is_monotonic = 3; - * @return bool - */ - public function getIsMonotonic() - { - return $this->is_monotonic; - } - - /** - * If "true" means that the sum is monotonic. - * - * Generated from protobuf field bool is_monotonic = 3; - * @param bool $var - * @return $this - */ - public function setIsMonotonic($var) - { - GPBUtil::checkBool($var); - $this->is_monotonic = $var; - - return $this; - } - -} - diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/Metric.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/Metric.php index af68291b0..fc1cf5dbd 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/Metric.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/Metric.php @@ -90,20 +90,20 @@ class Metric extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1; */ - private $name = ''; + protected $name = ''; /** * description of the metric, which can be used in documentation. * * Generated from protobuf field string description = 2; */ - private $description = ''; + protected $description = ''; /** * unit in which the metric value is reported. Follows the format * described by http://unitsofmeasure.org/ucum.html. * * Generated from protobuf field string unit = 3; */ - private $unit = ''; + protected $unit = ''; protected $data; /** @@ -119,27 +119,8 @@ class Metric extends \Google\Protobuf\Internal\Message * @type string $unit * unit in which the metric value is reported. Follows the format * described by http://unitsofmeasure.org/ucum.html. - * @type \Opentelemetry\Proto\Metrics\V1\IntGauge $int_gauge - * IntGauge and IntSum are deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `int_gauge` and `int_sum` fields. - * 2. New senders, which are aware of this change MUST send only `gauge` - * and `sum` fields. - * 3. New receivers, which are aware of this change MUST convert these into - * `gauge` and `sum` by using the provided as_int field in the oneof values. - * This field will be removed in ~3 months, on July 1, 2021. * @type \Opentelemetry\Proto\Metrics\V1\Gauge $gauge - * @type \Opentelemetry\Proto\Metrics\V1\IntSum $int_sum - * This field will be removed in ~3 months, on July 1, 2021. * @type \Opentelemetry\Proto\Metrics\V1\Sum $sum - * @type \Opentelemetry\Proto\Metrics\V1\IntHistogram $int_histogram - * IntHistogram is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `int_histogram` field. - * 2. New senders, which are aware of this change MUST send only `histogram`. - * 3. New receivers, which are aware of this change MUST convert this into - * `histogram` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. * @type \Opentelemetry\Proto\Metrics\V1\Histogram $histogram * @type \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram $exponential_histogram * @type \Opentelemetry\Proto\Metrics\V1\Summary $summary @@ -230,55 +211,20 @@ public function setUnit($var) return $this; } - /** - * IntGauge and IntSum are deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `int_gauge` and `int_sum` fields. - * 2. New senders, which are aware of this change MUST send only `gauge` - * and `sum` fields. - * 3. New receivers, which are aware of this change MUST convert these into - * `gauge` and `sum` by using the provided as_int field in the oneof values. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.IntGauge int_gauge = 4 [deprecated = true]; - * @return \Opentelemetry\Proto\Metrics\V1\IntGauge - */ - public function getIntGauge() - { - return $this->readOneof(4); - } - - /** - * IntGauge and IntSum are deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `int_gauge` and `int_sum` fields. - * 2. New senders, which are aware of this change MUST send only `gauge` - * and `sum` fields. - * 3. New receivers, which are aware of this change MUST convert these into - * `gauge` and `sum` by using the provided as_int field in the oneof values. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.IntGauge int_gauge = 4 [deprecated = true]; - * @param \Opentelemetry\Proto\Metrics\V1\IntGauge $var - * @return $this - */ - public function setIntGauge($var) - { - GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\IntGauge::class); - $this->writeOneof(4, $var); - - return $this; - } - /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Gauge gauge = 5; - * @return \Opentelemetry\Proto\Metrics\V1\Gauge + * @return \Opentelemetry\Proto\Metrics\V1\Gauge|null */ public function getGauge() { return $this->readOneof(5); } + public function hasGauge() + { + return $this->hasOneof(5); + } + /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Gauge gauge = 5; * @param \Opentelemetry\Proto\Metrics\V1\Gauge $var @@ -292,41 +238,20 @@ public function setGauge($var) return $this; } - /** - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.IntSum int_sum = 6 [deprecated = true]; - * @return \Opentelemetry\Proto\Metrics\V1\IntSum - */ - public function getIntSum() - { - return $this->readOneof(6); - } - - /** - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.IntSum int_sum = 6 [deprecated = true]; - * @param \Opentelemetry\Proto\Metrics\V1\IntSum $var - * @return $this - */ - public function setIntSum($var) - { - GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\IntSum::class); - $this->writeOneof(6, $var); - - return $this; - } - /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Sum sum = 7; - * @return \Opentelemetry\Proto\Metrics\V1\Sum + * @return \Opentelemetry\Proto\Metrics\V1\Sum|null */ public function getSum() { return $this->readOneof(7); } + public function hasSum() + { + return $this->hasOneof(7); + } + /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Sum sum = 7; * @param \Opentelemetry\Proto\Metrics\V1\Sum $var @@ -340,53 +265,20 @@ public function setSum($var) return $this; } - /** - * IntHistogram is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `int_histogram` field. - * 2. New senders, which are aware of this change MUST send only `histogram`. - * 3. New receivers, which are aware of this change MUST convert this into - * `histogram` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.IntHistogram int_histogram = 8 [deprecated = true]; - * @return \Opentelemetry\Proto\Metrics\V1\IntHistogram - */ - public function getIntHistogram() - { - return $this->readOneof(8); - } - - /** - * IntHistogram is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `int_histogram` field. - * 2. New senders, which are aware of this change MUST send only `histogram`. - * 3. New receivers, which are aware of this change MUST convert this into - * `histogram` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field .opentelemetry.proto.metrics.v1.IntHistogram int_histogram = 8 [deprecated = true]; - * @param \Opentelemetry\Proto\Metrics\V1\IntHistogram $var - * @return $this - */ - public function setIntHistogram($var) - { - GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\IntHistogram::class); - $this->writeOneof(8, $var); - - return $this; - } - /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Histogram histogram = 9; - * @return \Opentelemetry\Proto\Metrics\V1\Histogram + * @return \Opentelemetry\Proto\Metrics\V1\Histogram|null */ public function getHistogram() { return $this->readOneof(9); } + public function hasHistogram() + { + return $this->hasOneof(9); + } + /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Histogram histogram = 9; * @param \Opentelemetry\Proto\Metrics\V1\Histogram $var @@ -402,13 +294,18 @@ public function setHistogram($var) /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10; - * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram + * @return \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram|null */ public function getExponentialHistogram() { return $this->readOneof(10); } + public function hasExponentialHistogram() + { + return $this->hasOneof(10); + } + /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.ExponentialHistogram exponential_histogram = 10; * @param \Opentelemetry\Proto\Metrics\V1\ExponentialHistogram $var @@ -424,13 +321,18 @@ public function setExponentialHistogram($var) /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Summary summary = 11; - * @return \Opentelemetry\Proto\Metrics\V1\Summary + * @return \Opentelemetry\Proto\Metrics\V1\Summary|null */ public function getSummary() { return $this->readOneof(11); } + public function hasSummary() + { + return $this->hasOneof(11); + } + /** * Generated from protobuf field .opentelemetry.proto.metrics.v1.Summary summary = 11; * @param \Opentelemetry\Proto\Metrics\V1\Summary $var diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php index 52d62b4bc..d9fa829e0 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/NumberDataPoint.php @@ -19,22 +19,12 @@ class NumberDataPoint extends \Google\Protobuf\Internal\Message /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; */ private $attributes; - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - */ - private $labels; /** * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -43,7 +33,7 @@ class NumberDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 start_time_unix_nano = 2; */ - private $start_time_unix_nano = 0; + protected $start_time_unix_nano = 0; /** * TimeUnixNano is required, see the detailed comments above Metric. * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -51,7 +41,7 @@ class NumberDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 time_unix_nano = 3; */ - private $time_unix_nano = 0; + protected $time_unix_nano = 0; /** * (Optional) List of exemplars collected from * measurements that were used to form the data point @@ -65,7 +55,7 @@ class NumberDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 flags = 8; */ - private $flags = 0; + protected $flags = 0; protected $value; /** @@ -77,14 +67,8 @@ class NumberDataPoint extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). - * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int|string $start_time_unix_nano * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -112,6 +96,8 @@ public function __construct($data = NULL) { /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; * @return \Google\Protobuf\Internal\RepeatedField @@ -124,6 +110,8 @@ public function getAttributes() /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var @@ -137,44 +125,6 @@ public function setAttributes($var) return $this; } - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); - $this->labels = $arr; - - return $this; - } - /** * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -246,6 +196,11 @@ public function getAsDouble() return $this->readOneof(4); } + public function hasAsDouble() + { + return $this->hasOneof(4); + } + /** * Generated from protobuf field double as_double = 4; * @param float $var @@ -268,6 +223,11 @@ public function getAsInt() return $this->readOneof(6); } + public function hasAsInt() + { + return $this->hasOneof(6); + } + /** * Generated from protobuf field sfixed64 as_int = 6; * @param int|string $var diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php index f8d8ca878..30bb5ef4e 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of InstrumentationLibraryMetrics from a Resource. + * A collection of ScopeMetrics from a Resource. * * Generated from protobuf message opentelemetry.proto.metrics.v1.ResourceMetrics */ @@ -21,21 +21,48 @@ class ResourceMetrics extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; */ - private $resource = null; + protected $resource = null; /** * A list of metrics that originate from a resource. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + */ + private $scope_metrics; + /** + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; + * @deprecated */ private $instrumentation_library_metrics; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; */ - private $schema_url = ''; + protected $schema_url = ''; /** * Constructor. @@ -46,12 +73,34 @@ class ResourceMetrics extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the metrics in this message. * If this field is not set then no resource info is known. - * @type \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_metrics + * @type \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $scope_metrics * A list of metrics that originate from a resource. + * @type \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_metrics + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * } */ public function __construct($data = NULL) { @@ -64,13 +113,23 @@ public function __construct($data = NULL) { * If this field is not set then no resource info is known. * * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; - * @return \Opentelemetry\Proto\Resource\V1\Resource + * @return \Opentelemetry\Proto\Resource\V1\Resource|null */ public function getResource() { return $this->resource; } + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + /** * The resource for the metrics in this message. * If this field is not set then no resource info is known. @@ -90,23 +149,95 @@ public function setResource($var) /** * A list of metrics that originate from a resource. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; * @return \Google\Protobuf\Internal\RepeatedField */ + public function getScopeMetrics() + { + return $this->scope_metrics; + } + + /** + * A list of metrics that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + * @param \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ScopeMetrics::class); + $this->scope_metrics = $arr; + + return $this; + } + + /** + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ public function getInstrumentationLibraryMetrics() { + @trigger_error('instrumentation_library_metrics is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_metrics; } /** - * A list of metrics that originate from a resource. + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; * @param \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setInstrumentationLibraryMetrics($var) { + @trigger_error('instrumentation_library_metrics is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics::class); $this->instrumentation_library_metrics = $arr; @@ -115,8 +246,7 @@ public function setInstrumentationLibraryMetrics($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -128,8 +258,7 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php new file mode 100644 index 000000000..71f5cdb86 --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/ScopeMetrics.php @@ -0,0 +1,153 @@ +opentelemetry.proto.metrics.v1.ScopeMetrics + */ +class ScopeMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + */ + protected $scope = null; + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + */ + private $metrics; + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationScope $scope + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * @type \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $metrics + * A list of metrics that originate from an instrumentation library. + * @type string $schema_url + * This schema_url applies to all metrics in the "metrics" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationScope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * The instrumentation scope information for the metrics in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationScope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationScope::class); + $this->scope = $var; + + return $this; + } + + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMetrics() + { + return $this->metrics; + } + + /** + * A list of metrics that originate from an instrumentation library. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2; + * @param \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Metric::class); + $this->metrics = $arr; + + return $this; + } + + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all metrics in the "metrics" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/Sum.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/Sum.php index 80dfe6b6e..0251ecd9f 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/Sum.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/Sum.php @@ -26,13 +26,13 @@ class Sum extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; */ - private $aggregation_temporality = 0; + protected $aggregation_temporality = 0; /** * If "true" means that the sum is monotonic. * * Generated from protobuf field bool is_monotonic = 3; */ - private $is_monotonic = false; + protected $is_monotonic = false; /** * Constructor. diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php index 91957656f..30cf4ade4 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint.php @@ -19,22 +19,12 @@ class SummaryDataPoint extends \Google\Protobuf\Internal\Message /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; */ private $attributes; - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - */ - private $labels; /** * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -43,7 +33,7 @@ class SummaryDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 start_time_unix_nano = 2; */ - private $start_time_unix_nano = 0; + protected $start_time_unix_nano = 0; /** * TimeUnixNano is required, see the detailed comments above Metric. * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January @@ -51,13 +41,13 @@ class SummaryDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 time_unix_nano = 3; */ - private $time_unix_nano = 0; + protected $time_unix_nano = 0; /** * count is the number of values in the population. Must be non-negative. * * Generated from protobuf field fixed64 count = 4; */ - private $count = 0; + protected $count = 0; /** * sum of the values in the population. If count is zero then this field * must be zero. @@ -69,7 +59,7 @@ class SummaryDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double sum = 5; */ - private $sum = 0.0; + protected $sum = 0.0; /** * (Optional) list of values at different quantiles of the distribution calculated * from the current snapshot. The quantiles must be strictly increasing. @@ -83,7 +73,7 @@ class SummaryDataPoint extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 flags = 8; */ - private $flags = 0; + protected $flags = 0; /** * Constructor. @@ -94,14 +84,8 @@ class SummaryDataPoint extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). - * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int|string $start_time_unix_nano * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. @@ -137,6 +121,8 @@ public function __construct($data = NULL) { /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; * @return \Google\Protobuf\Internal\RepeatedField @@ -149,6 +135,8 @@ public function getAttributes() /** * The set of key/value pairs that uniquely identify the timeseries from * where this point belongs. The list may be empty (may contain 0 elements). + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 7; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var @@ -162,44 +150,6 @@ public function setAttributes($var) return $this; } - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Labels is deprecated and will be removed soon. - * 1. Old senders and receivers that are not aware of this change will - * continue using the `labels` field. - * 2. New senders, which are aware of this change MUST send only `attributes`. - * 3. New receivers, which are aware of this change MUST convert this into - * `labels` by simply converting all int64 values into float. - * This field will be removed in ~3 months, on July 1, 2021. - * - * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1 [deprecated = true]; - * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); - $this->labels = $arr; - - return $this; - } - /** * StartTimeUnixNano is optional but strongly encouraged, see the * the detailed comments above Metric. diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php index e08e46d97..8200b6d26 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/SummaryDataPoint/ValueAtQuantile.php @@ -26,14 +26,14 @@ class ValueAtQuantile extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double quantile = 1; */ - private $quantile = 0.0; + protected $quantile = 0.0; /** * The value at the given quantile of a distribution. * Quantile values must NOT be negative. * * Generated from protobuf field double value = 2; */ - private $value = 0.0; + protected $value = 0.0; /** * Constructor. diff --git a/proto/otel/Opentelemetry/Proto/Resource/V1/Resource.php b/proto/otel/Opentelemetry/Proto/Resource/V1/Resource.php index 485bcdd60..d9062eeb1 100644 --- a/proto/otel/Opentelemetry/Proto/Resource/V1/Resource.php +++ b/proto/otel/Opentelemetry/Proto/Resource/V1/Resource.php @@ -16,7 +16,9 @@ class Resource extends \Google\Protobuf\Internal\Message { /** - * Set of labels that describe the resource. + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; */ @@ -27,7 +29,7 @@ class Resource extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 dropped_attributes_count = 2; */ - private $dropped_attributes_count = 0; + protected $dropped_attributes_count = 0; /** * Constructor. @@ -36,7 +38,9 @@ class Resource extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes - * Set of labels that describe the resource. + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int $dropped_attributes_count * dropped_attributes_count is the number of dropped attributes. If the value is 0, then * no attributes were dropped. @@ -48,7 +52,9 @@ public function __construct($data = NULL) { } /** - * Set of labels that describe the resource. + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -59,7 +65,9 @@ public function getAttributes() } /** - * Set of labels that describe the resource. + * Set of attributes that describe the resource. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler.php b/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler.php index 16fc1969b..c21482623 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler.php @@ -18,7 +18,7 @@ class ConstantSampler extends \Google\Protobuf\Internal\Message /** * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1; */ - private $decision = 0; + protected $decision = 0; /** * Constructor. @@ -50,7 +50,7 @@ public function getDecision() */ public function setDecision($var) { - GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\ConstantSampler_ConstantDecision::class); + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\ConstantSampler\ConstantDecision::class); $this->decision = $var; return $this; diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php b/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php index 134ed56c2..04c1950ca 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/ConstantSampler/ConstantDecision.php @@ -4,6 +4,8 @@ namespace Opentelemetry\Proto\Trace\V1\ConstantSampler; +use UnexpectedValueException; + /** * How spans should be sampled: * - Always off @@ -26,6 +28,32 @@ class ConstantDecision * Generated from protobuf enum ALWAYS_PARENT = 2; */ const ALWAYS_PARENT = 2; + + private static $valueToName = [ + self::ALWAYS_OFF => 'ALWAYS_OFF', + self::ALWAYS_ON => 'ALWAYS_ON', + self::ALWAYS_PARENT => 'ALWAYS_PARENT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php b/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php index 926eb6916..c5cc122e7 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php @@ -10,6 +10,9 @@ /** * A collection of Spans produced by an InstrumentationLibrary. + * InstrumentationLibrarySpans is wire-compatible with ScopeSpans for binary + * Protobuf format. + * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.trace.v1.InstrumentationLibrarySpans */ @@ -22,7 +25,7 @@ class InstrumentationLibrarySpans extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; */ - private $instrumentation_library = null; + protected $instrumentation_library = null; /** * A list of Spans that originate from an instrumentation library. * @@ -34,7 +37,7 @@ class InstrumentationLibrarySpans extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string schema_url = 3; */ - private $schema_url = ''; + protected $schema_url = ''; /** * Constructor. @@ -63,13 +66,23 @@ public function __construct($data = NULL) { * an empty instrumentation library name (unknown). * * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1; - * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary + * @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary|null */ public function getInstrumentationLibrary() { return $this->instrumentation_library; } + public function hasInstrumentationLibrary() + { + return isset($this->instrumentation_library); + } + + public function clearInstrumentationLibrary() + { + unset($this->instrumentation_library); + } + /** * The instrumentation library information for the spans in this message. * Semantically when InstrumentationLibrary isn't set, it is equivalent with diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php b/proto/otel/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php index e55d2fc4c..3fd17fb01 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/RateLimitingSampler.php @@ -20,7 +20,7 @@ class RateLimitingSampler extends \Google\Protobuf\Internal\Message * * Generated from protobuf field int64 qps = 1; */ - private $qps = 0; + protected $qps = 0; /** * Constructor. diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php b/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php index c8635b326..4c9227480 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of InstrumentationLibrarySpans from a Resource. + * A collection of ScopeSpans from a Resource. * * Generated from protobuf message opentelemetry.proto.trace.v1.ResourceSpans */ @@ -21,21 +21,48 @@ class ResourceSpans extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; */ - private $resource = null; + protected $resource = null; + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + */ + private $scope_spans; /** * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; + * @deprecated */ private $instrumentation_library_spans; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; */ - private $schema_url = ''; + protected $schema_url = ''; /** * Constructor. @@ -46,12 +73,34 @@ class ResourceSpans extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the spans in this message. * If this field is not set then no resource info is known. + * @type \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $scope_spans + * A list of ScopeSpans that originate from a resource. * @type \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_spans * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * } */ public function __construct($data = NULL) { @@ -64,13 +113,23 @@ public function __construct($data = NULL) { * If this field is not set then no resource info is known. * * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; - * @return \Opentelemetry\Proto\Resource\V1\Resource + * @return \Opentelemetry\Proto\Resource\V1\Resource|null */ public function getResource() { return $this->resource; } + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + /** * The resource for the spans in this message. * If this field is not set then no resource info is known. @@ -87,26 +146,98 @@ public function setResource($var) return $this; } + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeSpans() + { + return $this->scope_spans; + } + + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + * @param \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\ScopeSpans::class); + $this->scope_spans = $arr; + + return $this; + } + /** * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated */ public function getInstrumentationLibrarySpans() { + @trigger_error('instrumentation_library_spans is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_spans; } /** * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; * @param \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setInstrumentationLibrarySpans($var) { + @trigger_error('instrumentation_library_spans is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans::class); $this->instrumentation_library_spans = $arr; @@ -115,8 +246,7 @@ public function setInstrumentationLibrarySpans($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -128,8 +258,7 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/ScopeSpans.php b/proto/otel/Opentelemetry/Proto/Trace/V1/ScopeSpans.php new file mode 100644 index 000000000..098376f7d --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/ScopeSpans.php @@ -0,0 +1,153 @@ +opentelemetry.proto.trace.v1.ScopeSpans + */ +class ScopeSpans extends \Google\Protobuf\Internal\Message +{ + /** + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + */ + protected $scope = null; + /** + * A list of Spans that originate from an instrumentation scope. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + */ + private $spans; + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + */ + protected $schema_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\InstrumentationScope $scope + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * @type \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $spans + * A list of Spans that originate from an instrumentation scope. + * @type string $schema_url + * This schema_url applies to all spans and span events in the "spans" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce(); + parent::__construct($data); + } + + /** + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @return \Opentelemetry\Proto\Common\V1\InstrumentationScope|null + */ + public function getScope() + { + return $this->scope; + } + + public function hasScope() + { + return isset($this->scope); + } + + public function clearScope() + { + unset($this->scope); + } + + /** + * The instrumentation scope information for the spans in this message. + * Semantically when InstrumentationScope isn't set, it is equivalent with + * an empty instrumentation scope name (unknown). + * + * Generated from protobuf field .opentelemetry.proto.common.v1.InstrumentationScope scope = 1; + * @param \Opentelemetry\Proto\Common\V1\InstrumentationScope $var + * @return $this + */ + public function setScope($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationScope::class); + $this->scope = $var; + + return $this; + } + + /** + * A list of Spans that originate from an instrumentation scope. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpans() + { + return $this->spans; + } + + /** + * A list of Spans that originate from an instrumentation scope. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.Span spans = 2; + * @param \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span::class); + $this->spans = $arr; + + return $this; + } + + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + * @return string + */ + public function getSchemaUrl() + { + return $this->schema_url; + } + + /** + * This schema_url applies to all spans and span events in the "spans" field. + * + * Generated from protobuf field string schema_url = 3; + * @param string $var + * @return $this + */ + public function setSchemaUrl($var) + { + GPBUtil::checkString($var, True); + $this->schema_url = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Span.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Span.php index f6bd70249..7b823d4d9 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Span.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Span.php @@ -32,7 +32,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes trace_id = 1; */ - private $trace_id = ''; + protected $trace_id = ''; /** * A unique identifier for a span within a trace, assigned when the span * is created. The ID is an 8-byte array. An ID with all zeroes is considered @@ -43,7 +43,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes span_id = 2; */ - private $span_id = ''; + protected $span_id = ''; /** * trace_state conveys information about request position in multiple distributed tracing graphs. * It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header @@ -51,14 +51,14 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string trace_state = 3; */ - private $trace_state = ''; + protected $trace_state = ''; /** * The `span_id` of this span's parent span. If this is a root span, then this * field must be empty. The ID is an 8-byte array. * * Generated from protobuf field bytes parent_span_id = 4; */ - private $parent_span_id = ''; + protected $parent_span_id = ''; /** * A description of the span's operation. * For example, the name can be a qualified method name or a file name @@ -71,7 +71,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 5; */ - private $name = ''; + protected $name = ''; /** * Distinguishes between spans generated in a particular context. For example, * two spans with the same name may be distinguished using `CLIENT` (caller) @@ -79,7 +79,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .opentelemetry.proto.trace.v1.Span.SpanKind kind = 6; */ - private $kind = 0; + protected $kind = 0; /** * start_time_unix_nano is the start time of the span. On the client side, this is the time * kept by the local machine where the span execution starts. On the server side, this @@ -89,7 +89,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 start_time_unix_nano = 7; */ - private $start_time_unix_nano = 0; + protected $start_time_unix_nano = 0; /** * end_time_unix_nano is the end time of the span. On the client side, this is the time * kept by the local machine where the span execution ends. On the server side, this @@ -99,7 +99,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 end_time_unix_nano = 8; */ - private $end_time_unix_nano = 0; + protected $end_time_unix_nano = 0; /** * attributes is a collection of key/value pairs. Note, global attributes * like server name can be set using the resource API. Examples of attributes: @@ -109,6 +109,8 @@ class Span extends \Google\Protobuf\Internal\Message * "abc.com/score": 10.239 * The OpenTelemetry API specification further restricts the allowed value types: * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; */ @@ -120,7 +122,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 dropped_attributes_count = 10; */ - private $dropped_attributes_count = 0; + protected $dropped_attributes_count = 0; /** * events is a collection of Event items. * @@ -133,7 +135,7 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 dropped_events_count = 12; */ - private $dropped_events_count = 0; + protected $dropped_events_count = 0; /** * links is a collection of Links, which are references from this span to a span * in the same or different trace. @@ -147,14 +149,14 @@ class Span extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 dropped_links_count = 14; */ - private $dropped_links_count = 0; + protected $dropped_links_count = 0; /** * An optional final status for this span. Semantically when Status isn't set, it means * span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). * * Generated from protobuf field .opentelemetry.proto.trace.v1.Status status = 15; */ - private $status = null; + protected $status = null; /** * Constructor. @@ -217,6 +219,8 @@ class Span extends \Google\Protobuf\Internal\Message * "abc.com/score": 10.239 * The OpenTelemetry API specification further restricts the allowed value types: * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int $dropped_attributes_count * dropped_attributes_count is the number of attributes that were discarded. Attributes * can be discarded because their keys are too long or because there are too many @@ -436,7 +440,7 @@ public function getKind() */ public function setKind($var) { - GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Span_SpanKind::class); + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Span\SpanKind::class); $this->kind = $var; return $this; @@ -519,6 +523,8 @@ public function setEndTimeUnixNano($var) * "abc.com/score": 10.239 * The OpenTelemetry API specification further restricts the allowed value types: * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; * @return \Google\Protobuf\Internal\RepeatedField @@ -537,6 +543,8 @@ public function getAttributes() * "abc.com/score": 10.239 * The OpenTelemetry API specification further restricts the allowed value types: * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/common.md#attributes + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var @@ -695,13 +703,23 @@ public function setDroppedLinksCount($var) * span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). * * Generated from protobuf field .opentelemetry.proto.trace.v1.Status status = 15; - * @return \Opentelemetry\Proto\Trace\V1\Status + * @return \Opentelemetry\Proto\Trace\V1\Status|null */ public function getStatus() { return $this->status; } + public function hasStatus() + { + return isset($this->status); + } + + public function clearStatus() + { + unset($this->status); + } + /** * An optional final status for this span. Semantically when Status isn't set, it means * span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Event.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Event.php index 8206a8123..c6b7a1807 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Event.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Event.php @@ -21,16 +21,18 @@ class Event extends \Google\Protobuf\Internal\Message * * Generated from protobuf field fixed64 time_unix_nano = 1; */ - private $time_unix_nano = 0; + protected $time_unix_nano = 0; /** * name of the event. * This field is semantically required to be set to non-empty string. * * Generated from protobuf field string name = 2; */ - private $name = ''; + protected $name = ''; /** * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; */ @@ -41,7 +43,7 @@ class Event extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 dropped_attributes_count = 4; */ - private $dropped_attributes_count = 0; + protected $dropped_attributes_count = 0; /** * Constructor. @@ -56,6 +58,8 @@ class Event extends \Google\Protobuf\Internal\Message * This field is semantically required to be set to non-empty string. * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int $dropped_attributes_count * dropped_attributes_count is the number of dropped attributes. If the value is 0, * then no attributes were dropped. @@ -122,6 +126,8 @@ public function setName($var) /** * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; * @return \Google\Protobuf\Internal\RepeatedField @@ -133,6 +139,8 @@ public function getAttributes() /** * attributes is a collection of attribute key/value pairs on the event. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Link.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Link.php index 1b4083d11..3096739de 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Link.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Span/Link.php @@ -24,21 +24,23 @@ class Link extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bytes trace_id = 1; */ - private $trace_id = ''; + protected $trace_id = ''; /** * A unique identifier for the linked span. The ID is an 8-byte array. * * Generated from protobuf field bytes span_id = 2; */ - private $span_id = ''; + protected $span_id = ''; /** * The trace_state associated with the link. * * Generated from protobuf field string trace_state = 3; */ - private $trace_state = ''; + protected $trace_state = ''; /** * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4; */ @@ -49,7 +51,7 @@ class Link extends \Google\Protobuf\Internal\Message * * Generated from protobuf field uint32 dropped_attributes_count = 5; */ - private $dropped_attributes_count = 0; + protected $dropped_attributes_count = 0; /** * Constructor. @@ -66,6 +68,8 @@ class Link extends \Google\Protobuf\Internal\Message * The trace_state associated with the link. * @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * @type int $dropped_attributes_count * dropped_attributes_count is the number of dropped attributes. If the value is 0, * then no attributes were dropped. @@ -158,6 +162,8 @@ public function setTraceState($var) /** * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4; * @return \Google\Protobuf\Internal\RepeatedField @@ -169,6 +175,8 @@ public function getAttributes() /** * attributes is a collection of attribute key/value pairs on the link. + * Attribute keys MUST be unique (it is not allowed to have more than one + * attribute with the same key). * * Generated from protobuf field repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4; * @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php index edb6751b6..9ffa93719 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Span/SpanKind.php @@ -4,6 +4,8 @@ namespace Opentelemetry\Proto\Trace\V1\Span; +use UnexpectedValueException; + /** * SpanKind is the type of span. Can be used to specify additional relationships between spans * in addition to a parent/child relationship. @@ -56,6 +58,35 @@ class SpanKind * Generated from protobuf enum SPAN_KIND_CONSUMER = 5; */ const SPAN_KIND_CONSUMER = 5; + + private static $valueToName = [ + self::SPAN_KIND_UNSPECIFIED => 'SPAN_KIND_UNSPECIFIED', + self::SPAN_KIND_INTERNAL => 'SPAN_KIND_INTERNAL', + self::SPAN_KIND_SERVER => 'SPAN_KIND_SERVER', + self::SPAN_KIND_CLIENT => 'SPAN_KIND_CLIENT', + self::SPAN_KIND_PRODUCER => 'SPAN_KIND_PRODUCER', + self::SPAN_KIND_CONSUMER => 'SPAN_KIND_CONSUMER', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Status.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Status.php index 0fbd2ca52..5fee7292e 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Status.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Status.php @@ -16,28 +16,18 @@ */ class Status extends \Google\Protobuf\Internal\Message { - /** - * The deprecated status code. This is an optional field. - * This field is deprecated and is replaced by the `code` field below. See backward - * compatibility notes below. According to our stability guarantees this field - * will be removed in 12 months, on Oct 22, 2021. All usage of old senders and - * receivers that do not understand the `code` field MUST be phased out by then. - * - * Generated from protobuf field .opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode deprecated_code = 1 [deprecated = true]; - */ - private $deprecated_code = 0; /** * A developer-facing human readable error message. * * Generated from protobuf field string message = 2; */ - private $message = ''; + protected $message = ''; /** * The status code. * * Generated from protobuf field .opentelemetry.proto.trace.v1.Status.StatusCode code = 3; */ - private $code = 0; + protected $code = 0; /** * Constructor. @@ -45,12 +35,6 @@ class Status extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @type int $deprecated_code - * The deprecated status code. This is an optional field. - * This field is deprecated and is replaced by the `code` field below. See backward - * compatibility notes below. According to our stability guarantees this field - * will be removed in 12 months, on Oct 22, 2021. All usage of old senders and - * receivers that do not understand the `code` field MUST be phased out by then. * @type string $message * A developer-facing human readable error message. * @type int $code @@ -62,40 +46,6 @@ public function __construct($data = NULL) { parent::__construct($data); } - /** - * The deprecated status code. This is an optional field. - * This field is deprecated and is replaced by the `code` field below. See backward - * compatibility notes below. According to our stability guarantees this field - * will be removed in 12 months, on Oct 22, 2021. All usage of old senders and - * receivers that do not understand the `code` field MUST be phased out by then. - * - * Generated from protobuf field .opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode deprecated_code = 1 [deprecated = true]; - * @return int - */ - public function getDeprecatedCode() - { - return $this->deprecated_code; - } - - /** - * The deprecated status code. This is an optional field. - * This field is deprecated and is replaced by the `code` field below. See backward - * compatibility notes below. According to our stability guarantees this field - * will be removed in 12 months, on Oct 22, 2021. All usage of old senders and - * receivers that do not understand the `code` field MUST be phased out by then. - * - * Generated from protobuf field .opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode deprecated_code = 1 [deprecated = true]; - * @param int $var - * @return $this - */ - public function setDeprecatedCode($var) - { - GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode::class); - $this->deprecated_code = $var; - - return $this; - } - /** * A developer-facing human readable error message. * @@ -142,7 +92,7 @@ public function getCode() */ public function setCode($var) { - GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Status_StatusCode::class); + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Status\StatusCode::class); $this->code = $var; return $this; diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php deleted file mode 100644 index a16570f3e..000000000 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php +++ /dev/null @@ -1,84 +0,0 @@ -opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode - */ -class DeprecatedStatusCode -{ - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_OK = 0; - */ - const DEPRECATED_STATUS_CODE_OK = 0; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_CANCELLED = 1; - */ - const DEPRECATED_STATUS_CODE_CANCELLED = 1; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2; - */ - const DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3; - */ - const DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4; - */ - const DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_NOT_FOUND = 5; - */ - const DEPRECATED_STATUS_CODE_NOT_FOUND = 5; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6; - */ - const DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7; - */ - const DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8; - */ - const DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9; - */ - const DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_ABORTED = 10; - */ - const DEPRECATED_STATUS_CODE_ABORTED = 10; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11; - */ - const DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12; - */ - const DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13; - */ - const DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNAVAILABLE = 14; - */ - const DEPRECATED_STATUS_CODE_UNAVAILABLE = 14; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_DATA_LOSS = 15; - */ - const DEPRECATED_STATUS_CODE_DATA_LOSS = 15; - /** - * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16; - */ - const DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16; -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(DeprecatedStatusCode::class, \Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode::class); - diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php index ae6959550..0ce2d1638 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Status/StatusCode.php @@ -4,6 +4,8 @@ namespace Opentelemetry\Proto\Trace\V1\Status; +use UnexpectedValueException; + /** * For the semantics of status codes see * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status @@ -31,6 +33,32 @@ class StatusCode * Generated from protobuf enum STATUS_CODE_ERROR = 2; */ const STATUS_CODE_ERROR = 2; + + private static $valueToName = [ + self::STATUS_CODE_UNSET => 'STATUS_CODE_UNSET', + self::STATUS_CODE_OK => 'STATUS_CODE_OK', + self::STATUS_CODE_ERROR => 'STATUS_CODE_ERROR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php deleted file mode 100644 index 2235d5b7d..000000000 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php +++ /dev/null @@ -1,16 +0,0 @@ -int64 max_number_of_attributes = 4; */ - private $max_number_of_attributes = 0; + protected $max_number_of_attributes = 0; /** * The global default max number of annotation events per span. * * Generated from protobuf field int64 max_number_of_timed_events = 5; */ - private $max_number_of_timed_events = 0; + protected $max_number_of_timed_events = 0; /** * The global default max number of attributes per timed event. * * Generated from protobuf field int64 max_number_of_attributes_per_timed_event = 6; */ - private $max_number_of_attributes_per_timed_event = 0; + protected $max_number_of_attributes_per_timed_event = 0; /** * The global default max number of link entries per span. * * Generated from protobuf field int64 max_number_of_links = 7; */ - private $max_number_of_links = 0; + protected $max_number_of_links = 0; /** * The global default max number of attributes per span. * * Generated from protobuf field int64 max_number_of_attributes_per_link = 8; */ - private $max_number_of_attributes_per_link = 0; + protected $max_number_of_attributes_per_link = 0; protected $sampler; /** @@ -76,13 +76,18 @@ public function __construct($data = NULL) { /** * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler constant_sampler = 1; - * @return \Opentelemetry\Proto\Trace\V1\ConstantSampler + * @return \Opentelemetry\Proto\Trace\V1\ConstantSampler|null */ public function getConstantSampler() { return $this->readOneof(1); } + public function hasConstantSampler() + { + return $this->hasOneof(1); + } + /** * Generated from protobuf field .opentelemetry.proto.trace.v1.ConstantSampler constant_sampler = 1; * @param \Opentelemetry\Proto\Trace\V1\ConstantSampler $var @@ -98,13 +103,18 @@ public function setConstantSampler($var) /** * Generated from protobuf field .opentelemetry.proto.trace.v1.TraceIdRatioBased trace_id_ratio_based = 2; - * @return \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased + * @return \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased|null */ public function getTraceIdRatioBased() { return $this->readOneof(2); } + public function hasTraceIdRatioBased() + { + return $this->hasOneof(2); + } + /** * Generated from protobuf field .opentelemetry.proto.trace.v1.TraceIdRatioBased trace_id_ratio_based = 2; * @param \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased $var @@ -120,13 +130,18 @@ public function setTraceIdRatioBased($var) /** * Generated from protobuf field .opentelemetry.proto.trace.v1.RateLimitingSampler rate_limiting_sampler = 3; - * @return \Opentelemetry\Proto\Trace\V1\RateLimitingSampler + * @return \Opentelemetry\Proto\Trace\V1\RateLimitingSampler|null */ public function getRateLimitingSampler() { return $this->readOneof(3); } + public function hasRateLimitingSampler() + { + return $this->hasOneof(3); + } + /** * Generated from protobuf field .opentelemetry.proto.trace.v1.RateLimitingSampler rate_limiting_sampler = 3; * @param \Opentelemetry\Proto\Trace\V1\RateLimitingSampler $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php b/proto/otel/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php index cf958f022..a04435c36 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/TraceIdRatioBased.php @@ -21,7 +21,7 @@ class TraceIdRatioBased extends \Google\Protobuf\Internal\Message * * Generated from protobuf field double samplingRatio = 1; */ - private $samplingRatio = 0.0; + protected $samplingRatio = 0.0; /** * Constructor. diff --git a/proto/otel/VERSION b/proto/otel/VERSION index fd2726c91..cfe6c0094 100644 --- a/proto/otel/VERSION +++ b/proto/otel/VERSION @@ -1 +1 @@ -v0.11.0 +v0.16.0 diff --git a/script/proto_gen.sh b/script/proto_gen.sh index 71851b9e8..2c5fbc4c9 100755 --- a/script/proto_gen.sh +++ b/script/proto_gen.sh @@ -1,31 +1,36 @@ -apk update && apk add git - -DESTINATION_DIR=/mnt/proto/otel +#!/usr/bin/env bash +DESTINATION_DIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")/../proto/otel +GPBMETA_DIR="GPBMetadata" +OTEL_DIR="Opentelemetry" REPO_DIR=opentelemetry-proto -mkdir -p $DESTINATION_DIR -rm -R ./$REPO_DIR -git clone https://github.com/open-telemetry/$REPO_DIR - -TAG=$( - # shellcheck disable=SC2164 - cd ./$REPO_DIR - - # shellcheck disable=SC2046 - # shellcheck disable=SC2006 - TAG=$(git describe --tags `git rev-list --tags --max-count=1`) +cd "${DESTINATION_DIR}" || exit +rm -rf ./${REPO_DIR} +git clone https://github.com/open-telemetry/${REPO_DIR} - git checkout "${TAG}" +for dir in ${REPO_DIR} +do + ( + cd ${dir} + TAG=$( + TAG=$(git describe --tags `git rev-list --tags --max-count=1`) - echo "$TAG" -) + git checkout "${TAG}" -echo "Generating protobuf files for version $TAG ..." + echo "${TAG}" + ) -# shellcheck disable=SC2046 -protoc --proto_path=$REPO_DIR/ --php_out=$DESTINATION_DIR --grpc_out=$DESTINATION_DIR \ - --plugin=protoc-gen-grpc=usr/local/bin/grpc_php_plugin $(find $REPO_DIR/opentelemetry/proto -iname "*.proto") + echo "Generating protobuf files for version ${TAG} ..." + make gen-php + rm -rf ${GPBMETA_DIR} ${OTEL_DIR} + echo "${TAG}" > "${DESTINATION_DIR}/VERSION" + ) +done -echo "$TAG" > $DESTINATION_DIR/VERSION +echo "Copying generated source..." +cp -r ${REPO_DIR}/gen/php/${GPBMETA_DIR} . +cp -r ${REPO_DIR}/gen/php/${OTEL_DIR} . +echo "Cleaning up..." +rm -rf ./${REPO_DIR} echo "Done!" From 062179e89a403e61e30e293dc19632d991c743a5 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Mon, 25 Apr 2022 22:48:00 +1000 Subject: [PATCH 2/5] downgrade protobuf interfaces to 0.14.0 this is the latest version that seems to work with out grpc exporter, further investigation required for 0.15.0+ --- .../Opentelemetry/Proto/Common/V1/Common.php | Bin 1343 -> 1284 bytes .../Opentelemetry/Proto/Logs/V1/Logs.php | Bin 2777 -> 2557 bytes .../Experimental/MetricsConfigService.php | Bin 0 -> 1714 bytes .../Proto/Metrics/V1/Metrics.php | Bin 4620 -> 4367 bytes .../Opentelemetry/Proto/Trace/V1/Trace.php | Bin 2792 -> 2566 bytes .../Common/V1/InstrumentationLibrary.php | 13 +- .../Proto/Common/V1/StringKeyValue.php | 88 ++++ .../Logs/V1/InstrumentationLibraryLogs.php | 11 +- .../Opentelemetry/Proto/Logs/V1/LogRecord.php | 55 +++ .../Proto/Logs/V1/ResourceLogs.php | 143 +------ .../Experimental/MetricConfigRequest.php | 113 +++++ .../Experimental/MetricConfigResponse.php | 201 +++++++++ .../MetricConfigResponse/Schedule.php | 149 +++++++ .../MetricConfigResponse/Schedule/Pattern.php | 113 +++++ .../MetricConfigResponse_Schedule.php | 16 + .../MetricConfigResponse_Schedule_Pattern.php | 16 + .../Proto/Metrics/V1/HistogramDataPoint.php | 20 +- .../V1/InstrumentationLibraryMetrics.php | 3 - .../Proto/Metrics/V1/IntDataPoint.php | 227 ++++++++++ .../Proto/Metrics/V1/IntExemplar.php | 235 +++++++++++ .../Proto/Metrics/V1/IntGauge.php | 60 +++ .../Proto/Metrics/V1/IntHistogram.php | 99 +++++ .../Metrics/V1/IntHistogramDataPoint.php | 393 ++++++++++++++++++ .../Opentelemetry/Proto/Metrics/V1/IntSum.php | 132 ++++++ .../Proto/Metrics/V1/ResourceMetrics.php | 147 +------ .../Trace/V1/InstrumentationLibrarySpans.php | 3 - .../Proto/Trace/V1/ResourceSpans.php | 143 +------ .../Trace/V1/Status/DeprecatedStatusCode.php | 126 ++++++ .../Trace/V1/Status_DeprecatedStatusCode.php | 16 + proto/otel/VERSION | 2 +- 30 files changed, 2092 insertions(+), 432 deletions(-) create mode 100644 proto/otel/GPBMetadata/Opentelemetry/Proto/Metrics/Experimental/MetricsConfigService.php create mode 100644 proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule_Pattern.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php create mode 100644 proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php create mode 100644 proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php create mode 100644 proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Common/V1/Common.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Common/V1/Common.php index 6b973ada671fd8603ba753109f769d8c9819ed87..da0a19d969501dfae341ae78ba2a7c66b44f1b3a 100644 GIT binary patch delta 30 mcmdnb)xx#mAtTF8RxYiH-ddaanS_}b%_l3fm`|R{vI+o_00`ay delta 59 zcmZqS+RwG&AtTEaHZHA+-ddaanS_}bttTt9n9Eo(NiZsza*2566_*s1=BDPAB$j06 P=LIL{7o<+MW;qD};(-yD diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Logs/V1/Logs.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Logs/V1/Logs.php index a7e879307b6b27bf252d2e78439794eef875377e..6e46cccbb38be76120d223d24c7ac3568f8f10fe 100644 GIT binary patch delta 82 zcmV-Y0ImPo75x*iYXSnv4wG#H!~wpOG6PKkU6Z^69{~cB-2*+7!2}fq#Q_Q$k^~x) o^aQB_BKwo01)~uV3IuLpZDkk)AOR=|LIM~8lSKx~vlR!#18%<=CIA2c delta 190 zcmew>d{cBoHWSlQfyuc{M;QN4He&V_wc_F`PR=h#jnBzXFP30ZVAkL^Qk&esDmvMK zm6Ho3;{%isN}AljEYI|UeewckTXQES2}U6ykj9ME+{F0Oq8tfk1x5`{r3H*!oWXEC zPF$>Dqa_%DlH5kdKvU&KJoAc6ib``+^GXs+GV}AmswZc#1TmhR{F(U}n-$P#rT3F} Xvn-xmz)U9 zq#bv=s0fq&h=-_LLUx+KwQOmn5}+9kKG`X43}_QL z-X*0>W2JIUWQ`aVW1gK5g(g;_n(9sfE=McxU!y$0>=wOGTi$S8sa$n=1)4Uwxx)u7 zz3FsD9lW#tD2+H11?%u_9`*T2fP?2OjJ0*OA5oJSRon3-lA5<9$!%r0jwR#b8d=u=t&=$bN#@8- zuJtO+4Yk~ZS?de?(o-)iyuaf-fJOV*H+zlQ0Dr3SVtybaH89a~J}XQ3)oK zGXxzL5)ujub7N>_ZDC(^a%>m_AOR=|BE*vn1;w+~1$6}kr2+~PlaCA`lWz-klN}EY MllBXHvv~}Y1(SFmyZ`_I delta 213 zcmeBI>QUKH&ct+FZgM5lO{OVKlS7#OC7ii=V4s}Gp*Hy~vn-1flLX`Bi!7pw^BK8#P?S1xv4RbiU{qiP z8fFYMOmy-EZY~keyyB9g(%jU%lEjkC{5-Ix$un5|7*9-AU^&WS1vGK oxn>Foa4{E`=1Q;vO=0w4=wO`upR1O`iH(aT9w@xIhI=wA0PK4|jQ{`u diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php index b492fad4d3190a30898c3ed1816261f48fdd0e63..e0410d3bfb26d33356ae2c5526c863dcbcb2f7aa 100644 GIT binary patch delta 48 zcmV-00MGyE6^0bBZvq0#4wG>L%mTszlRpDZ0brBN10VqclkNjQlQ9Gp0lbsp1iiDO G1x5vx3o^^` z1cStbLBc|*lY5yJm|n0?UdL>2;lw1tC?v$iRh*oWnwuD3T9hNftiY(jsWhFDiwjAU z6BjGkXbDE3EVq#{&`{CIciFi_JoAc6ib``+^GXs+GV}AmS|(SrcrYHA%*?Wv#R_Qt J<^wEltN`KFGiLw* diff --git a/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php b/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php index 7d012ad19..d978fc724 100644 --- a/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php +++ b/proto/otel/Opentelemetry/Proto/Common/V1/InstrumentationLibrary.php @@ -10,17 +10,14 @@ /** * InstrumentationLibrary is a message representing the instrumentation library information - * such as the fully qualified name and version. - * InstrumentationLibrary is wire-compatible with InstrumentationScope for binary - * Protobuf format. - * This message is deprecated and will be removed on June 15, 2022. + * such as the fully qualified name and version. * * Generated from protobuf message opentelemetry.proto.common.v1.InstrumentationLibrary */ class InstrumentationLibrary extends \Google\Protobuf\Internal\Message { /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; */ @@ -37,7 +34,7 @@ class InstrumentationLibrary extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * @type string $version * } */ @@ -47,7 +44,7 @@ public function __construct($data = NULL) { } /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; * @return string @@ -58,7 +55,7 @@ public function getName() } /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php b/proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php new file mode 100644 index 000000000..c508dd1aa --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Common/V1/StringKeyValue.php @@ -0,0 +1,88 @@ +opentelemetry.proto.common.v1.StringKeyValue + */ +class StringKeyValue extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field string key = 1; + */ + protected $key = ''; + /** + * Generated from protobuf field string value = 2; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key + * @type string $value + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field string key = 1; + * @return string + */ + public function getKey() + { + return $this->key; + } + + /** + * Generated from protobuf field string key = 1; + * @param string $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkString($var, True); + $this->key = $var; + + return $this; + } + + /** + * Generated from protobuf field string value = 2; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Generated from protobuf field string value = 2; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php b/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php index e43654641..c764d98b6 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php @@ -10,9 +10,6 @@ /** * A collection of Logs produced by an InstrumentationLibrary. - * InstrumentationLibraryLogs is wire-compatible with ScopeLogs for binary - * Protobuf format. - * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.logs.v1.InstrumentationLibraryLogs */ @@ -27,7 +24,7 @@ class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message */ protected $instrumentation_library = null; /** - * A list of logs that originate from an instrumentation library. + * A list of log records. * * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; */ @@ -50,7 +47,7 @@ class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message * Semantically when InstrumentationLibrary isn't set, it is equivalent with * an empty instrumentation library name (unknown). * @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $log_records - * A list of logs that originate from an instrumentation library. + * A list of log records. * @type string $schema_url * This schema_url applies to all logs in the "logs" field. * } @@ -101,7 +98,7 @@ public function setInstrumentationLibrary($var) } /** - * A list of logs that originate from an instrumentation library. + * A list of log records. * * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; * @return \Google\Protobuf\Internal\RepeatedField @@ -112,7 +109,7 @@ public function getLogRecords() } /** - * A list of logs that originate from an instrumentation library. + * A list of log records. * * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; * @param \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php index e05c1060c..2629e7687 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php @@ -56,6 +56,17 @@ class LogRecord extends \Google\Protobuf\Internal\Message * Generated from protobuf field string severity_text = 3; */ protected $severity_text = ''; + /** + * Short event identifier that does not contain varying parts. Name describes + * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 + * characters. Not guaranteed to be unique in any way. [Optional]. + * This deprecated field is planned to be removed March 15, 2022. Receivers can + * ignore this field. + * + * Generated from protobuf field string name = 4 [deprecated = true]; + * @deprecated + */ + protected $name = ''; /** * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can @@ -135,6 +146,12 @@ class LogRecord extends \Google\Protobuf\Internal\Message * @type string $severity_text * The severity text (also known as log level). The original string representation as * it is known at the source. [Optional]. + * @type string $name + * Short event identifier that does not contain varying parts. Name describes + * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 + * characters. Not guaranteed to be unique in any way. [Optional]. + * This deprecated field is planned to be removed March 15, 2022. Receivers can + * ignore this field. * @type \Opentelemetry\Proto\Common\V1\AnyValue $body * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can @@ -303,6 +320,44 @@ public function setSeverityText($var) return $this; } + /** + * Short event identifier that does not contain varying parts. Name describes + * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 + * characters. Not guaranteed to be unique in any way. [Optional]. + * This deprecated field is planned to be removed March 15, 2022. Receivers can + * ignore this field. + * + * Generated from protobuf field string name = 4 [deprecated = true]; + * @return string + * @deprecated + */ + public function getName() + { + @trigger_error('name is deprecated.', E_USER_DEPRECATED); + return $this->name; + } + + /** + * Short event identifier that does not contain varying parts. Name describes + * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 + * characters. Not guaranteed to be unique in any way. [Optional]. + * This deprecated field is planned to be removed March 15, 2022. Receivers can + * ignore this field. + * + * Generated from protobuf field string name = 4 [deprecated = true]; + * @param string $var + * @return $this + * @deprecated + */ + public function setName($var) + { + @trigger_error('name is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + /** * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php b/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php index 70b399b61..d26fe4408 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of ScopeLogs from a Resource. + * A collection of InstrumentationLibraryLogs from a Resource. * * Generated from protobuf message opentelemetry.proto.logs.v1.ResourceLogs */ @@ -22,43 +22,16 @@ class ResourceLogs extends \Google\Protobuf\Internal\Message * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; */ protected $resource = null; - /** - * A list of ScopeLogs that originate from a resource. - * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; - */ - private $scope_logs; /** * A list of InstrumentationLibraryLogs that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead - * scope_logs SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set - * and scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_logs field MAY also set - * scope_logs to carry the same logs, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_logs and - * SHOULD NOT set instrumentation_library_logs. - * JSON receivers SHOULD check if instrumentation_library_logs is set and - * scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; - * @deprecated + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; */ private $instrumentation_library_logs; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_logs" field which have their own schema_url field. + * to the data in the "instrumentation_library_logs" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; */ @@ -73,34 +46,12 @@ class ResourceLogs extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the logs in this message. * If this field is not set then resource info is unknown. - * @type \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $scope_logs - * A list of ScopeLogs that originate from a resource. * @type \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_logs * A list of InstrumentationLibraryLogs that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead - * scope_logs SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set - * and scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_logs field MAY also set - * scope_logs to carry the same logs, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_logs and - * SHOULD NOT set instrumentation_library_logs. - * JSON receivers SHOULD check if instrumentation_library_logs is set and - * scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_logs" field which have their own schema_url field. + * to the data in the "instrumentation_library_logs" field which have their own + * schema_url field. * } */ public function __construct($data = NULL) { @@ -146,98 +97,26 @@ public function setResource($var) return $this; } - /** - * A list of ScopeLogs that originate from a resource. - * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScopeLogs() - { - return $this->scope_logs; - } - - /** - * A list of ScopeLogs that originate from a resource. - * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; - * @param \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScopeLogs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\ScopeLogs::class); - $this->scope_logs = $arr; - - return $this; - } - /** * A list of InstrumentationLibraryLogs that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead - * scope_logs SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set - * and scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_logs field MAY also set - * scope_logs to carry the same logs, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_logs and - * SHOULD NOT set instrumentation_library_logs. - * JSON receivers SHOULD check if instrumentation_library_logs is set and - * scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated */ public function getInstrumentationLibraryLogs() { - @trigger_error('instrumentation_library_logs is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_logs; } /** * A list of InstrumentationLibraryLogs that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead - * scope_logs SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set - * and scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_logs field MAY also set - * scope_logs to carry the same logs, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_logs and - * SHOULD NOT set instrumentation_library_logs. - * JSON receivers SHOULD check if instrumentation_library_logs is set and - * scope_logs is not set then the value in instrumentation_library_logs - * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. - * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; * @param \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this - * @deprecated */ public function setInstrumentationLibraryLogs($var) { - @trigger_error('instrumentation_library_logs is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs::class); $this->instrumentation_library_logs = $arr; @@ -246,7 +125,8 @@ public function setInstrumentationLibraryLogs($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_logs" field which have their own schema_url field. + * to the data in the "instrumentation_library_logs" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -258,7 +138,8 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_logs" field which have their own schema_url field. + * to the data in the "instrumentation_library_logs" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php new file mode 100644 index 000000000..bdf9ea2fa --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigRequest.php @@ -0,0 +1,113 @@ +opentelemetry.proto.metrics.experimental.MetricConfigRequest + */ +class MetricConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource for which configuration should be returned. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + */ + protected $resource = null; + /** + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * + * Generated from protobuf field bytes last_known_fingerprint = 2; + */ + protected $last_known_fingerprint = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Resource\V1\Resource $resource + * Required. The resource for which configuration should be returned. + * @type string $last_known_fingerprint + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource for which configuration should be returned. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @return \Opentelemetry\Proto\Resource\V1\Resource + */ + public function getResource() + { + return isset($this->resource) ? $this->resource : null; + } + + public function hasResource() + { + return isset($this->resource); + } + + public function clearResource() + { + unset($this->resource); + } + + /** + * Required. The resource for which configuration should be returned. + * + * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; + * @param \Opentelemetry\Proto\Resource\V1\Resource $var + * @return $this + */ + public function setResource($var) + { + GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class); + $this->resource = $var; + + return $this; + } + + /** + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * + * Generated from protobuf field bytes last_known_fingerprint = 2; + * @return string + */ + public function getLastKnownFingerprint() + { + return $this->last_known_fingerprint; + } + + /** + * Optional. The value of MetricConfigResponse.fingerprint for the last + * configuration that the caller received and successfully applied. + * + * Generated from protobuf field bytes last_known_fingerprint = 2; + * @param string $var + * @return $this + */ + public function setLastKnownFingerprint($var) + { + GPBUtil::checkString($var, False); + $this->last_known_fingerprint = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php new file mode 100644 index 000000000..0993a59ea --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse.php @@ -0,0 +1,201 @@ +opentelemetry.proto.metrics.experimental.MetricConfigResponse + */ +class MetricConfigResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * + * Generated from protobuf field bytes fingerprint = 1; + */ + protected $fingerprint = ''; + /** + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; + */ + private $schedules; + /** + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * + * Generated from protobuf field int32 suggested_wait_time_sec = 3; + */ + protected $suggested_wait_time_sec = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $fingerprint + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $schedules + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * @type int $suggested_wait_time_sec + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * + * Generated from protobuf field bytes fingerprint = 1; + * @return string + */ + public function getFingerprint() + { + return $this->fingerprint; + } + + /** + * Optional. The fingerprint associated with this MetricConfigResponse. Each + * change in configs yields a different fingerprint. The resource SHOULD copy + * this value to MetricConfigRequest.last_known_fingerprint for the next + * configuration request. If there are no changes between fingerprint and + * MetricConfigRequest.last_known_fingerprint, then all other fields besides + * fingerprint in the response are optional, or the same as the last update if + * present. + * The exact mechanics of generating the fingerprint is up to the + * implementation. However, a fingerprint must be deterministically determined + * by the configurations -- the same configuration will generate the same + * fingerprint on any instance of an implementation. Hence using a timestamp is + * unacceptable, but a deterministic hash is fine. + * + * Generated from protobuf field bytes fingerprint = 1; + * @param string $var + * @return $this + */ + public function setFingerprint($var) + { + GPBUtil::checkString($var, False); + $this->fingerprint = $var; + + return $this; + } + + /** + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSchedules() + { + return $this->schedules; + } + + /** + * A single metric may match multiple schedules. In such cases, the schedule + * that specifies the smallest period is applied. + * Note, for optimization purposes, it is recommended to use as few schedules + * as possible to capture all required metric updates. Where you can be + * conservative, do take full advantage of the inclusion/exclusion patterns to + * capture as much of your targeted metrics. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2; + * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSchedules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule::class); + $this->schedules = $arr; + + return $this; + } + + /** + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * + * Generated from protobuf field int32 suggested_wait_time_sec = 3; + * @return int + */ + public function getSuggestedWaitTimeSec() + { + return $this->suggested_wait_time_sec; + } + + /** + * Optional. The client is suggested to wait this long (in seconds) before + * pinging the configuration service again. + * + * Generated from protobuf field int32 suggested_wait_time_sec = 3; + * @param int $var + * @return $this + */ + public function setSuggestedWaitTimeSec($var) + { + GPBUtil::checkInt32($var); + $this->suggested_wait_time_sec = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php new file mode 100644 index 000000000..07091928d --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule.php @@ -0,0 +1,149 @@ +opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule + */ +class Schedule extends \Google\Protobuf\Internal\Message +{ + /** + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; + */ + private $exclusion_patterns; + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; + */ + private $inclusion_patterns; + /** + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * + * Generated from protobuf field int32 period_sec = 3; + */ + protected $period_sec = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $exclusion_patterns + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $inclusion_patterns + * @type int $period_sec + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExclusionPatterns() + { + return $this->exclusion_patterns; + } + + /** + * Metrics with names that match a rule in the inclusion_patterns are + * targeted by this schedule. Metrics that match the exclusion_patterns + * are not targeted for this schedule, even if they match an inclusion + * pattern. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1; + * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExclusionPatterns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class); + $this->exclusion_patterns = $arr; + + return $this; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInclusionPatterns() + { + return $this->inclusion_patterns; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2; + * @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInclusionPatterns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class); + $this->inclusion_patterns = $arr; + + return $this; + } + + /** + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * + * Generated from protobuf field int32 period_sec = 3; + * @return int + */ + public function getPeriodSec() + { + return $this->period_sec; + } + + /** + * Describes the collection period for each metric in seconds. + * A period of 0 means to not export. + * + * Generated from protobuf field int32 period_sec = 3; + * @param int $var + * @return $this + */ + public function setPeriodSec($var) + { + GPBUtil::checkInt32($var); + $this->period_sec = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Schedule::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule::class); + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php new file mode 100644 index 000000000..839c097fb --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse/Schedule/Pattern.php @@ -0,0 +1,113 @@ +opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern + */ +class Pattern extends \Google\Protobuf\Internal\Message +{ + protected $match; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $equals + * matches the metric name exactly + * @type string $starts_with + * prefix-matches the metric name + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce(); + parent::__construct($data); + } + + /** + * matches the metric name exactly + * + * Generated from protobuf field string equals = 1; + * @return string + */ + public function getEquals() + { + return $this->readOneof(1); + } + + public function hasEquals() + { + return $this->hasOneof(1); + } + + /** + * matches the metric name exactly + * + * Generated from protobuf field string equals = 1; + * @param string $var + * @return $this + */ + public function setEquals($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * prefix-matches the metric name + * + * Generated from protobuf field string starts_with = 2; + * @return string + */ + public function getStartsWith() + { + return $this->readOneof(2); + } + + public function hasStartsWith() + { + return $this->hasOneof(2); + } + + /** + * prefix-matches the metric name + * + * Generated from protobuf field string starts_with = 2; + * @param string $var + * @return $this + */ + public function setStartsWith($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getMatch() + { + return $this->whichOneof("match"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Pattern::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule_Pattern::class); + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php new file mode 100644 index 000000000..5486976fc --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/Experimental/MetricConfigResponse_Schedule.php @@ -0,0 +1,16 @@ +optional double sum = 5; + * Generated from protobuf field double sum = 5; */ - protected $sum = null; + protected $sum = 0.0; /** * bucket_counts is an optional field contains the count values of histogram * for each bucket. @@ -302,22 +302,12 @@ public function setCount($var) * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field optional double sum = 5; + * Generated from protobuf field double sum = 5; * @return float */ public function getSum() { - return isset($this->sum) ? $this->sum : 0.0; - } - - public function hasSum() - { - return isset($this->sum); - } - - public function clearSum() - { - unset($this->sum); + return $this->sum; } /** @@ -329,7 +319,7 @@ public function clearSum() * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field optional double sum = 5; + * Generated from protobuf field double sum = 5; * @param float $var * @return $this */ diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php index 807aa1054..342b359a0 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php @@ -10,9 +10,6 @@ /** * A collection of Metrics produced by an InstrumentationLibrary. - * InstrumentationLibraryMetrics is wire-compatible with ScopeMetrics for binary - * Protobuf format. - * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics */ diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php new file mode 100644 index 000000000..2eac03fcb --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntDataPoint.php @@ -0,0 +1,227 @@ +opentelemetry.proto.metrics.v1.IntDataPoint + */ +class IntDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + */ + private $labels; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * value itself. + * + * Generated from protobuf field sfixed64 value = 4; + */ + protected $value = 0; + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; + */ + private $exemplars; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels + * The set of labels that uniquely identify this timeseries. + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $value + * value itself. + * @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); + $this->labels = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * value itself. + * + * Generated from protobuf field sfixed64 value = 4; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * value itself. + * + * Generated from protobuf field sfixed64 value = 4; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5; + * @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class); + $this->exemplars = $arr; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php new file mode 100644 index 000000000..319c0ff27 --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntExemplar.php @@ -0,0 +1,235 @@ +opentelemetry.proto.metrics.v1.IntExemplar + */ +class IntExemplar extends \Google\Protobuf\Internal\Message +{ + /** + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; + */ + private $filtered_labels; + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + */ + protected $time_unix_nano = 0; + /** + * Numerical int value of the measurement that was recorded. + * + * Generated from protobuf field sfixed64 value = 3; + */ + protected $value = 0; + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + */ + protected $span_id = ''; + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + */ + protected $trace_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $filtered_labels + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * @type int|string $time_unix_nano + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $value + * Numerical int value of the measurement that was recorded. + * @type string $span_id + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * @type string $trace_id + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilteredLabels() + { + return $this->filtered_labels; + } + + /** + * The set of labels that were filtered out by the aggregator, but recorded + * alongside the original measurement. Only labels that were filtered out + * by the aggregator should be included + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1; + * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilteredLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); + $this->filtered_labels = $arr; + + return $this; + } + + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * time_unix_nano is the exact time when this exemplar was recorded + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * Numerical int value of the measurement that was recorded. + * + * Generated from protobuf field sfixed64 value = 3; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * Numerical int value of the measurement that was recorded. + * + * Generated from protobuf field sfixed64 value = 3; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + * @return string + */ + public function getSpanId() + { + return $this->span_id; + } + + /** + * (Optional) Span ID of the exemplar trace. + * span_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes span_id = 4; + * @param string $var + * @return $this + */ + public function setSpanId($var) + { + GPBUtil::checkString($var, False); + $this->span_id = $var; + + return $this; + } + + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + * @return string + */ + public function getTraceId() + { + return $this->trace_id; + } + + /** + * (Optional) Trace ID of the exemplar trace. + * trace_id may be missing if the measurement is not recorded inside a trace + * or if the trace is not sampled. + * + * Generated from protobuf field bytes trace_id = 5; + * @param string $var + * @return $this + */ + public function setTraceId($var) + { + GPBUtil::checkString($var, False); + $this->trace_id = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php new file mode 100644 index 000000000..37fece6dd --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntGauge.php @@ -0,0 +1,60 @@ +opentelemetry.proto.metrics.v1.IntGauge + */ +class IntGauge extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + */ + private $data_points; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class); + $this->data_points = $arr; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php new file mode 100644 index 000000000..934649310 --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogram.php @@ -0,0 +1,99 @@ +opentelemetry.proto.metrics.v1.IntHistogram + */ +class IntHistogram extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; + */ + private $data_points; + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + */ + protected $aggregation_temporality = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * @type int $aggregation_temporality + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint::class); + $this->data_points = $arr; + + return $this; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @return int + */ + public function getAggregationTemporality() + { + return $this->aggregation_temporality; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @param int $var + * @return $this + */ + public function setAggregationTemporality($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); + $this->aggregation_temporality = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php new file mode 100644 index 000000000..cf0e4898b --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntHistogramDataPoint.php @@ -0,0 +1,393 @@ +opentelemetry.proto.metrics.v1.IntHistogramDataPoint + */ +class IntHistogramDataPoint extends \Google\Protobuf\Internal\Message +{ + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + */ + private $labels; + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + */ + protected $start_time_unix_nano = 0; + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + */ + protected $time_unix_nano = 0; + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + */ + protected $count = 0; + /** + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * + * Generated from protobuf field sfixed64 sum = 5; + */ + protected $sum = 0; + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + */ + private $bucket_counts; + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + */ + private $explicit_bounds; + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; + */ + private $exemplars; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels + * The set of labels that uniquely identify this timeseries. + * @type int|string $start_time_unix_nano + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $time_unix_nano + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * @type int|string $count + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * @type int|string $sum + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * @type float[]|\Google\Protobuf\Internal\RepeatedField $explicit_bounds + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The set of labels that uniquely identify this timeseries. + * + * Generated from protobuf field repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1; + * @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class); + $this->labels = $arr; + + return $this; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @return int|string + */ + public function getStartTimeUnixNano() + { + return $this->start_time_unix_nano; + } + + /** + * StartTimeUnixNano is optional but strongly encouraged, see the + * the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 start_time_unix_nano = 2; + * @param int|string $var + * @return $this + */ + public function setStartTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->start_time_unix_nano = $var; + + return $this; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @return int|string + */ + public function getTimeUnixNano() + { + return $this->time_unix_nano; + } + + /** + * TimeUnixNano is required, see the detailed comments above Metric. + * Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + * 1970. + * + * Generated from protobuf field fixed64 time_unix_nano = 3; + * @param int|string $var + * @return $this + */ + public function setTimeUnixNano($var) + { + GPBUtil::checkUint64($var); + $this->time_unix_nano = $var; + + return $this; + } + + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + * @return int|string + */ + public function getCount() + { + return $this->count; + } + + /** + * count is the number of values in the population. Must be non-negative. This + * value must be equal to the sum of the "count" fields in buckets if a + * histogram is provided. + * + * Generated from protobuf field fixed64 count = 4; + * @param int|string $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkUint64($var); + $this->count = $var; + + return $this; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * + * Generated from protobuf field sfixed64 sum = 5; + * @return int|string + */ + public function getSum() + { + return $this->sum; + } + + /** + * sum of the values in the population. If count is zero then this field + * must be zero. This value must be equal to the sum of the "sum" fields in + * buckets if a histogram is provided. + * + * Generated from protobuf field sfixed64 sum = 5; + * @param int|string $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkInt64($var); + $this->sum = $var; + + return $this; + } + + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getBucketCounts() + { + return $this->bucket_counts; + } + + /** + * bucket_counts is an optional field contains the count values of histogram + * for each bucket. + * The sum of the bucket_counts must equal the value in the count field. + * The number of elements in bucket_counts array must be by one greater than + * the number of elements in explicit_bounds array. + * + * Generated from protobuf field repeated fixed64 bucket_counts = 6; + * @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setBucketCounts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FIXED64); + $this->bucket_counts = $arr; + + return $this; + } + + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExplicitBounds() + { + return $this->explicit_bounds; + } + + /** + * explicit_bounds specifies buckets with explicitly defined bounds for values. + * The boundaries for bucket at index i are: + * (-infinity, explicit_bounds[i]] for i == 0 + * (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds) + * (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds) + * The values in the explicit_bounds array must be strictly increasing. + * Histogram buckets are inclusive of their upper boundary, except the last + * bucket where the boundary is at infinity. This format is intentionally + * compatible with the OpenMetrics histogram definition. + * + * Generated from protobuf field repeated double explicit_bounds = 7; + * @param float[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExplicitBounds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE); + $this->explicit_bounds = $arr; + + return $this; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getExemplars() + { + return $this->exemplars; + } + + /** + * (Optional) List of exemplars collected from + * measurements that were used to form the data point + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8; + * @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setExemplars($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class); + $this->exemplars = $arr; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php new file mode 100644 index 000000000..aaa313d7d --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/IntSum.php @@ -0,0 +1,132 @@ +opentelemetry.proto.metrics.v1.IntSum + */ +class IntSum extends \Google\Protobuf\Internal\Message +{ + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + */ + private $data_points; + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + */ + protected $aggregation_temporality = 0; + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + */ + protected $is_monotonic = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points + * @type int $aggregation_temporality + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * @type bool $is_monotonic + * If "true" means that the sum is monotonic. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce(); + parent::__construct($data); + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDataPoints() + { + return $this->data_points; + } + + /** + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1; + * @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDataPoints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class); + $this->data_points = $arr; + + return $this; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @return int + */ + public function getAggregationTemporality() + { + return $this->aggregation_temporality; + } + + /** + * aggregation_temporality describes if the aggregator reports delta changes + * since last report time, or cumulative changes since a fixed start time. + * + * Generated from protobuf field .opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2; + * @param int $var + * @return $this + */ + public function setAggregationTemporality($var) + { + GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class); + $this->aggregation_temporality = $var; + + return $this; + } + + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + * @return bool + */ + public function getIsMonotonic() + { + return $this->is_monotonic; + } + + /** + * If "true" means that the sum is monotonic. + * + * Generated from protobuf field bool is_monotonic = 3; + * @param bool $var + * @return $this + */ + public function setIsMonotonic($var) + { + GPBUtil::checkBool($var); + $this->is_monotonic = $var; + + return $this; + } + +} + diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php index 30bb5ef4e..3c78db69f 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of ScopeMetrics from a Resource. + * A collection of InstrumentationLibraryMetrics from a Resource. * * Generated from protobuf message opentelemetry.proto.metrics.v1.ResourceMetrics */ @@ -25,40 +25,13 @@ class ResourceMetrics extends \Google\Protobuf\Internal\Message /** * A list of metrics that originate from a resource. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; - */ - private $scope_metrics; - /** - * A list of InstrumentationLibraryMetrics that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead - * scope_metrics SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set - * and scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_metrics field MAY also set - * scope_metrics to carry the same metrics, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_metrics and - * SHOULD NOT set instrumentation_library_metrics. - * JSON receivers SHOULD check if instrumentation_library_metrics is set and - * scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; - * @deprecated + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; */ private $instrumentation_library_metrics; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_metrics" field which have their own schema_url field. + * to the data in the "instrumentation_library_metrics" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; */ @@ -73,34 +46,12 @@ class ResourceMetrics extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the metrics in this message. * If this field is not set then no resource info is known. - * @type \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $scope_metrics - * A list of metrics that originate from a resource. * @type \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_metrics - * A list of InstrumentationLibraryMetrics that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead - * scope_metrics SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set - * and scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_metrics field MAY also set - * scope_metrics to carry the same metrics, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_metrics and - * SHOULD NOT set instrumentation_library_metrics. - * JSON receivers SHOULD check if instrumentation_library_metrics is set and - * scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. + * A list of metrics that originate from a resource. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_metrics" field which have their own schema_url field. + * to the data in the "instrumentation_library_metrics" field which have their own + * schema_url field. * } */ public function __construct($data = NULL) { @@ -149,95 +100,23 @@ public function setResource($var) /** * A list of metrics that originate from a resource. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; * @return \Google\Protobuf\Internal\RepeatedField */ - public function getScopeMetrics() - { - return $this->scope_metrics; - } - - /** - * A list of metrics that originate from a resource. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; - * @param \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScopeMetrics($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ScopeMetrics::class); - $this->scope_metrics = $arr; - - return $this; - } - - /** - * A list of InstrumentationLibraryMetrics that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead - * scope_metrics SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set - * and scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_metrics field MAY also set - * scope_metrics to carry the same metrics, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_metrics and - * SHOULD NOT set instrumentation_library_metrics. - * JSON receivers SHOULD check if instrumentation_library_metrics is set and - * scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. - * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; - * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated - */ public function getInstrumentationLibraryMetrics() { - @trigger_error('instrumentation_library_metrics is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_metrics; } /** - * A list of InstrumentationLibraryMetrics that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead - * scope_metrics SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set - * and scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_metrics field MAY also set - * scope_metrics to carry the same metrics, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_metrics and - * SHOULD NOT set instrumentation_library_metrics. - * JSON receivers SHOULD check if instrumentation_library_metrics is set and - * scope_metrics is not set then the value in instrumentation_library_metrics - * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. - * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. + * A list of metrics that originate from a resource. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; * @param \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this - * @deprecated */ public function setInstrumentationLibraryMetrics($var) { - @trigger_error('instrumentation_library_metrics is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics::class); $this->instrumentation_library_metrics = $arr; @@ -246,7 +125,8 @@ public function setInstrumentationLibraryMetrics($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_metrics" field which have their own schema_url field. + * to the data in the "instrumentation_library_metrics" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -258,7 +138,8 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_metrics" field which have their own schema_url field. + * to the data in the "instrumentation_library_metrics" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php b/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php index c5cc122e7..f9819abce 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php @@ -10,9 +10,6 @@ /** * A collection of Spans produced by an InstrumentationLibrary. - * InstrumentationLibrarySpans is wire-compatible with ScopeSpans for binary - * Protobuf format. - * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.trace.v1.InstrumentationLibrarySpans */ diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php b/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php index 4c9227480..1d3c65c1e 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of ScopeSpans from a Resource. + * A collection of InstrumentationLibrarySpans from a Resource. * * Generated from protobuf message opentelemetry.proto.trace.v1.ResourceSpans */ @@ -22,43 +22,16 @@ class ResourceSpans extends \Google\Protobuf\Internal\Message * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; */ protected $resource = null; - /** - * A list of ScopeSpans that originate from a resource. - * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; - */ - private $scope_spans; /** * A list of InstrumentationLibrarySpans that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead - * scope_spans SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set - * and scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_spans field MAY also set - * scope_spans to carry the same spans, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_spans and - * SHOULD NOT set instrumentation_library_spans. - * JSON receivers SHOULD check if instrumentation_library_spans is set and - * scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; - * @deprecated + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; */ private $instrumentation_library_spans; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_spans" field which have their own schema_url field. + * to the data in the "instrumentation_library_spans" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; */ @@ -73,34 +46,12 @@ class ResourceSpans extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the spans in this message. * If this field is not set then no resource info is known. - * @type \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $scope_spans - * A list of ScopeSpans that originate from a resource. * @type \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_spans * A list of InstrumentationLibrarySpans that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead - * scope_spans SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set - * and scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_spans field MAY also set - * scope_spans to carry the same spans, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_spans and - * SHOULD NOT set instrumentation_library_spans. - * JSON receivers SHOULD check if instrumentation_library_spans is set and - * scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_spans" field which have their own schema_url field. + * to the data in the "instrumentation_library_spans" field which have their own + * schema_url field. * } */ public function __construct($data = NULL) { @@ -146,98 +97,26 @@ public function setResource($var) return $this; } - /** - * A list of ScopeSpans that originate from a resource. - * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getScopeSpans() - { - return $this->scope_spans; - } - - /** - * A list of ScopeSpans that originate from a resource. - * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; - * @param \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setScopeSpans($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\ScopeSpans::class); - $this->scope_spans = $arr; - - return $this; - } - /** * A list of InstrumentationLibrarySpans that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead - * scope_spans SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set - * and scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_spans field MAY also set - * scope_spans to carry the same spans, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_spans and - * SHOULD NOT set instrumentation_library_spans. - * JSON receivers SHOULD check if instrumentation_library_spans is set and - * scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; * @return \Google\Protobuf\Internal\RepeatedField - * @deprecated */ public function getInstrumentationLibrarySpans() { - @trigger_error('instrumentation_library_spans is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_spans; } /** * A list of InstrumentationLibrarySpans that originate from a resource. - * This field is deprecated and will be removed after grace period expires on June 15, 2022. - * During the grace period the following rules SHOULD be followed: - * For Binary Protobufs - * ==================== - * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead - * scope_spans SHOULD be set. - * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set - * and scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. - * For JSON - * ======== - * JSON senders that set instrumentation_library_spans field MAY also set - * scope_spans to carry the same spans, essentially double-publishing the same data. - * Such double-publishing MAY be controlled by a user-settable option. - * If double-publishing is not used then the senders SHOULD set scope_spans and - * SHOULD NOT set instrumentation_library_spans. - * JSON receivers SHOULD check if instrumentation_library_spans is set and - * scope_spans is not set then the value in instrumentation_library_spans - * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. - * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; * @param \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this - * @deprecated */ public function setInstrumentationLibrarySpans($var) { - @trigger_error('instrumentation_library_spans is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans::class); $this->instrumentation_library_spans = $arr; @@ -246,7 +125,8 @@ public function setInstrumentationLibrarySpans($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_spans" field which have their own schema_url field. + * to the data in the "instrumentation_library_spans" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -258,7 +138,8 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "scope_spans" field which have their own schema_url field. + * to the data in the "instrumentation_library_spans" field which have their own + * schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php new file mode 100644 index 000000000..9a078e2ef --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Status/DeprecatedStatusCode.php @@ -0,0 +1,126 @@ +opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode + */ +class DeprecatedStatusCode +{ + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_OK = 0; + */ + const DEPRECATED_STATUS_CODE_OK = 0; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_CANCELLED = 1; + */ + const DEPRECATED_STATUS_CODE_CANCELLED = 1; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2; + */ + const DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3; + */ + const DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4; + */ + const DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_NOT_FOUND = 5; + */ + const DEPRECATED_STATUS_CODE_NOT_FOUND = 5; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6; + */ + const DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7; + */ + const DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8; + */ + const DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9; + */ + const DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_ABORTED = 10; + */ + const DEPRECATED_STATUS_CODE_ABORTED = 10; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11; + */ + const DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12; + */ + const DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13; + */ + const DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNAVAILABLE = 14; + */ + const DEPRECATED_STATUS_CODE_UNAVAILABLE = 14; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_DATA_LOSS = 15; + */ + const DEPRECATED_STATUS_CODE_DATA_LOSS = 15; + /** + * Generated from protobuf enum DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16; + */ + const DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16; + + private static $valueToName = [ + self::DEPRECATED_STATUS_CODE_OK => 'DEPRECATED_STATUS_CODE_OK', + self::DEPRECATED_STATUS_CODE_CANCELLED => 'DEPRECATED_STATUS_CODE_CANCELLED', + self::DEPRECATED_STATUS_CODE_UNKNOWN_ERROR => 'DEPRECATED_STATUS_CODE_UNKNOWN_ERROR', + self::DEPRECATED_STATUS_CODE_INVALID_ARGUMENT => 'DEPRECATED_STATUS_CODE_INVALID_ARGUMENT', + self::DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED => 'DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED', + self::DEPRECATED_STATUS_CODE_NOT_FOUND => 'DEPRECATED_STATUS_CODE_NOT_FOUND', + self::DEPRECATED_STATUS_CODE_ALREADY_EXISTS => 'DEPRECATED_STATUS_CODE_ALREADY_EXISTS', + self::DEPRECATED_STATUS_CODE_PERMISSION_DENIED => 'DEPRECATED_STATUS_CODE_PERMISSION_DENIED', + self::DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED => 'DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED', + self::DEPRECATED_STATUS_CODE_FAILED_PRECONDITION => 'DEPRECATED_STATUS_CODE_FAILED_PRECONDITION', + self::DEPRECATED_STATUS_CODE_ABORTED => 'DEPRECATED_STATUS_CODE_ABORTED', + self::DEPRECATED_STATUS_CODE_OUT_OF_RANGE => 'DEPRECATED_STATUS_CODE_OUT_OF_RANGE', + self::DEPRECATED_STATUS_CODE_UNIMPLEMENTED => 'DEPRECATED_STATUS_CODE_UNIMPLEMENTED', + self::DEPRECATED_STATUS_CODE_INTERNAL_ERROR => 'DEPRECATED_STATUS_CODE_INTERNAL_ERROR', + self::DEPRECATED_STATUS_CODE_UNAVAILABLE => 'DEPRECATED_STATUS_CODE_UNAVAILABLE', + self::DEPRECATED_STATUS_CODE_DATA_LOSS => 'DEPRECATED_STATUS_CODE_DATA_LOSS', + self::DEPRECATED_STATUS_CODE_UNAUTHENTICATED => 'DEPRECATED_STATUS_CODE_UNAUTHENTICATED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DeprecatedStatusCode::class, \Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode::class); + diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php b/proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php new file mode 100644 index 000000000..2235d5b7d --- /dev/null +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/Status_DeprecatedStatusCode.php @@ -0,0 +1,16 @@ + Date: Mon, 25 Apr 2022 22:57:49 +1000 Subject: [PATCH 3/5] tidy up script --- script/proto_gen.sh | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/script/proto_gen.sh b/script/proto_gen.sh index 2c5fbc4c9..db354c47b 100755 --- a/script/proto_gen.sh +++ b/script/proto_gen.sh @@ -8,24 +8,22 @@ cd "${DESTINATION_DIR}" || exit rm -rf ./${REPO_DIR} git clone https://github.com/open-telemetry/${REPO_DIR} -for dir in ${REPO_DIR} -do - ( - cd ${dir} - TAG=$( - TAG=$(git describe --tags `git rev-list --tags --max-count=1`) +( + cd ${REPO_DIR} + git config --add advice.detachedHead false + TAG=$( + TAG=$(git describe --tags `git rev-list --tags --max-count=1`) - git checkout "${TAG}" + git checkout "${TAG}" - echo "${TAG}" - ) - - echo "Generating protobuf files for version ${TAG} ..." - make gen-php - rm -rf ${GPBMETA_DIR} ${OTEL_DIR} - echo "${TAG}" > "${DESTINATION_DIR}/VERSION" + echo "${TAG}" ) -done + + echo "Generating protobuf files for version ${TAG} ..." + make gen-php + rm -rf ${GPBMETA_DIR} ${OTEL_DIR} + echo "${TAG}" > "${DESTINATION_DIR}/VERSION" +) echo "Copying generated source..." cp -r ${REPO_DIR}/gen/php/${GPBMETA_DIR} . From 6bda973a7283050e08e1d04d9cbfeba07c08a7a2 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Wed, 27 Apr 2022 17:21:53 +1000 Subject: [PATCH 4/5] renaming InstrumentationLibrary to InstrumentationScope and bumping protobuf InstrumentationLibrary is now deprecated in favour of InstrumentationScope. Making this change resolves issues with grpc+protobuf exports being ignored by the otel collector, so we now can update the proto interfaces to latest. --- Makefile | 4 +- docker-compose-collector.yaml | 5 +- .../Opentelemetry/Proto/Common/V1/Common.php | Bin 1284 -> 1343 bytes .../Opentelemetry/Proto/Logs/V1/Logs.php | Bin 2557 -> 2777 bytes .../Proto/Metrics/V1/Metrics.php | Bin 4367 -> 4620 bytes .../Opentelemetry/Proto/Trace/V1/Trace.php | Bin 2566 -> 2792 bytes .../Common/V1/InstrumentationLibrary.php | 13 +- .../Logs/V1/InstrumentationLibraryLogs.php | 11 +- .../Opentelemetry/Proto/Logs/V1/LogRecord.php | 55 ------- .../Proto/Logs/V1/ResourceLogs.php | 143 +++++++++++++++-- .../Proto/Metrics/V1/HistogramDataPoint.php | 20 ++- .../V1/InstrumentationLibraryMetrics.php | 3 + .../Proto/Metrics/V1/ResourceMetrics.php | 147 ++++++++++++++++-- .../Trace/V1/InstrumentationLibrarySpans.php | 3 + .../Proto/Trace/V1/ResourceSpans.php | 143 +++++++++++++++-- proto/otel/VERSION | 2 +- script/proto_gen.sh | 5 +- src/API/Metrics/MeterProviderInterface.php | 4 +- src/Contrib/Jaeger/SpanConverter.php | 12 +- src/Contrib/Otlp/SpanConverter.php | 34 ++-- src/Contrib/OtlpGrpc/Exporter.php | 2 + src/Contrib/Zipkin/SpanConverter.php | 12 +- .../BC/InstrumentationLibrary.php | 2 +- ....php => InstrumentationScopeInterface.php} | 2 +- src/SDK/Common/Dev/Compatibility/_load.php | 2 +- ...onLibrary.php => InstrumentationScope.php} | 6 +- ....php => InstrumentationScopeInterface.php} | 2 +- .../Common/Instrumentation/KeyGenerator.php | 2 +- src/SDK/Trace/ImmutableSpan.php | 6 +- src/SDK/Trace/ReadableSpanInterface.php | 4 +- src/SDK/Trace/Span.php | 16 +- src/SDK/Trace/SpanBuilder.php | 10 +- src/SDK/Trace/SpanDataInterface.php | 4 +- src/SDK/Trace/Tracer.php | 14 +- src/SDK/Trace/TracerProvider.php | 6 +- tests/Integration/SDK/TracerTest.php | 16 +- .../Unit/Contrib/JaegerSpanConverterTest.php | 16 +- tests/Unit/Contrib/OTLPSpanConverterTest.php | 20 +-- .../Unit/Contrib/ZipkinSpanConverterTest.php | 16 +- .../InstrumentationLibraryTest.php | 36 ----- .../InstrumentationScopeTest.php | 36 +++++ tests/Unit/SDK/Trace/ImmutableSpanTest.php | 10 +- tests/Unit/SDK/Trace/SpanTest.php | 14 +- tests/Unit/SDK/Trace/TracerTest.php | 12 +- tests/Unit/SDK/Util/SpanData.php | 14 +- 45 files changed, 605 insertions(+), 279 deletions(-) rename src/SDK/Common/Dev/Compatibility/BC/{InstrumentationLibraryInterface.php => InstrumentationScopeInterface.php} (79%) rename src/SDK/Common/Instrumentation/{InstrumentationLibrary.php => InstrumentationScope.php} (78%) rename src/SDK/Common/Instrumentation/{InstrumentationLibraryInterface.php => InstrumentationScopeInterface.php} (83%) delete mode 100644 tests/Unit/SDK/Common/Instrumentation/InstrumentationLibraryTest.php create mode 100644 tests/Unit/SDK/Common/Instrumentation/InstrumentationScopeTest.php diff --git a/Makefile b/Makefile index 32717ec5c..0b33e2015 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ psalm: psalm-info: $(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/psalm --show-info=true --threads=1 phpstan: - $(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpstan analyse + $(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpstan analyse --memory-limit=256M benchmark: $(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpbench run --report=default phpmetrics: @@ -40,7 +40,7 @@ trace examples: FORCE docker-compose stop collector: docker-compose -f docker-compose-collector.yaml up -d --remove-orphans - docker-compose -f docker-compose-collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317 --rm php php ./examples/AlwaysOnOTLPGrpcExample2.php + docker-compose -f docker-compose-collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=collector:4317 --rm php php ./examples/AlwaysOnOTLPGrpcExample.php docker-compose -f docker-compose-collector.yaml stop fiber-ffi-example: diff --git a/docker-compose-collector.yaml b/docker-compose-collector.yaml index a7aba1633..dde69085d 100644 --- a/docker-compose-collector.yaml +++ b/docker-compose-collector.yaml @@ -7,7 +7,7 @@ services: volumes: - ./:/usr/src/myapp depends_on: - - otel-collector + - collector zipkin: image: openzipkin/zipkin-slim ports: @@ -19,8 +19,7 @@ services: ports: - 9412:9412 - 16686:16686 - otel-collector: - platform: linux/amd64 + collector: image: otel/opentelemetry-collector-contrib command: ["--config=/etc/otel-collector-config.yml"] volumes: diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Common/V1/Common.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Common/V1/Common.php index da0a19d969501dfae341ae78ba2a7c66b44f1b3a..6b973ada671fd8603ba753109f769d8c9819ed87 100644 GIT binary patch delta 59 zcmZqS+RwG&AtTEaHZHA+-ddaanS_}bttTt9n9Eo(NiZsza*2566_*s1=BDPAB$j06 P=LIL{7o<+MW;qD};(-yD delta 30 mcmdnb)xx#mAtTF8RxYiH-ddaanS_}b%_l3fm`|R{vI+o_00`ay diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Logs/V1/Logs.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Logs/V1/Logs.php index 6e46cccbb38be76120d223d24c7ac3568f8f10fe..a7e879307b6b27bf252d2e78439794eef875377e 100644 GIT binary patch delta 190 zcmew>d{cBoHWSlQfyuc{M;QN4He&V_wc_F`PR=h#jnBzXFP30ZVAkL^Qk&esDmvMK zm6Ho3;{%isN}AljEYI|UeewckTXQES2}U6ykj9ME+{F0Oq8tfk1x5`{r3H*!oWXEC zPF$>Dqa_%DlH5kdKvU&KJoAc6ib``+^GXs+GV}AmswZc#1TmhR{F(U}n-$P#rT3F} Xvn-xmzQUKH&ct+FZgM5lO{OVKlS7#OC7ii=V4s}Gp*Hy~vn-1flLX`Bi!7pw^BK8#P?S1xv4RbiU{qiP z8fFYMOmy-EZY~keyyB9g(%jU%lEjkC{5-Ix$un5|7*9-AU^&WS1vGK oxn>Foa4{E`=1Q;vO=0w4=wO`upR1O`iH(aT9w@xIhI=wA0PK4|jQ{`u delta 106 zcmV-w0G0oYB#$DncLD;+9Futh*#gP|lT-sw17->zlQ0Dr3SVtybaH89a~J}XQ3)oK zGXxzL5)ujub7N>_ZDC(^a%>m_AOR=|BE*vn1;w+~1$6}kr2+~PlaCA`lWz-klN}EY MllBXHvv~}Y1(SFmyZ`_I diff --git a/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php b/proto/otel/GPBMetadata/Opentelemetry/Proto/Trace/V1/Trace.php index e0410d3bfb26d33356ae2c5526c863dcbcb2f7aa..b492fad4d3190a30898c3ed1816261f48fdd0e63 100644 GIT binary patch delta 178 zcmZn@c_F$XpNVO$z~n-vGfZtvlkJ&(#ca8_i<9#UQsavY67z~Bm=u^bxQ#R>3o^^` z1cStbLBc|*lY5yJm|n0?UdL>2;lw1tC?v$iRh*oWnwuD3T9hNftiY(jsWhFDiwjAU z6BjGkXbDE3EVq#{&`{CIciFi_JoAc6ib``+^GXs+GV}AmS|(SrcrYHA%*?Wv#R_Qt J<^wEltN`KFGiLw* delta 48 zcmV-00MGyE6^0bBZvq0#4wG>L%mTszlRpDZ0brBN10VqclkNjQlQ9Gp0lbsp1iiDO G1x5vxopentelemetry.proto.common.v1.InstrumentationLibrary */ class InstrumentationLibrary extends \Google\Protobuf\Internal\Message { /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; */ @@ -34,7 +37,7 @@ class InstrumentationLibrary extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * @type string $version * } */ @@ -44,7 +47,7 @@ public function __construct($data = NULL) { } /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; * @return string @@ -55,7 +58,7 @@ public function getName() } /** - * An empty instrumentation library name means the name is unknown. + * An empty instrumentation library name means the name is unknown. * * Generated from protobuf field string name = 1; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php b/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php index c764d98b6..e43654641 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/InstrumentationLibraryLogs.php @@ -10,6 +10,9 @@ /** * A collection of Logs produced by an InstrumentationLibrary. + * InstrumentationLibraryLogs is wire-compatible with ScopeLogs for binary + * Protobuf format. + * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.logs.v1.InstrumentationLibraryLogs */ @@ -24,7 +27,7 @@ class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message */ protected $instrumentation_library = null; /** - * A list of log records. + * A list of logs that originate from an instrumentation library. * * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; */ @@ -47,7 +50,7 @@ class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message * Semantically when InstrumentationLibrary isn't set, it is equivalent with * an empty instrumentation library name (unknown). * @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $log_records - * A list of log records. + * A list of logs that originate from an instrumentation library. * @type string $schema_url * This schema_url applies to all logs in the "logs" field. * } @@ -98,7 +101,7 @@ public function setInstrumentationLibrary($var) } /** - * A list of log records. + * A list of logs that originate from an instrumentation library. * * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; * @return \Google\Protobuf\Internal\RepeatedField @@ -109,7 +112,7 @@ public function getLogRecords() } /** - * A list of log records. + * A list of logs that originate from an instrumentation library. * * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.LogRecord log_records = 2; * @param \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php index 2629e7687..e05c1060c 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/LogRecord.php @@ -56,17 +56,6 @@ class LogRecord extends \Google\Protobuf\Internal\Message * Generated from protobuf field string severity_text = 3; */ protected $severity_text = ''; - /** - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. - * This deprecated field is planned to be removed March 15, 2022. Receivers can - * ignore this field. - * - * Generated from protobuf field string name = 4 [deprecated = true]; - * @deprecated - */ - protected $name = ''; /** * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can @@ -146,12 +135,6 @@ class LogRecord extends \Google\Protobuf\Internal\Message * @type string $severity_text * The severity text (also known as log level). The original string representation as * it is known at the source. [Optional]. - * @type string $name - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. - * This deprecated field is planned to be removed March 15, 2022. Receivers can - * ignore this field. * @type \Opentelemetry\Proto\Common\V1\AnyValue $body * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can @@ -320,44 +303,6 @@ public function setSeverityText($var) return $this; } - /** - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. - * This deprecated field is planned to be removed March 15, 2022. Receivers can - * ignore this field. - * - * Generated from protobuf field string name = 4 [deprecated = true]; - * @return string - * @deprecated - */ - public function getName() - { - @trigger_error('name is deprecated.', E_USER_DEPRECATED); - return $this->name; - } - - /** - * Short event identifier that does not contain varying parts. Name describes - * what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 - * characters. Not guaranteed to be unique in any way. [Optional]. - * This deprecated field is planned to be removed March 15, 2022. Receivers can - * ignore this field. - * - * Generated from protobuf field string name = 4 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setName($var) - { - @trigger_error('name is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - /** * A value containing the body of the log record. Can be for example a human-readable * string message (including multi-line) describing the event in a free form or it can diff --git a/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php b/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php index d26fe4408..70b399b61 100644 --- a/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php +++ b/proto/otel/Opentelemetry/Proto/Logs/V1/ResourceLogs.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of InstrumentationLibraryLogs from a Resource. + * A collection of ScopeLogs from a Resource. * * Generated from protobuf message opentelemetry.proto.logs.v1.ResourceLogs */ @@ -22,16 +22,43 @@ class ResourceLogs extends \Google\Protobuf\Internal\Message * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; */ protected $resource = null; + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + */ + private $scope_logs; /** * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; + * @deprecated */ private $instrumentation_library_logs; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; */ @@ -46,12 +73,34 @@ class ResourceLogs extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the logs in this message. * If this field is not set then resource info is unknown. + * @type \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $scope_logs + * A list of ScopeLogs that originate from a resource. * @type \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_logs * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * } */ public function __construct($data = NULL) { @@ -97,26 +146,98 @@ public function setResource($var) return $this; } + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeLogs() + { + return $this->scope_logs; + } + + /** + * A list of ScopeLogs that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.ScopeLogs scope_logs = 2; + * @param \Opentelemetry\Proto\Logs\V1\ScopeLogs[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeLogs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\ScopeLogs::class); + $this->scope_logs = $arr; + + return $this; + } + /** * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated */ public function getInstrumentationLibraryLogs() { + @trigger_error('instrumentation_library_logs is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_logs; } /** * A list of InstrumentationLibraryLogs that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_logs. Instead + * scope_logs SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_logs is set + * and scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_logs field MAY also set + * scope_logs to carry the same logs, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_logs and + * SHOULD NOT set instrumentation_library_logs. + * JSON receivers SHOULD check if instrumentation_library_logs is set and + * scope_logs is not set then the value in instrumentation_library_logs + * SHOULD be used instead by converting InstrumentationLibraryLogs into ScopeLogs. + * If scope_logs is set then instrumentation_library_logs field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2; + * Generated from protobuf field repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 1000 [deprecated = true]; * @param \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setInstrumentationLibraryLogs($var) { + @trigger_error('instrumentation_library_logs is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs::class); $this->instrumentation_library_logs = $arr; @@ -125,8 +246,7 @@ public function setInstrumentationLibraryLogs($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -138,8 +258,7 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_logs" field which have their own - * schema_url field. + * to the data in the "scope_logs" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php index 904365b28..2d2933c4a 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/HistogramDataPoint.php @@ -66,9 +66,9 @@ class HistogramDataPoint extends \Google\Protobuf\Internal\Message * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field double sum = 5; + * Generated from protobuf field optional double sum = 5; */ - protected $sum = 0.0; + protected $sum = null; /** * bucket_counts is an optional field contains the count values of histogram * for each bucket. @@ -302,12 +302,22 @@ public function setCount($var) * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field double sum = 5; + * Generated from protobuf field optional double sum = 5; * @return float */ public function getSum() { - return $this->sum; + return isset($this->sum) ? $this->sum : 0.0; + } + + public function hasSum() + { + return isset($this->sum); + } + + public function clearSum() + { + unset($this->sum); } /** @@ -319,7 +329,7 @@ public function getSum() * doing so. This is specifically to enforce compatibility w/ OpenMetrics, * see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram * - * Generated from protobuf field double sum = 5; + * Generated from protobuf field optional double sum = 5; * @param float $var * @return $this */ diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php index 342b359a0..807aa1054 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/InstrumentationLibraryMetrics.php @@ -10,6 +10,9 @@ /** * A collection of Metrics produced by an InstrumentationLibrary. + * InstrumentationLibraryMetrics is wire-compatible with ScopeMetrics for binary + * Protobuf format. + * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics */ diff --git a/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php b/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php index 3c78db69f..30bb5ef4e 100644 --- a/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php +++ b/proto/otel/Opentelemetry/Proto/Metrics/V1/ResourceMetrics.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of InstrumentationLibraryMetrics from a Resource. + * A collection of ScopeMetrics from a Resource. * * Generated from protobuf message opentelemetry.proto.metrics.v1.ResourceMetrics */ @@ -25,13 +25,40 @@ class ResourceMetrics extends \Google\Protobuf\Internal\Message /** * A list of metrics that originate from a resource. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + */ + private $scope_metrics; + /** + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; + * @deprecated */ private $instrumentation_library_metrics; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; */ @@ -46,12 +73,34 @@ class ResourceMetrics extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the metrics in this message. * If this field is not set then no resource info is known. - * @type \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_metrics + * @type \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $scope_metrics * A list of metrics that originate from a resource. + * @type \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_metrics + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * } */ public function __construct($data = NULL) { @@ -100,23 +149,95 @@ public function setResource($var) /** * A list of metrics that originate from a resource. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; * @return \Google\Protobuf\Internal\RepeatedField */ + public function getScopeMetrics() + { + return $this->scope_metrics; + } + + /** + * A list of metrics that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.ScopeMetrics scope_metrics = 2; + * @param \Opentelemetry\Proto\Metrics\V1\ScopeMetrics[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeMetrics($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ScopeMetrics::class); + $this->scope_metrics = $arr; + + return $this; + } + + /** + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. + * + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ public function getInstrumentationLibraryMetrics() { + @trigger_error('instrumentation_library_metrics is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_metrics; } /** - * A list of metrics that originate from a resource. + * A list of InstrumentationLibraryMetrics that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_metrics. Instead + * scope_metrics SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_metrics is set + * and scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_metrics field MAY also set + * scope_metrics to carry the same metrics, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_metrics and + * SHOULD NOT set instrumentation_library_metrics. + * JSON receivers SHOULD check if instrumentation_library_metrics is set and + * scope_metrics is not set then the value in instrumentation_library_metrics + * SHOULD be used instead by converting InstrumentationLibraryMetrics into ScopeMetrics. + * If scope_metrics is set then instrumentation_library_metrics field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2; + * Generated from protobuf field repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 1000 [deprecated = true]; * @param \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setInstrumentationLibraryMetrics($var) { + @trigger_error('instrumentation_library_metrics is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics::class); $this->instrumentation_library_metrics = $arr; @@ -125,8 +246,7 @@ public function setInstrumentationLibraryMetrics($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -138,8 +258,7 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_metrics" field which have their own - * schema_url field. + * to the data in the "scope_metrics" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php b/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php index f9819abce..c5cc122e7 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/InstrumentationLibrarySpans.php @@ -10,6 +10,9 @@ /** * A collection of Spans produced by an InstrumentationLibrary. + * InstrumentationLibrarySpans is wire-compatible with ScopeSpans for binary + * Protobuf format. + * This message is deprecated and will be removed on June 15, 2022. * * Generated from protobuf message opentelemetry.proto.trace.v1.InstrumentationLibrarySpans */ diff --git a/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php b/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php index 1d3c65c1e..4c9227480 100644 --- a/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php +++ b/proto/otel/Opentelemetry/Proto/Trace/V1/ResourceSpans.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * A collection of InstrumentationLibrarySpans from a Resource. + * A collection of ScopeSpans from a Resource. * * Generated from protobuf message opentelemetry.proto.trace.v1.ResourceSpans */ @@ -22,16 +22,43 @@ class ResourceSpans extends \Google\Protobuf\Internal\Message * Generated from protobuf field .opentelemetry.proto.resource.v1.Resource resource = 1; */ protected $resource = null; + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + */ + private $scope_spans; /** * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; + * @deprecated */ private $instrumentation_library_spans; /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; */ @@ -46,12 +73,34 @@ class ResourceSpans extends \Google\Protobuf\Internal\Message * @type \Opentelemetry\Proto\Resource\V1\Resource $resource * The resource for the spans in this message. * If this field is not set then no resource info is known. + * @type \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $scope_spans + * A list of ScopeSpans that originate from a resource. * @type \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_spans * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * @type string $schema_url * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * } */ public function __construct($data = NULL) { @@ -97,26 +146,98 @@ public function setResource($var) return $this; } + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopeSpans() + { + return $this->scope_spans; + } + + /** + * A list of ScopeSpans that originate from a resource. + * + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.ScopeSpans scope_spans = 2; + * @param \Opentelemetry\Proto\Trace\V1\ScopeSpans[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopeSpans($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\ScopeSpans::class); + $this->scope_spans = $arr; + + return $this; + } + /** * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated */ public function getInstrumentationLibrarySpans() { + @trigger_error('instrumentation_library_spans is deprecated.', E_USER_DEPRECATED); return $this->instrumentation_library_spans; } /** * A list of InstrumentationLibrarySpans that originate from a resource. + * This field is deprecated and will be removed after grace period expires on June 15, 2022. + * During the grace period the following rules SHOULD be followed: + * For Binary Protobufs + * ==================== + * Binary Protobuf senders SHOULD NOT set instrumentation_library_spans. Instead + * scope_spans SHOULD be set. + * Binary Protobuf receivers SHOULD check if instrumentation_library_spans is set + * and scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans SHOULD be ignored. + * For JSON + * ======== + * JSON senders that set instrumentation_library_spans field MAY also set + * scope_spans to carry the same spans, essentially double-publishing the same data. + * Such double-publishing MAY be controlled by a user-settable option. + * If double-publishing is not used then the senders SHOULD set scope_spans and + * SHOULD NOT set instrumentation_library_spans. + * JSON receivers SHOULD check if instrumentation_library_spans is set and + * scope_spans is not set then the value in instrumentation_library_spans + * SHOULD be used instead by converting InstrumentationLibrarySpans into ScopeSpans. + * If scope_spans is set then instrumentation_library_spans field SHOULD be ignored. * - * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2; + * Generated from protobuf field repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 1000 [deprecated = true]; * @param \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $var * @return $this + * @deprecated */ public function setInstrumentationLibrarySpans($var) { + @trigger_error('instrumentation_library_spans is deprecated.', E_USER_DEPRECATED); $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans::class); $this->instrumentation_library_spans = $arr; @@ -125,8 +246,7 @@ public function setInstrumentationLibrarySpans($var) /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @return string @@ -138,8 +258,7 @@ public function getSchemaUrl() /** * This schema_url applies to the data in the "resource" field. It does not apply - * to the data in the "instrumentation_library_spans" field which have their own - * schema_url field. + * to the data in the "scope_spans" field which have their own schema_url field. * * Generated from protobuf field string schema_url = 3; * @param string $var diff --git a/proto/otel/VERSION b/proto/otel/VERSION index 4a29f93bb..cfe6c0094 100644 --- a/proto/otel/VERSION +++ b/proto/otel/VERSION @@ -1 +1 @@ -v0.14.0 +v0.16.0 diff --git a/script/proto_gen.sh b/script/proto_gen.sh index db354c47b..37bc699e8 100755 --- a/script/proto_gen.sh +++ b/script/proto_gen.sh @@ -5,7 +5,7 @@ OTEL_DIR="Opentelemetry" REPO_DIR=opentelemetry-proto cd "${DESTINATION_DIR}" || exit -rm -rf ./${REPO_DIR} +[[ -d ./${REPO_DIR} ]] && rm -rf ./${REPO_DIR} git clone https://github.com/open-telemetry/${REPO_DIR} ( @@ -21,7 +21,8 @@ git clone https://github.com/open-telemetry/${REPO_DIR} echo "Generating protobuf files for version ${TAG} ..." make gen-php - rm -rf ${GPBMETA_DIR} ${OTEL_DIR} + [[ -d ${GPBMETA_DIR} ]] && rm -rf ${GPBMETA_DIR} + [[ -d ${OTEL_DIR} ]] && rm -rf ${OTEL_DIR} echo "${TAG}" > "${DESTINATION_DIR}/VERSION" ) diff --git a/src/API/Metrics/MeterProviderInterface.php b/src/API/Metrics/MeterProviderInterface.php index 7453f3c7a..74a0a6085 100644 --- a/src/API/Metrics/MeterProviderInterface.php +++ b/src/API/Metrics/MeterProviderInterface.php @@ -8,13 +8,13 @@ interface MeterProviderInterface { /** * @access public - * @param string $name - (required) - This name must identify the instrumentation library + * @param string $name - (required) - This name must identify the instrumentation scope * (e.g. io.opentelemetry.contrib.mongodb) and not the instrumented library. * In case an invalid name (null or empty string) is specified, a working default Meter implementation is returned * as a fallback rather than returning null or throwing an exception. * A MeterProvider could also return a no-op Meter here if application owners configure the SDK to suppress * telemetry produced by this library. - * @param ?string $version - (optional) - Specifies the version of the instrumentation library (e.g. semver:1.0.0) + * @param ?string $version - (optional) - Specifies the version of the instrumentation scope (e.g. semver:1.0.0) * @return MeterInterface */ public function getMeter(string $name, ?string $version = null): MeterInterface; diff --git a/src/Contrib/Jaeger/SpanConverter.php b/src/Contrib/Jaeger/SpanConverter.php index d1bfaddef..ded2770e5 100644 --- a/src/Contrib/Jaeger/SpanConverter.php +++ b/src/Contrib/Jaeger/SpanConverter.php @@ -25,8 +25,8 @@ class SpanConverter implements SpanConverterInterface const STATUS_ERROR = 'ERROR'; const KEY_ERROR_FLAG = 'error'; const STATUS_DESCRIPTION_TAG_KEY = 'otel.status_description'; - const KEY_INSTRUMENTATION_LIBRARY_NAME = 'otel.library.name'; - const KEY_INSTRUMENTATION_LIBRARY_VERSION = 'otel.library.version'; + const KEY_INSTRUMENTATION_SCOPE_NAME = 'otel.scope.name'; + const KEY_INSTRUMENTATION_SCOPE_VERSION = 'otel.scope.version'; const KEY_SPAN_KIND = 'span.kind'; const JAEGER_SPAN_KIND_CLIENT = 'client'; const JAEGER_SPAN_KIND_SERVER = 'server'; @@ -150,12 +150,12 @@ private static function convertOtelSpanDataToJaegerTags(SpanDataInterface $span) } } - if (!empty($span->getInstrumentationLibrary()->getName())) { - $tags[SpanConverter::KEY_INSTRUMENTATION_LIBRARY_NAME] = $span->getInstrumentationLibrary()->getName(); + if (!empty($span->getInstrumentationScope()->getName())) { + $tags[SpanConverter::KEY_INSTRUMENTATION_SCOPE_NAME] = $span->getInstrumentationScope()->getName(); } - if ($span->getInstrumentationLibrary()->getVersion() !== null) { - $tags[SpanConverter::KEY_INSTRUMENTATION_LIBRARY_VERSION] = $span->getInstrumentationLibrary()->getVersion(); + if ($span->getInstrumentationScope()->getVersion() !== null) { + $tags[SpanConverter::KEY_INSTRUMENTATION_SCOPE_VERSION] = $span->getInstrumentationScope()->getVersion(); } $jaegerSpanKind = self::convertOtelSpanKindToJaeger($span); diff --git a/src/Contrib/Otlp/SpanConverter.php b/src/Contrib/Otlp/SpanConverter.php index 5b5cbdaae..f24867e83 100644 --- a/src/Contrib/Otlp/SpanConverter.php +++ b/src/Contrib/Otlp/SpanConverter.php @@ -9,11 +9,11 @@ use OpenTelemetry\API\Trace as API; use Opentelemetry\Proto\Common\V1\AnyValue; use Opentelemetry\Proto\Common\V1\ArrayValue; -use Opentelemetry\Proto\Common\V1\InstrumentationLibrary; +use Opentelemetry\Proto\Common\V1\InstrumentationScope; use Opentelemetry\Proto\Common\V1\KeyValue; use Opentelemetry\Proto\Resource\V1\Resource; -use Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans; use Opentelemetry\Proto\Trace\V1\ResourceSpans; +use Opentelemetry\Proto\Trace\V1\ScopeSpans; use Opentelemetry\Proto\Trace\V1\Span as CollectorSpan; use Opentelemetry\Proto\Trace\V1\Span\Event; use Opentelemetry\Proto\Trace\V1\Span\Link; @@ -186,30 +186,30 @@ private function as_otlp_resource_span(iterable $spans): ResourceSpans { $isSpansEmpty = true; //Waiting for the loop to prove otherwise - $ils = $convertedSpans = $schemas = []; + $instrumentationScopes = $convertedSpans = $schemas = []; foreach ($spans as /** @var SpanDataInterface $span */ $span) { $isSpansEmpty = false; - $il = $span->getInstrumentationLibrary(); - $ilKey = KeyGenerator::generateInstanceKey($il->getName(), $il->getVersion(), $il->getSchemaUrl()); - if (!isset($ils[$ilKey])) { - $convertedSpans[$ilKey] = []; - $ils[$ilKey] = new InstrumentationLibrary(['name' => $il->getName(), 'version' => $il->getVersion() ?? '']); - $schemas[$ilKey] = $il->getSchemaUrl(); + $scope = $span->getInstrumentationScope(); + $isKey = KeyGenerator::generateInstanceKey($scope->getName(), $scope->getVersion(), $scope->getSchemaUrl()); + if (!isset($instrumentationScopes[$isKey])) { + $convertedSpans[$isKey] = []; + $instrumentationScopes[$isKey] = new InstrumentationScope(['name' => $scope->getName(), 'version' => $scope->getVersion() ?? '']); + $schemas[$isKey] = $scope->getSchemaUrl(); } - $convertedSpans[$ilKey][] = $this->as_otlp_span($span); + $convertedSpans[$isKey][] = $this->as_otlp_span($span); } if ($isSpansEmpty == true) { return new ResourceSpans(); } - $ilSpans = []; - foreach ($ils as $ilKey => $il) { - $ilSpans[] = new InstrumentationLibrarySpans([ - 'instrumentation_library' => $il, - 'spans' => $convertedSpans[$ilKey], - 'schema_url' => $schemas[$ilKey] ?? '', + $isSpans = []; + foreach ($instrumentationScopes as $isKey => $scope) { + $isSpans[] = new ScopeSpans([ + 'scope' => $scope, + 'spans' => $convertedSpans[$isKey], + 'schema_url' => $schemas[$isKey] ?? '', ]); } @@ -217,7 +217,7 @@ private function as_otlp_resource_span(iterable $spans): ResourceSpans 'resource' => new Resource([ 'attributes' => $this->as_otlp_resource_attributes($spans), ]), - 'instrumentation_library_spans' => $ilSpans, + 'scope_spans' => $isSpans, ]); } } diff --git a/src/Contrib/OtlpGrpc/Exporter.php b/src/Contrib/OtlpGrpc/Exporter.php index de9e33253..6687d2ae2 100644 --- a/src/Contrib/OtlpGrpc/Exporter.php +++ b/src/Contrib/OtlpGrpc/Exporter.php @@ -119,6 +119,8 @@ protected function doExport(iterable $spans): int [$response, $status] = $this->client->Export($request)->wait(); if ($status->code === \Grpc\STATUS_OK) { + self::logDebug('Exported span(s)', ['spans' => $resourceSpans]); + return self::STATUS_SUCCESS; } diff --git a/src/Contrib/Zipkin/SpanConverter.php b/src/Contrib/Zipkin/SpanConverter.php index 717f2c66e..4857d16dc 100644 --- a/src/Contrib/Zipkin/SpanConverter.php +++ b/src/Contrib/Zipkin/SpanConverter.php @@ -17,8 +17,8 @@ class SpanConverter implements SpanConverterInterface { const STATUS_CODE_TAG_KEY = 'otel.status_code'; const STATUS_DESCRIPTION_TAG_KEY = 'error'; - const KEY_INSTRUMENTATION_LIBRARY_NAME = 'otel.library.name'; - const KEY_INSTRUMENTATION_LIBRARY_VERSION = 'otel.library.version'; + const KEY_INSTRUMENTATION_SCOPE_NAME = 'otel.scope.name'; + const KEY_INSTRUMENTATION_SCOPE_VERSION = 'otel.scope.version'; const REMOTE_ENDPOINT_PREFERRED_ATTRIBUTE_TO_RANK_MAP = [ 'peer.service' => 1, @@ -107,12 +107,12 @@ private function convertSpan(SpanDataInterface $span): array $row['tags'][self::STATUS_DESCRIPTION_TAG_KEY] = $span->getStatus()->getDescription(); } - if (!empty($span->getInstrumentationLibrary()->getName())) { - $row[SpanConverter::KEY_INSTRUMENTATION_LIBRARY_NAME] = $span->getInstrumentationLibrary()->getName(); + if (!empty($span->getInstrumentationScope()->getName())) { + $row[SpanConverter::KEY_INSTRUMENTATION_SCOPE_NAME] = $span->getInstrumentationScope()->getName(); } - if ($span->getInstrumentationLibrary()->getVersion() !== null) { - $row[SpanConverter::KEY_INSTRUMENTATION_LIBRARY_VERSION] = $span->getInstrumentationLibrary()->getVersion(); + if ($span->getInstrumentationScope()->getVersion() !== null) { + $row[SpanConverter::KEY_INSTRUMENTATION_SCOPE_VERSION] = $span->getInstrumentationScope()->getVersion(); } foreach ($span->getAttributes() as $k => $v) { diff --git a/src/SDK/Common/Dev/Compatibility/BC/InstrumentationLibrary.php b/src/SDK/Common/Dev/Compatibility/BC/InstrumentationLibrary.php index 6a49be3ce..476e7c950 100644 --- a/src/SDK/Common/Dev/Compatibility/BC/InstrumentationLibrary.php +++ b/src/SDK/Common/Dev/Compatibility/BC/InstrumentationLibrary.php @@ -5,7 +5,7 @@ namespace OpenTelemetry\SDK\Common\Dev\Compatibility\BC; use OpenTelemetry\SDK\Common\Dev\Compatibility\Util; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary as Moved; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope as Moved; /** * @codeCoverageIgnoreStart diff --git a/src/SDK/Common/Dev/Compatibility/BC/InstrumentationLibraryInterface.php b/src/SDK/Common/Dev/Compatibility/BC/InstrumentationScopeInterface.php similarity index 79% rename from src/SDK/Common/Dev/Compatibility/BC/InstrumentationLibraryInterface.php rename to src/SDK/Common/Dev/Compatibility/BC/InstrumentationScopeInterface.php index 6c01083b1..5a69a4ce6 100644 --- a/src/SDK/Common/Dev/Compatibility/BC/InstrumentationLibraryInterface.php +++ b/src/SDK/Common/Dev/Compatibility/BC/InstrumentationScopeInterface.php @@ -4,7 +4,7 @@ namespace OpenTelemetry\SDK\Common\Dev\Compatibility\BC; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface as Moved; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeInterface as Moved; interface InstrumentationLibraryInterface extends Moved { diff --git a/src/SDK/Common/Dev/Compatibility/_load.php b/src/SDK/Common/Dev/Compatibility/_load.php index d2773d97a..7ea1647cb 100644 --- a/src/SDK/Common/Dev/Compatibility/_load.php +++ b/src/SDK/Common/Dev/Compatibility/_load.php @@ -10,5 +10,5 @@ require_once __DIR__ . '/BC/AbstractClock.php'; require_once __DIR__ . '/BC/SystemClock.php'; require_once __DIR__ . '/BC/GlobalLoggerHolder.php'; -require_once __DIR__ . '/BC/InstrumentationLibraryInterface.php'; +require_once __DIR__ . '/BC/InstrumentationScopeInterface.php'; require_once __DIR__ . '/BC/InstrumentationLibrary.php'; diff --git a/src/SDK/Common/Instrumentation/InstrumentationLibrary.php b/src/SDK/Common/Instrumentation/InstrumentationScope.php similarity index 78% rename from src/SDK/Common/Instrumentation/InstrumentationLibrary.php rename to src/SDK/Common/Instrumentation/InstrumentationScope.php index 4e6cd180a..e0012ecab 100644 --- a/src/SDK/Common/Instrumentation/InstrumentationLibrary.php +++ b/src/SDK/Common/Instrumentation/InstrumentationScope.php @@ -5,9 +5,9 @@ namespace OpenTelemetry\SDK\Common\Instrumentation; /** - * Represents the instrumentation library information associated with the Tracer or Meter + * Represents the instrumentation scope information associated with the Tracer or Meter */ -final class InstrumentationLibrary implements InstrumentationLibraryInterface +final class InstrumentationScope implements InstrumentationScopeInterface { private static ?self $empty = null; @@ -26,7 +26,7 @@ public function __construct(string $name, ?string $version = null, ?string $sche * @internal * @psalm-internal OpenTelemetry */ - public static function getEmpty(): InstrumentationLibrary + public static function getEmpty(): InstrumentationScope { return self::$empty ?? self::$empty = new self('', null, null); } diff --git a/src/SDK/Common/Instrumentation/InstrumentationLibraryInterface.php b/src/SDK/Common/Instrumentation/InstrumentationScopeInterface.php similarity index 83% rename from src/SDK/Common/Instrumentation/InstrumentationLibraryInterface.php rename to src/SDK/Common/Instrumentation/InstrumentationScopeInterface.php index c62efac5d..806099441 100644 --- a/src/SDK/Common/Instrumentation/InstrumentationLibraryInterface.php +++ b/src/SDK/Common/Instrumentation/InstrumentationScopeInterface.php @@ -4,7 +4,7 @@ namespace OpenTelemetry\SDK\Common\Instrumentation; -interface InstrumentationLibraryInterface +interface InstrumentationScopeInterface { public function getName(): string; diff --git a/src/SDK/Common/Instrumentation/KeyGenerator.php b/src/SDK/Common/Instrumentation/KeyGenerator.php index 27868f49e..d7598feb1 100644 --- a/src/SDK/Common/Instrumentation/KeyGenerator.php +++ b/src/SDK/Common/Instrumentation/KeyGenerator.php @@ -7,7 +7,7 @@ class KeyGenerator { /** - * Generate a unique key for an instance of InstrumentationLibrary, with parameters matching those of the + * Generate a unique key for an instance of InstrumentationScope, with parameters matching those of the * class' constructor. * @param string $name * @param ?string $version diff --git a/src/SDK/Trace/ImmutableSpan.php b/src/SDK/Trace/ImmutableSpan.php index 39305d09a..86a67640a 100644 --- a/src/SDK/Trace/ImmutableSpan.php +++ b/src/SDK/Trace/ImmutableSpan.php @@ -7,7 +7,7 @@ use function max; use OpenTelemetry\API\Trace as API; use OpenTelemetry\SDK\Common\Attribute\AttributesInterface; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeInterface; use OpenTelemetry\SDK\Resource\ResourceInfo; /** @@ -102,9 +102,9 @@ public function getEndEpochNanos(): int return $this->endEpochNanos; } - public function getInstrumentationLibrary(): InstrumentationLibraryInterface + public function getInstrumentationScope(): InstrumentationScopeInterface { - return $this->span->getInstrumentationLibrary(); + return $this->span->getInstrumentationScope(); } public function getResource(): ResourceInfo diff --git a/src/SDK/Trace/ReadableSpanInterface.php b/src/SDK/Trace/ReadableSpanInterface.php index e6ad2a307..40704ab4e 100644 --- a/src/SDK/Trace/ReadableSpanInterface.php +++ b/src/SDK/Trace/ReadableSpanInterface.php @@ -5,7 +5,7 @@ namespace OpenTelemetry\SDK\Trace; use OpenTelemetry\API\Trace as API; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeInterface; /** * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/sdk.md#additional-span-interfaces @@ -18,7 +18,7 @@ public function getContext(): API\SpanContextInterface; public function getParentContext(): API\SpanContextInterface; - public function getInstrumentationLibrary(): InstrumentationLibraryInterface; + public function getInstrumentationScope(): InstrumentationScopeInterface; public function hasEnded(): bool; diff --git a/src/SDK/Trace/Span.php b/src/SDK/Trace/Span.php index 3db01336d..2711970b7 100644 --- a/src/SDK/Trace/Span.php +++ b/src/SDK/Trace/Span.php @@ -16,7 +16,7 @@ use OpenTelemetry\SDK\Common\Attribute\AttributeLimits; use OpenTelemetry\SDK\Common\Attribute\Attributes; use OpenTelemetry\SDK\Common\Attribute\AttributesInterface; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeInterface; use OpenTelemetry\SDK\Common\Time\ClockFactory; use OpenTelemetry\SDK\Resource\ResourceInfo; use function sprintf; @@ -55,7 +55,7 @@ final class Span extends API\AbstractSpan implements ReadWriteSpanInterface private ResourceInfo $resource; /** @readonly */ - private InstrumentationLibraryInterface $instrumentationLibrary; + private InstrumentationScopeInterface $instrumentationScope; /** @readonly */ private int $startEpochNanos; @@ -79,7 +79,7 @@ final class Span extends API\AbstractSpan implements ReadWriteSpanInterface private function __construct( string $name, API\SpanContextInterface $context, - InstrumentationLibraryInterface $instrumentationLibrary, + InstrumentationScopeInterface $instrumentationScope, int $kind, API\SpanContextInterface $parentSpanContext, SpanLimits $spanLimits, @@ -91,7 +91,7 @@ private function __construct( int $startEpochNanos ) { $this->context = $context; - $this->instrumentationLibrary = $instrumentationLibrary; + $this->instrumentationScope = $instrumentationScope; $this->parentSpanContext = $parentSpanContext; $this->links = $links; $this->totalRecordedLinks = $totalRecordedLinks; @@ -119,7 +119,7 @@ private function __construct( public static function startSpan( string $name, API\SpanContextInterface $context, - InstrumentationLibraryInterface $instrumentationLibrary, + InstrumentationScopeInterface $instrumentationScope, int $kind, API\SpanInterface $parentSpan, Context $parentContext, @@ -134,7 +134,7 @@ public static function startSpan( $span = new self( $name, $context, - $instrumentationLibrary, + $instrumentationScope, $kind, $parentSpan->getContext(), $spanLimits, @@ -338,9 +338,9 @@ public function getParentContext(): API\SpanContextInterface return $this->parentSpanContext; } - public function getInstrumentationLibrary(): InstrumentationLibraryInterface + public function getInstrumentationScope(): InstrumentationScopeInterface { - return $this->instrumentationLibrary; + return $this->instrumentationScope; } public function hasEnded(): bool diff --git a/src/SDK/Trace/SpanBuilder.php b/src/SDK/Trace/SpanBuilder.php index 75bbef2cc..4caaefec8 100644 --- a/src/SDK/Trace/SpanBuilder.php +++ b/src/SDK/Trace/SpanBuilder.php @@ -10,7 +10,7 @@ use OpenTelemetry\SDK\Common\Attribute\AttributeLimits; use OpenTelemetry\SDK\Common\Attribute\Attributes; use OpenTelemetry\SDK\Common\Attribute\AttributesInterface; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeInterface; final class SpanBuilder implements API\SpanBuilderInterface { @@ -21,7 +21,7 @@ final class SpanBuilder implements API\SpanBuilderInterface private string $spanName; /** @readonly */ - private InstrumentationLibraryInterface $instrumentationLibrary; + private InstrumentationScopeInterface $instrumentationScope; /** @readonly */ private TracerSharedState $tracerSharedState; @@ -46,12 +46,12 @@ final class SpanBuilder implements API\SpanBuilderInterface /** @param non-empty-string $spanName */ public function __construct( string $spanName, - InstrumentationLibraryInterface $instrumentationLibrary, + InstrumentationScopeInterface $instrumentationScope, TracerSharedState $tracerSharedState, SpanLimits $spanLimits ) { $this->spanName = $spanName; - $this->instrumentationLibrary = $instrumentationLibrary; + $this->instrumentationScope = $instrumentationScope; $this->tracerSharedState = $tracerSharedState; $this->spanLimits = $spanLimits; } @@ -206,7 +206,7 @@ public function startSpan(): API\SpanInterface return Span::startSpan( $this->spanName, $spanContext, - $this->instrumentationLibrary, + $this->instrumentationScope, $this->spanKind, $parentSpan, $parentContext, diff --git a/src/SDK/Trace/SpanDataInterface.php b/src/SDK/Trace/SpanDataInterface.php index b3ea59142..ac5c61c2b 100644 --- a/src/SDK/Trace/SpanDataInterface.php +++ b/src/SDK/Trace/SpanDataInterface.php @@ -6,7 +6,7 @@ use OpenTelemetry\API\Trace as API; use OpenTelemetry\SDK\Common\Attribute\AttributesInterface; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeInterface; use OpenTelemetry\SDK\Resource\ResourceInfo; /** @@ -35,7 +35,7 @@ public function getLinks(): array; public function getEndEpochNanos(): int; public function hasEnded(): bool; - public function getInstrumentationLibrary(): InstrumentationLibraryInterface; + public function getInstrumentationScope(): InstrumentationScopeInterface; public function getResource(): ResourceInfo; /** @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/sdk_exporters/non-otlp.md#dropped-events-count */ diff --git a/src/SDK/Trace/Tracer.php b/src/SDK/Trace/Tracer.php index 953b1b9b3..06478904b 100644 --- a/src/SDK/Trace/Tracer.php +++ b/src/SDK/Trace/Tracer.php @@ -6,7 +6,7 @@ use function ctype_space; use OpenTelemetry\API\Trace as API; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibraryInterface; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScopeInterface; class Tracer implements API\TracerInterface { @@ -16,14 +16,14 @@ class Tracer implements API\TracerInterface private TracerSharedState $tracerSharedState; /** @readonly */ - private InstrumentationLibraryInterface $instrumentationLibrary; + private InstrumentationScopeInterface $instrumentationScope; public function __construct( TracerSharedState $tracerSharedState, - InstrumentationLibraryInterface $instrumentationLibrary + InstrumentationScopeInterface $instrumentationScope ) { $this->tracerSharedState = $tracerSharedState; - $this->instrumentationLibrary = $instrumentationLibrary; + $this->instrumentationScope = $instrumentationScope; } /** @inheritDoc */ @@ -39,14 +39,14 @@ public function spanBuilder(string $spanName): API\SpanBuilderInterface return new SpanBuilder( $spanName, - $this->instrumentationLibrary, + $this->instrumentationScope, $this->tracerSharedState, $this->tracerSharedState->getSpanLimits() ); } - public function getInstrumentationLibrary(): InstrumentationLibraryInterface + public function getInstrumentationScope(): InstrumentationScopeInterface { - return $this->instrumentationLibrary; + return $this->instrumentationScope; } } diff --git a/src/SDK/Trace/TracerProvider.php b/src/SDK/Trace/TracerProvider.php index 837d089e2..ddf1c0a5e 100644 --- a/src/SDK/Trace/TracerProvider.php +++ b/src/SDK/Trace/TracerProvider.php @@ -7,7 +7,7 @@ use function is_array; use OpenTelemetry\API\Trace as API; use OpenTelemetry\API\Trace\NoopTracer; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Common\Instrumentation\KeyGenerator; use OpenTelemetry\SDK\Resource\ResourceInfo; use OpenTelemetry\SDK\Resource\ResourceInfoFactory; @@ -74,11 +74,11 @@ public function getTracer(string $name = self::DEFAULT_TRACER_NAME, ?string $ver return $this->tracers[$key]; } - $instrumentationLibrary = new InstrumentationLibrary($name, $version, $schemaUrl); + $instrumentationScope = new InstrumentationScope($name, $version, $schemaUrl); $tracer = new Tracer( $this->tracerSharedState, - $instrumentationLibrary, + $instrumentationScope, ); if (null === self::$defaultTracer) { self::$defaultTracer = $tracer; diff --git a/tests/Integration/SDK/TracerTest.php b/tests/Integration/SDK/TracerTest.php index a158f45b0..09c1f64e9 100644 --- a/tests/Integration/SDK/TracerTest.php +++ b/tests/Integration/SDK/TracerTest.php @@ -68,20 +68,20 @@ public function test_sampler_may_override_parents_trace_state(): void $this->assertEquals($newTraceState, $span->getContext()->getTraceState()); } - public function test_span_should_receive_instrumentation_library(): void + public function test_span_should_receive_instrumentation_scope(): void { $tracerProvider = new TracerProvider(); $tracer = $tracerProvider->getTracer('OpenTelemetry.TracerTest', 'dev', 'http://url'); /** @var Span $span */ $span = $tracer->spanBuilder('test.span')->startSpan(); - $spanInstrumentationLibrary = $span->getInstrumentationLibrary(); + $spanInstrumentationScope = $span->getInstrumentationScope(); - $this->assertEquals('OpenTelemetry.TracerTest', $spanInstrumentationLibrary->getName()); - $this->assertEquals('dev', $spanInstrumentationLibrary->getVersion()); - $this->assertEquals('http://url', $spanInstrumentationLibrary->getSchemaUrl()); + $this->assertEquals('OpenTelemetry.TracerTest', $spanInstrumentationScope->getName()); + $this->assertEquals('dev', $spanInstrumentationScope->getVersion()); + $this->assertEquals('http://url', $spanInstrumentationScope->getSchemaUrl()); } - public function test_span_builder_propagates_instrumentation_library_info_to_span(): void + public function test_span_builder_propagates_instrumentation_scope_info_to_span(): void { /** @var Span $span */ $span = (new TracerProvider()) @@ -89,7 +89,7 @@ public function test_span_builder_propagates_instrumentation_library_info_to_spa ->spanBuilder('span') ->startSpan(); - $this->assertSame('name', $span->getInstrumentationLibrary()->getName()); - $this->assertSame('version', $span->getInstrumentationLibrary()->getVersion()); + $this->assertSame('name', $span->getInstrumentationScope()->getName()); + $this->assertSame('version', $span->getInstrumentationScope()->getVersion()); } } diff --git a/tests/Unit/Contrib/JaegerSpanConverterTest.php b/tests/Unit/Contrib/JaegerSpanConverterTest.php index cf75563db..8d275e84e 100644 --- a/tests/Unit/Contrib/JaegerSpanConverterTest.php +++ b/tests/Unit/Contrib/JaegerSpanConverterTest.php @@ -9,7 +9,7 @@ use OpenTelemetry\API\Trace\StatusCode; use OpenTelemetry\Contrib\Jaeger\SpanConverter; use OpenTelemetry\SDK\Common\Attribute\Attributes; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Resource\ResourceInfo; use OpenTelemetry\SDK\Trace\Event; use OpenTelemetry\SDK\Trace\Link; @@ -53,9 +53,9 @@ public function test_should_correctly_generate_jaeger_thrift_tags() 'status_description' ) ) - ->setInstrumentationLibrary(new InstrumentationLibrary( - 'instrumentation_library_name', - 'instrumentation_library_version' + ->setInstrumentationScope(new InstrumentationScope( + 'instrumentation_scope_name', + 'instrumentation_scope_version' )) ->addAttribute('keyForBoolean', true) ->addAttribute('keyForArray', ['1stElement', '2ndElement', true]) @@ -81,11 +81,11 @@ public function test_should_correctly_generate_jaeger_thrift_tags() $this->assertSame('otel.status_description', $convertedSpan->tags[1]->key); $this->assertSame('status_description', $convertedSpan->tags[1]->vStr); - $this->assertSame('otel.library.name', $convertedSpan->tags[2]->key); - $this->assertSame('instrumentation_library_name', $convertedSpan->tags[2]->vStr); + $this->assertSame('otel.scope.name', $convertedSpan->tags[2]->key); + $this->assertSame('instrumentation_scope_name', $convertedSpan->tags[2]->vStr); - $this->assertSame('otel.library.version', $convertedSpan->tags[3]->key); - $this->assertSame('instrumentation_library_version', $convertedSpan->tags[3]->vStr); + $this->assertSame('otel.scope.version', $convertedSpan->tags[3]->key); + $this->assertSame('instrumentation_scope_version', $convertedSpan->tags[3]->vStr); $this->assertSame('keyForBoolean', $convertedSpan->tags[4]->key); $this->assertTrue($convertedSpan->tags[4]->vBool); diff --git a/tests/Unit/Contrib/OTLPSpanConverterTest.php b/tests/Unit/Contrib/OTLPSpanConverterTest.php index 9c8da828c..8364b70a0 100644 --- a/tests/Unit/Contrib/OTLPSpanConverterTest.php +++ b/tests/Unit/Contrib/OTLPSpanConverterTest.php @@ -13,11 +13,11 @@ use Opentelemetry\Proto\Common\V1\KeyValue; use Opentelemetry\Proto\Resource\V1\Resource; use Opentelemetry\Proto\Trace\V1; -use Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans; use Opentelemetry\Proto\Trace\V1\ResourceSpans; +use Opentelemetry\Proto\Trace\V1\ScopeSpans; use Opentelemetry\Proto\Trace\V1\Span\SpanKind as ProtoSpanKind; use OpenTelemetry\SDK\Common\Attribute\Attributes; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Resource\ResourceInfo; use OpenTelemetry\SDK\Trace\StatusData; use OpenTelemetry\Tests\Unit\SDK\Util\SpanData; @@ -41,7 +41,7 @@ public function test_convert_span_to_payload(): void ->setHasEnded(true); $converter = new SpanConverter(); - $row = $converter->convert([$span])[0]->getInstrumentationLibrarySpans()[0]->getSpans()[0]; + $row = $converter->convert([$span])[0]->getScopeSpans()[0]->getSpans()[0]; $this->assertSame($span->getContext()->getSpanId(), bin2hex($row->getSpanId())); $this->assertSame($span->getContext()->getTraceId(), bin2hex($row->getTraceId())); @@ -69,7 +69,7 @@ public function test_attribute_are_coerced_correctly($actual, $expected): void $converter = new SpanConverter(); $converted = $converter->convert([$span])[0]; - $attributes = $converted->getInstrumentationLibrarySpans()[0]->getSpans()[0]->getAttributes(); + $attributes = $converted->getScopeSpans()[0]->getSpans()[0]->getAttributes(); // Check that we can convert all attributes to tags $this->assertCount(1, $attributes); @@ -164,7 +164,7 @@ public function test_otlp_happy_path_span(): void ->setStartEpochNanos($start_time) ->setEndEpochNanos($end_time) ->setName('http_get') - ->setInstrumentationLibrary(new InstrumentationLibrary('lib-test', 'v0.1.0', 'http://url')) + ->setInstrumentationScope(new InstrumentationScope('lib-test', 'v0.1.0', 'http://url')) ->addAttribute('user', 'alice') ->addAttribute('authenticated', true) ->addEvent('Event1', new Attributes(['success' => 'yes']), 1617313804325769955) @@ -197,9 +197,9 @@ public function test_otlp_happy_path_span(): void ]), ], ]), - 'instrumentation_library_spans' => [ - new InstrumentationLibrarySpans([ - 'instrumentation_library' => new \Opentelemetry\Proto\Common\V1\InstrumentationLibrary([ + 'scope_spans' => [ + new ScopeSpans([ + 'scope' => new \Opentelemetry\Proto\Common\V1\InstrumentationScope([ 'name' => 'lib-test', 'version' => 'v0.1.0', ]), @@ -276,7 +276,7 @@ public function test_otlp_no_spans(): void public function test_span_kind($kind, $expected): void { $span = (new SpanData())->setKind($kind); - $row = (new SpanConverter())->convert([$span])[0]->getInstrumentationLibrarySpans()[0]->getSpans()[0]; + $row = (new SpanConverter())->convert([$span])[0]->getScopeSpans()[0]->getSpans()[0]; $this->assertSame($expected, $row->getKind()); } @@ -295,7 +295,7 @@ public function spanKindProvider(): array public function test_span_with_error_status(): void { $span = (new SpanData())->setStatus(StatusData::error()); - $row = (new SpanConverter())->convert([$span])[0]->getInstrumentationLibrarySpans()[0]->getSpans()[0]; + $row = (new SpanConverter())->convert([$span])[0]->getScopeSpans()[0]->getSpans()[0]; $this->assertSame(V1\Status\StatusCode::STATUS_CODE_ERROR, $row->getStatus()->getCode()); } } diff --git a/tests/Unit/Contrib/ZipkinSpanConverterTest.php b/tests/Unit/Contrib/ZipkinSpanConverterTest.php index 677cc5de5..8cc0d4a28 100644 --- a/tests/Unit/Contrib/ZipkinSpanConverterTest.php +++ b/tests/Unit/Contrib/ZipkinSpanConverterTest.php @@ -10,7 +10,7 @@ use OpenTelemetry\Contrib\Zipkin\SpanConverter; use OpenTelemetry\Contrib\Zipkin\SpanKind as ZipkinSpanKind; use OpenTelemetry\SDK\Common\Attribute\Attributes; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Resource\ResourceInfo; use OpenTelemetry\SDK\Trace\StatusData; use OpenTelemetry\Tests\Unit\SDK\Util\SpanData; @@ -38,9 +38,9 @@ public function test_should_convert_a_span_to_a_payload_for_zipkin(): void 'status_description' ) ) - ->setInstrumentationLibrary(new InstrumentationLibrary( - 'instrumentation_library_name', - 'instrumentation_library_version' + ->setInstrumentationScope(new InstrumentationScope( + 'instrumentation_scope_name', + 'instrumentation_scope_version' )) ->addAttribute('service', 'guard') ->addAttribute('net.peer.name', 'authorizationservice.com') @@ -85,8 +85,8 @@ public function test_should_convert_a_span_to_a_payload_for_zipkin(): void $this->assertSame('test-a', $row['tags']['instance']); $this->assertSame('unknown_service', $row['tags']['service.name']); - $this->assertSame('instrumentation_library_name', $row['otel.library.name']); - $this->assertSame('instrumentation_library_version', $row['otel.library.version']); + $this->assertSame('instrumentation_scope_name', $row['otel.scope.name']); + $this->assertSame('instrumentation_scope_version', $row['otel.scope.version']); $attribute = $span->getAttributes()->get('service'); $this->assertSame($attribute, $row['tags']['service']); @@ -109,8 +109,8 @@ public function test_should_omit_empty_keys_from_zipkin_span(): void $this->assertArrayNotHasKey('kind', $row); $this->assertArrayNotHasKey('parentId', $row); $this->assertArrayNotHasKey('tags', $row); - $this->assertArrayNotHasKey('otel.library.name', $row); - $this->assertArrayNotHasKey('otel.library.version', $row); + $this->assertArrayNotHasKey('otel.scope.name', $row); + $this->assertArrayNotHasKey('otel.scope.version', $row); } /** diff --git a/tests/Unit/SDK/Common/Instrumentation/InstrumentationLibraryTest.php b/tests/Unit/SDK/Common/Instrumentation/InstrumentationLibraryTest.php deleted file mode 100644 index e04ed1814..000000000 --- a/tests/Unit/SDK/Common/Instrumentation/InstrumentationLibraryTest.php +++ /dev/null @@ -1,36 +0,0 @@ -assertEmpty($library->getName()); - $this->assertNull($library->getVersion()); - $this->assertNull($library->getSchemaUrl()); - } - - public function test_getters(): void - { - $name = 'foo'; - $version = 'bar'; - $schemaUrl = 'http://baz'; - - $library = new InstrumentationLibrary($name, $version, $schemaUrl); - - $this->assertSame($name, $library->getName()); - $this->assertSame($version, $library->getVersion()); - $this->assertSame($schemaUrl, $library->getSchemaUrl()); - } -} diff --git a/tests/Unit/SDK/Common/Instrumentation/InstrumentationScopeTest.php b/tests/Unit/SDK/Common/Instrumentation/InstrumentationScopeTest.php new file mode 100644 index 000000000..498b55c30 --- /dev/null +++ b/tests/Unit/SDK/Common/Instrumentation/InstrumentationScopeTest.php @@ -0,0 +1,36 @@ +assertEmpty($scope->getName()); + $this->assertNull($scope->getVersion()); + $this->assertNull($scope->getSchemaUrl()); + } + + public function test_getters(): void + { + $name = 'foo'; + $version = 'bar'; + $schemaUrl = 'http://baz'; + + $scope = new InstrumentationScope($name, $version, $schemaUrl); + + $this->assertSame($name, $scope->getName()); + $this->assertSame($version, $scope->getVersion()); + $this->assertSame($schemaUrl, $scope->getSchemaUrl()); + } +} diff --git a/tests/Unit/SDK/Trace/ImmutableSpanTest.php b/tests/Unit/SDK/Trace/ImmutableSpanTest.php index eb55fe531..e100d9f31 100644 --- a/tests/Unit/SDK/Trace/ImmutableSpanTest.php +++ b/tests/Unit/SDK/Trace/ImmutableSpanTest.php @@ -7,7 +7,7 @@ use OpenTelemetry\API\Trace as API; use OpenTelemetry\API\Trace\SpanKind; use OpenTelemetry\SDK\Common\Attribute\AttributesInterface; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Resource\ResourceInfo; use OpenTelemetry\SDK\Trace\ImmutableSpan; use OpenTelemetry\SDK\Trace\Span; @@ -22,7 +22,7 @@ class ImmutableSpanTest extends TestCase private Span $span; private AttributesInterface $attributes; private StatusDataInterface $status; - private InstrumentationLibrary $instrumentationLibrary; + private InstrumentationScope $instrumentationScope; private ResourceInfo $resource; private API\SpanContextInterface $context; private API\SpanContextInterface $parentContext; @@ -40,7 +40,7 @@ protected function setUp():void { $this->context = $this->createMock(API\SpanContextInterface::class); $this->parentContext = $this->createMock(API\SpanContextInterface::class); - $this->instrumentationLibrary = $this->createMock(InstrumentationLibrary::class); + $this->instrumentationScope = $this->createMock(InstrumentationScope::class); $this->resource = $this->createMock(ResourceInfo::class); $this->span = $this->createMock(Span::class); @@ -50,7 +50,7 @@ protected function setUp():void $this->span->method('getKind')->willReturn(SpanKind::KIND_INTERNAL); $this->span->method('getContext')->willReturn($this->context); $this->span->method('getParentContext')->willReturn($this->parentContext); - $this->span->method('getInstrumentationLibrary')->willReturn($this->instrumentationLibrary); + $this->span->method('getInstrumentationScope')->willReturn($this->instrumentationScope); $this->span->method('getResource')->willReturn($this->resource); $this->span->method('getStartEpochNanos')->willReturn($this->startEpochNanes); $this->span->method('getTotalRecordedLinks')->willReturn($this->totalRecordedLinks); @@ -82,7 +82,7 @@ public function test_getters(): void $this->assertSame($this->parentSpanId, $span->getParentSpanId()); $this->assertSame($this->startEpochNanes, $span->getStartEpochNanos()); $this->assertSame($this->endEpochNanos, $span->getEndEpochNanos()); - $this->assertSame($this->instrumentationLibrary, $span->getInstrumentationLibrary()); + $this->assertSame($this->instrumentationScope, $span->getInstrumentationScope()); $this->assertSame($this->resource, $span->getResource()); $this->assertSame('name', $span->getName()); $this->assertSame([], $span->getLinks()); diff --git a/tests/Unit/SDK/Trace/SpanTest.php b/tests/Unit/SDK/Trace/SpanTest.php index e8afe5343..b6a9c8679 100644 --- a/tests/Unit/SDK/Trace/SpanTest.php +++ b/tests/Unit/SDK/Trace/SpanTest.php @@ -15,7 +15,7 @@ use OpenTelemetry\Context\Context; use OpenTelemetry\SDK\Common\Attribute\Attributes; use OpenTelemetry\SDK\Common\Attribute\AttributesInterface; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Common\Time\ClockFactory; use OpenTelemetry\SDK\Common\Time\ClockInterface; use OpenTelemetry\SDK\Common\Time\Util as TimeUtil; @@ -56,7 +56,7 @@ class SpanTest extends MockeryTestCase private IdGeneratorInterface $idGenerator; private ResourceInfo $resource; - private InstrumentationLibrary $instrumentationLibrary; + private InstrumentationScope $instrumentationScope; private API\SpanContextInterface $spanContext; private TestClock $testClock; @@ -71,7 +71,7 @@ protected function setUp():void { $this->idGenerator = new RandomIdGenerator(); $this->resource = ResourceInfoFactory::emptyResource(); - $this->instrumentationLibrary = new InstrumentationLibrary('test_library', '0.1.2'); + $this->instrumentationScope = new InstrumentationScope('test_scope', '0.1.2'); $this->spanProcessor = Mockery::spy(SpanProcessorInterface::class); @@ -385,10 +385,10 @@ public function test_set_attribute_empty_key(): void $this->assertEmpty($span->toSpanData()->getAttributes()); } - public function test_get_instrumentation_library_info(): void + public function test_get_instrumentation_scope_info(): void { $span = $this->createTestSpanWithAttributes(self::ATTRIBUTES); - $this->assertSame($this->instrumentationLibrary, $span->getInstrumentationLibrary()); + $this->assertSame($this->instrumentationScope, $span->getInstrumentationScope()); $span->end(); } @@ -697,7 +697,7 @@ private function createTestSpan( $span = Span::startSpan( self::SPAN_NAME, $this->spanContext, - $this->instrumentationLibrary, + $this->instrumentationScope, $kind, $parentSpanId ? Span::wrap(SpanContext::create($this->traceId, $parentSpanId)) : Span::getInvalid(), Context::getRoot(), @@ -781,7 +781,7 @@ private function assertSpanData( $this->assertSame($this->parentSpanId, $spanData->getParentSpanId()); $this->assertNull($spanData->getContext()->getTraceState()); $this->assertSame($this->resource, $spanData->getResource()); - $this->assertSame($this->instrumentationLibrary, $spanData->getInstrumentationLibrary()); + $this->assertSame($this->instrumentationScope, $spanData->getInstrumentationScope()); $this->assertEquals($events, $spanData->getEvents()); $this->assertEquals($links, $spanData->getLinks()); $this->assertSame($startEpochNanos, $spanData->getStartEpochNanos()); diff --git a/tests/Unit/SDK/Trace/TracerTest.php b/tests/Unit/SDK/Trace/TracerTest.php index 2634605f4..dd0049f12 100644 --- a/tests/Unit/SDK/Trace/TracerTest.php +++ b/tests/Unit/SDK/Trace/TracerTest.php @@ -4,7 +4,7 @@ namespace OpenTelemetry\Tests\Unit\SDK\Trace; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Trace\Tracer; use OpenTelemetry\SDK\Trace\TracerSharedState; use PHPUnit\Framework\TestCase; @@ -16,13 +16,13 @@ class TracerTest extends TestCase { private Tracer $tracer; private TracerSharedState $tracerSharedState; - private InstrumentationLibrary $instrumentationLibrary; + private InstrumentationScope $instrumentationScope; protected function setUp(): void { $this->tracerSharedState = $this->createMock(TracerSharedState::class); - $this->instrumentationLibrary = $this->createMock(InstrumentationLibrary::class); - $this->tracer = (new Tracer($this->tracerSharedState, $this->instrumentationLibrary)); + $this->instrumentationScope = $this->createMock(InstrumentationScope::class); + $this->tracer = (new Tracer($this->tracerSharedState, $this->instrumentationScope)); } /** @@ -49,8 +49,8 @@ public function nameProvider(): array /** */ - public function test_get_instrumentation_library(): void + public function test_get_instrumentation_scope(): void { - $this->assertSame($this->instrumentationLibrary, $this->tracer->getInstrumentationLibrary()); + $this->assertSame($this->instrumentationScope, $this->tracer->getInstrumentationScope()); } } diff --git a/tests/Unit/SDK/Util/SpanData.php b/tests/Unit/SDK/Util/SpanData.php index 254c41d20..0711ec08a 100644 --- a/tests/Unit/SDK/Util/SpanData.php +++ b/tests/Unit/SDK/Util/SpanData.php @@ -9,7 +9,7 @@ use OpenTelemetry\API\Trace as API; use OpenTelemetry\SDK\Common\Attribute\Attributes; use OpenTelemetry\SDK\Common\Attribute\AttributesInterface; -use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationLibrary; +use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope; use OpenTelemetry\SDK\Common\Time\ClockFactory; use OpenTelemetry\SDK\Resource\ResourceInfo; use OpenTelemetry\SDK\Resource\ResourceInfoFactory; @@ -34,7 +34,7 @@ class SpanData implements SDK\SpanDataInterface private int $kind; private StatusData $status; private ResourceInfo $resource; - private InstrumentationLibrary $instrumentationLibrary; + private InstrumentationScope $instrumentationScope; private API\SpanContextInterface $context; private API\SpanContextInterface $parentContext; private int $totalAttributeCount = 0; @@ -50,7 +50,7 @@ public function __construct() $this->kind = API\SpanKind::KIND_INTERNAL; $this->status = StatusData::unset(); $this->resource = ResourceInfoFactory::emptyResource(); - $this->instrumentationLibrary = InstrumentationLibrary::getEmpty(); /** @phan-suppress-current-line PhanAccessMethodInternal */ + $this->instrumentationScope = InstrumentationScope::getEmpty(); /** @phan-suppress-current-line PhanAccessMethodInternal */ $this->context = API\SpanContext::getInvalid(); $this->parentContext = API\SpanContext::getInvalid(); } @@ -237,14 +237,14 @@ public function setResource(ResourceInfo $resource): self return $this; } - public function getInstrumentationLibrary(): InstrumentationLibrary + public function getInstrumentationScope(): InstrumentationScope { - return $this->instrumentationLibrary; + return $this->instrumentationScope; } - public function setInstrumentationLibrary(InstrumentationLibrary $instrumentationLibrary): self + public function setInstrumentationScope(InstrumentationScope $instrumentationScope): self { - $this->instrumentationLibrary = $instrumentationLibrary; + $this->instrumentationScope = $instrumentationScope; return $this; } From 20fa81df108ae55bd9b26804100f56f55fe0f5f4 Mon Sep 17 00:00:00 2001 From: Brett McBride Date: Wed, 27 Apr 2022 17:30:17 +1000 Subject: [PATCH 5/5] rename collector docker-compose file --- Makefile | 6 +++--- ...-compose-collector.yaml => docker-compose.collector.yaml | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename docker-compose-collector.yaml => docker-compose.collector.yaml (100%) diff --git a/Makefile b/Makefile index 0b33e2015..22157b841 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ trace examples: FORCE docker-compose run -e NEW_RELIC_ENDPOINT -e NEW_RELIC_INSERT_KEY --rm php php ./examples/AlwaysOnZipkinToNewrelicExample.php docker-compose stop collector: - docker-compose -f docker-compose-collector.yaml up -d --remove-orphans - docker-compose -f docker-compose-collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=collector:4317 --rm php php ./examples/AlwaysOnOTLPGrpcExample.php - docker-compose -f docker-compose-collector.yaml stop + docker-compose -f docker-compose.collector.yaml up -d --remove-orphans + docker-compose -f docker-compose.collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=collector:4317 --rm php php ./examples/AlwaysOnOTLPGrpcExample.php + docker-compose -f docker-compose.collector.yaml stop fiber-ffi-example: @docker-compose -f docker-compose.fiber-ffi.yaml -p opentelemetry-php_fiber-ffi-example up -d web diff --git a/docker-compose-collector.yaml b/docker-compose.collector.yaml similarity index 100% rename from docker-compose-collector.yaml rename to docker-compose.collector.yaml