78 lines
2.2 KiB
YAML
Executable File
78 lines
2.2 KiB
YAML
Executable File
# 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.
|
|
|
|
apiVersion: "config.istio.io/v1alpha2"
|
|
kind: adapter
|
|
metadata:
|
|
name: swadapter
|
|
namespace: istio-system
|
|
spec:
|
|
description:
|
|
session_based: false
|
|
templates:
|
|
- metric
|
|
---
|
|
|
|
apiVersion: "config.istio.io/v1alpha2"
|
|
kind: handler
|
|
metadata:
|
|
name: sw
|
|
namespace: istio-system
|
|
spec:
|
|
adapter: swadapter
|
|
connection:
|
|
address: "oap.skywalking.svc.cluster.local:11800"
|
|
---
|
|
|
|
# instance for template metric
|
|
apiVersion: "config.istio.io/v1alpha2"
|
|
kind: instance
|
|
metadata:
|
|
name: swmetric
|
|
namespace: istio-system
|
|
spec:
|
|
template: metric
|
|
params:
|
|
value: request.size | 0
|
|
dimensions:
|
|
sourceService: source.workload.name | ""
|
|
sourceNamespace: source.workload.namespace | ""
|
|
sourceUID: source.uid | ""
|
|
destinationService: destination.workload.name | ""
|
|
destinationNamespace: destination.workload.namespace | ""
|
|
destinationUID: destination.uid | ""
|
|
requestMethod: request.method | ""
|
|
requestPath: request.path | ""
|
|
requestScheme: request.scheme | ""
|
|
requestTime: request.time
|
|
responseTime: response.time
|
|
responseCode: response.code | 200
|
|
reporter: conditional((context.reporter.kind | "inbound") == "outbound", "source", "destination")
|
|
apiProtocol: api.protocol | ""
|
|
---
|
|
|
|
# rule to dispatch to handler sw
|
|
apiVersion: "config.istio.io/v1alpha2"
|
|
kind: rule
|
|
metadata:
|
|
name: swmetric-rule
|
|
namespace: istio-system
|
|
spec:
|
|
actions:
|
|
- handler: sw.istio-system
|
|
instances:
|
|
- swmetric
|