File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
control/src/main/kotlin/spp/probe Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,19 @@ object ProbeConfiguration {
141
141
arrayOf(" skywalking.plugin.toolkit.log.transmit_formatted" , " false" ),
142
142
sppSettings.find { it[0 ] == " spp.platform_host" }?.let {
143
143
arrayOf(" skywalking.collector.backend_service" , it[1 ] + " :11800" )
144
+ },
145
+ getJsonObject(" authentication" )?.let {
146
+ val clientId = it.getString(" client_id" )
147
+ val clientSecret = it.getString(" client_secret" )
148
+ val tenantId = it.getString(" tenant_id" )
149
+ val authToken = " $clientId :$clientSecret " .let {
150
+ if (tenantId != null ) {
151
+ " $it :$tenantId "
152
+ } else {
153
+ it
154
+ }
155
+ }
156
+ arrayOf(" skywalking.agent.authentication" , authToken)
144
157
}
145
158
).filterNotNull().toMutableSet()
146
159
}
Original file line number Diff line number Diff line change @@ -202,7 +202,9 @@ object SourceProbe {
202
202
}
203
203
socket.result().closeHandler {
204
204
connected.set(false )
205
- connectToPlatform()
205
+ vertx!! .setTimer(5000 ) {
206
+ connectToPlatform()
207
+ }
206
208
}
207
209
208
210
// handle platform messages
@@ -242,6 +244,16 @@ object SourceProbe {
242
244
frame.getValue(" body" )
243
245
)
244
246
}
247
+ } else if (" err" == frame.getString(" type" )) {
248
+ val errorMessage = frame.getString(" message" )
249
+ if (ProbeConfiguration .isNotQuite) {
250
+ if (errorMessage == " blocked by bridgeEvent handler" ) {
251
+ System .err.println (" Probe authentication failed" )
252
+ } else {
253
+ System .err.println (frame.getString(" message" ))
254
+ }
255
+ }
256
+ disconnectFromPlatform()
245
257
} else {
246
258
throw UnsupportedOperationException (frame.toString())
247
259
}
You can’t perform that action at this time.
0 commit comments