original `Service,ServiceInstance,ServiceRelation,ServiceInstanceRelation`.
* [**Breaking Change**] TCP-related source names are changed, fields of TCP-related sources are changed, please refer to the latest `oal/tcp.oal` file.
* Do not log error logs when failed to create ElasticSearch index because the index is created already.
* Support `sampledTrace` in LAL.
* Support multiple rules with different names under the same layer of LAL script.
`sampledTrace` aims to convert LogData to SampledTrace Records. It extracts data from `parsed` result and save them as SampledTraceRecord. SampledTrace will not abort or edit logs, you can use other LAL for further processing.
We require a log tag `"LOG_KIND" = "NET_PROFILING_SAMPLED_TRACE"` to make OAP distinguish slow trace logs from other log reports.
if (tag("LOG_KIND") == "NET_PROFILING_SAMPLED_TRACE") {
sampledTrace {
latency parsed.latency as Long
uri parsed.uri as String
reason parsed.reason as String
if (parsed.client_process.process_id as String != "") {
processId parsed.client_process.process_id as String
} else if (parsed.client_process.local as Boolean) {
processId ProcessRegistry.generateVirtualLocalProcess(parsed.service as String, parsed.serviceInstance as String) as String
} else {
processId ProcessRegistry.generateVirtualRemoteProcess(parsed.service as String, parsed.serviceInstance as String, parsed.client_process.address as String) as String
}
if (parsed.server_process.process_id as String != "") {
destProcessId parsed.server_process.process_id as String
} else if (parsed.server_process.local as Boolean) {
destProcessId ProcessRegistry.generateVirtualLocalProcess(parsed.service as String, parsed.serviceInstance as String) as String
} else {
destProcessId ProcessRegistry.generateVirtualRemoteProcess(parsed.service as String, parsed.serviceInstance as String, parsed.server_process.address as String) as String
}
detectPoint parsed.detect_point as String
if (parsed.component as String == "http" && parsed.ssl as Boolean) {
componentId 129
} else if (parsed.component as String == "http") {
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The default LAL script to save all logs, behaving like the versions before 8.5.0.
rules:
-name:network-profiling-slow-trace
layer:K8S_SERVICE
dsl:|
filter {
json{
}
extractor{
if (tag("LOG_KIND") == "NET_PROFILING_SAMPLED_TRACE") {
sampledTrace {
latency parsed.latency as Long
uri parsed.uri as String
reason parsed.reason as String
if (parsed.client_process.process_id as String != "") {
processId parsed.client_process.process_id as String
} else if (parsed.client_process.local as Boolean) {
processId ProcessRegistry.generateVirtualLocalProcess(parsed.service as String, parsed.serviceInstance as String) as String
} else {
processId ProcessRegistry.generateVirtualRemoteProcess(parsed.service as String, parsed.serviceInstance as String, parsed.client_process.address as String) as String
}
if (parsed.server_process.process_id as String != "") {
destProcessId parsed.server_process.process_id as String
} else if (parsed.server_process.local as Boolean) {
destProcessId ProcessRegistry.generateVirtualLocalProcess(parsed.service as String, parsed.serviceInstance as String) as String
} else {
destProcessId ProcessRegistry.generateVirtualRemoteProcess(parsed.service as String, parsed.serviceInstance as String, parsed.server_process.address as String) as String
}
detectPoint parsed.detect_point as String
if (parsed.component as String == "http" && parsed.ssl as Boolean) {
componentId 129
} else if (parsed.component as String == "http") {
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
rules:
-name:network-profiling-slow-trace
layer:MESH_DP
dsl:|
filter {
json{
}
extractor{
if (tag("LOG_KIND") == "NET_PROFILING_SAMPLED_TRACE") {
sampledTrace {
latency parsed.latency as Long
uri parsed.uri as String
reason parsed.reason as String
if (parsed.client_process.process_id as String != "") {
processId parsed.client_process.process_id as String
} else if (parsed.client_process.local as Boolean) {
processId ProcessRegistry.generateVirtualLocalProcess(parsed.service as String, parsed.serviceInstance as String) as String
} else {
processId ProcessRegistry.generateVirtualRemoteProcess(parsed.service as String, parsed.serviceInstance as String, parsed.client_process.address as String) as String
}
if (parsed.server_process.process_id as String != "") {
destProcessId parsed.server_process.process_id as String
} else if (parsed.server_process.local as Boolean) {
destProcessId ProcessRegistry.generateVirtualLocalProcess(parsed.service as String, parsed.serviceInstance as String) as String
} else {
destProcessId ProcessRegistry.generateVirtualRemoteProcess(parsed.service as String, parsed.serviceInstance as String, parsed.server_process.address as String) as String
}
detectPoint parsed.detect_point as String
if (parsed.component as String == "http" && parsed.ssl as Boolean) {
componentId 129
} else if (parsed.component as String == "http") {