We can collect TCP metrics after we run the MongoDB database for ratings:v2. As we did in the previous section, here, we'll create an instance, handler, and a rule to collect metrics. Let's get started:
- Define a configuration for the sent and receive bytes from a server to a client:
# Script : 05-create-metric-instance.yaml
apiVersion: config.istio.io/v1alpha2
kind: instance
metadata:
name: mongosentbytes
...
params:
value: connection.sent.bytes | 0 # uses a TCP-specific attribute
dimensions:
source_service: source.workload.name | "unknown"
source_version: source.labels["version"] | "unknown"
destination_version: destination.labels["version"] | "unknown"
...
metadata:
name: mongoreceivedbytes
...
- Create a handler for bytes sent and received for the MongoDb database service:
$ kubectl...