Instana Walkthrough (w/Minikube)

## やること

* MinikubeにInstanaのAgentをいれて、見える情報を確認する

## Minikubeの前提

* istio, jaeger, kialiが導入されている
* bookinfoがデプロイされている
* bookinfoに定期的にアクセスが発生している

## [Free Trial](https://www.instana.com/trial/)

* Instanaのサイト曰く以下の制約でFree Trialできる。


> Discovery, mapping, monitoring & troubleshooting of your containerized microservice applications
> End-to-end tracing of EVERY request
> Free 14 day trial of full version of the product. No credit card required

## MinikubeへのAgentの導入

Free Trial へのRegistration後にもらうメールのリンクから、Wizardが実行される。
今回はMinikube上にインストールするので、以下の入力をして、helmのコマンドを入手する。

![1C792497-98B9-4C6C-8DA2-6F121DBE1409.jpeg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/eea442bc-73ce-113d-64d4-774d48f8eb66.jpeg)

コマンド

```bash
helm install instana-agent \
   --repo https://agents.instana.io/helm \
   --namespace instana-agent \
   --create-namespace \
   --set agent.key=0bXXXXXXXXXXXXVg \
   --set agent.endpointHost=ingress-orange-saas.instana.io \
   --set agent.endpointPort=443 \
   --set cluster.name='minikube' \
   --set zone.name='myhome' \
   instana-agent
```

レスポンス

```
NAME: instana-agent
LAST DEPLOYED: Fri Dec  3 13:09:10 2021
NAMESPACE: instana-agent
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
It may take a few moments for the agents to fully deploy. You can see what agents are running by listing resources in the instana-agent namespace:

    kubectl get all -n instana-agent

You can get the logs for all of the agents with `kubectl logs`:

    kubectl logs -l app.kubernetes.io/name=instana-agent -n instana-agent -c instana-agent
```

状態確認

```
kubectl get all -n instana-agent
NAME                      READY   STATUS    RESTARTS   AGE
pod/instana-agent-bfvtr   2/2     Running   0          2m31s

NAME                           DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/instana-agent   1         1         1       1            1           <none>          2m31s
```

インストールが完了すると、Instana側の画面下部が以下の表示になる。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/a96bf816-27a0-0a16-1826-5f565ec93da0.png)


## Instana徘徊

### Top
Minikubeの上で動かしている**Application**(bookinfo)、**Kubernetes**(Minikube)、**Infrastructure**(Minikube & RHEL8)、**Event**(Minikube)を拾ってくれてそう。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/aa96e2a4-8430-891a-884a-97371b92d7f5.png)

### Application

#### Summary

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/8fa21e65-ff05-0bb1-b0db-4f651a1970a9.png)

#### Dependencies

（なぜか全部見えてない。Kiali上では見えてるのに）

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/3d883414-d57f-7878-2eae-b8f6abb84626.png)

#### Services

（なぜかReviewsしか認識できていない）

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/3c81db6f-5bb3-e8c4-3784-c901aa4536cb.png)

#### Services の中の `reviews`の Endpoints

（`{productId}`とかどうやって拾ってんだ...）

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/50c64864-254b-2671-810f-a8abee59199f.png)


#### Infrastructure

（WehSphere?!）

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/8a87e675-4599-f169-4755-258f4813b986.png)

### Kubernetes

#### Clusters

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/f4f2d080-1514-d597-d209-40018f8d1ee2.png)

#### Namespaces

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/27eddd42-d28c-cee9-48b0-b8d7f0c08fc9.png)

#### `default` namespace の Summary

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/f7288f19-155d-139f-dfeb-57ded329edb8.png)

#### `default` namespace の `details-v1` deployment の Summary

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/d1fe34f3-5912-da12-a0a6-4ca618515016.png)

### Infrastructure

#### Map 

?!

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/32dee0d7-0ea8-f731-beaf-81481c1a7b90.png)

あぁ～なるほど。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/178a6b55-e1ec-ccec-7951-0d215b5c2376.png)

#### Comparison Table

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/1d420388-7f3d-5deb-1537-ab5ff6803984.png)

#### JVM

ちょっとたどり着きづらい。
Infrastructure -> Stack -> Infrastructure -> Runs 1 WebSphere Server

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/7ec9d9ea-c44e-0be9-f9f0-f120beff8a95.png)


### Analytics

Distributed Tracingもいけそう。

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/b73f3b3a-9bd6-a525-6fdf-fbb08dd1f5e9.png)

### Event

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/325101/b4a18d5c-bb2b-2121-c597-f2b7e50c1e8d.png)

## もうちょっと探る

むっちゃ簡単ですぐ使える。