카타코더 - Identifying Slow Services with Distributed Tracing

1 개요[ | ]

카타코더 - Identifying Slow Services with Distributed Tracing

2 Bookinfo Sample[ | ]

Bookinfo-noistio.svg

master $ kubectl get pods
NAME                             READY     STATUS    RESTARTS   AGE
details-v1-7b5f4fc575-xxj4p      2/2       Running   0          1m
productpage-v1-c86d5ddf9-nltqm   2/2       Running   0          1m
ratings-v1-58d59948f5-nsrnk      2/2       Running   0          1m
reviews-v1-6d9787f845-j7qf4      2/2       Running   0          1m
reviews-v2-84b4476485-4wf8h      2/2       Running   0          1m
reviews-v3-55d6499f7c-7ztwp      2/2       Running   0          1m

3 View Tracing[ | ]

4 Simulate Slowdown[ | ]

master $ kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-test-delay-everyone.yaml
virtualservice.networking.istio.io/ratings configured

5 Identify Slowdown[ | ]

What happens after 7s?

  • The rating returns a response
  • The user is annoyed at the slow response time
  • A poor user experience is created

6 Simulate Failure[ | ]

samples/bookinfo/networking/virtual-service-ratings-test-fail-50.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ratings
spec:
  hosts:
  - ratings
  http:
  - match:
    - headers:
        user-agent:
          regex: ".*"
    fault:
      abort:
        percent: 50
        httpStatus: 500
    route:
    - destination:
        host: ratings
        subset: v1
  - route:
    - destination:
        host: ratings
        subset: v1
master $ kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-test-fail-50.yaml
virtualservice.networking.istio.io/ratings configured
master $ kubectl get virtualservice ratings -o yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"networking.istio.io/v1alpha3","kind":"VirtualService","metadata":{"annotations":{},"name":"ratings","namespace":"default"},"spec":{"hosts":["ratings"],"http":[{"fault":{"abort":{"httpStatus":500,"percent":50}},"match":[{"headers":{"user-agent":{"regex":".*"}}}],"route":[{"destination":{"host":"ratings","subset":"v1"}}]},{"route":[{"destination":{"host":"ratings","subset":"v1"}}]}]}}
  creationTimestamp: 2019-06-27T08:28:25Z
  generation: 1
  name: ratings
  namespace: default
  resourceVersion: "5320"
  selfLink: /apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/ratings
  uid: 88361f18-98b5-11e9-b6d7-0242ac110058
spec:
  hosts:
  - ratings
  http:
  - fault:
      abort:
        httpStatus: 500
        percent: 50
    match:
    - headers:
        user-agent:
          regex: .*
    route:
    - destination:
        host: ratings
        subset: v1
  - route:
    - destination:
        host: ratings
        subset: v1

7 Quiz[ | ]

Question 1: What is a trace?[1]

  • An entire request across multiple systems
  • A breakdown of the difference services called by a request

Question 2: What is a span?[2]

  • An entire request across multiple systems
  • A breakdown of the difference services called by a request
  1. An entire request across multiple systems
  2. A breakdown of the difference services called by a request
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}