File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1313 "ext-json" : " *" ,
1414 "mongodb/mongodb" : " ^1.15" ,
1515 "open-telemetry/api" : " ^1.0.0beta12" ,
16- "open-telemetry/sem-conv" : " ^1"
16+ "open-telemetry/sem-conv" : " ^1.22 "
1717 },
1818 "require-dev" : {
1919 "friendsofphp/php-cs-fixer" : " ^3" ,
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ public function commandStarted(CommandStartedEvent $event): void
6161 ->setAttribute (TraceAttributes::DB_NAME , $ databaseName )
6262 ->setAttribute (TraceAttributes::DB_CONNECTION_STRING , $ connectionString )
6363 ->setAttribute (TraceAttributes::DB_OPERATION , $ commandName )
64- ->setAttribute (TraceAttributes::NET_PEER_NAME , $ isSocket ? null : $ host )
65- ->setAttribute (TraceAttributes::NET_PEER_PORT , $ isSocket ? null : $ port )
66- ->setAttribute (TraceAttributes::NET_TRANSPORT , $ isSocket ? 'unix ' : 'tcp ' )
64+ ->setAttribute (TraceAttributes::SERVER_ADDRESS , $ isSocket ? null : $ host )
65+ ->setAttribute (TraceAttributes::SERVER_PORT , $ isSocket ? null : $ port )
66+ ->setAttribute (TraceAttributes::NETWORK_TRANSPORT , $ isSocket ? 'unix ' : 'tcp ' )
6767 ->setAttribute (TraceAttributes::DB_STATEMENT , ($ this ->commandSerializer )($ command ))
6868 ->setAttribute (TraceAttributes::DB_MONGODB_COLLECTION , $ collectionName )
6969 ->setAttribute (MongoDBTraceAttributes::DB_MONGODB_MASTER , $ info ['ismaster ' ] ?? null )
Original file line number Diff line number Diff line change @@ -68,9 +68,9 @@ public function test_mongodb_find_one(): void
6868 self ::assertSame ('mongodb://127.0.0.1:27017/db ' , $ attributes ->get (TraceAttributes::DB_CONNECTION_STRING ));
6969 self ::assertSame ('find ' , $ attributes ->get (TraceAttributes::DB_OPERATION ));
7070 self ::assertSame (self ::COLLECTION_NAME , $ attributes ->get (TraceAttributes::DB_MONGODB_COLLECTION ));
71- self ::assertSame ('127.0.0.1 ' , $ attributes ->get (TraceAttributes::NET_PEER_NAME ));
72- self ::assertSame (27017 , $ attributes ->get (TraceAttributes::NET_PEER_PORT ));
73- self ::assertSame ('tcp ' , $ attributes ->get (TraceAttributes::NET_TRANSPORT ));
71+ self ::assertSame ('127.0.0.1 ' , $ attributes ->get (TraceAttributes::SERVER_ADDRESS ));
72+ self ::assertSame (27017 , $ attributes ->get (TraceAttributes::SERVER_PORT ));
73+ self ::assertSame ('tcp ' , $ attributes ->get (TraceAttributes::NETWORK_TRANSPORT ));
7474 self ::assertTrue ($ attributes ->get (MongoDBTraceAttributes::DB_MONGODB_MASTER ));
7575 self ::assertFalse ($ attributes ->get (MongoDBTraceAttributes::DB_MONGODB_READ_ONLY ));
7676 self ::assertIsNumeric ($ attributes ->get (MongoDBTraceAttributes::DB_MONGODB_CONNECTION_ID ));
You can’t perform that action at this time.
0 commit comments