疑難排解

此頁面會收集一組有用的要訣和技巧,以進行疑難排解。

調整 Instana 元件的記載層次

  1. 在「核心」或「單元 CR」中配置元件的記載層次。 在下列範例中, butler 元件的記載層次變更為 DEBUG :

    componentConfigs:
      - name: butler
        env:
          - name: COMPONENT_LOGLEVEL
            # Possible values are DEBUG, INFO, WARN, ERROR (not case-sensitive)
            value: DEBUG
    
  2. 執行下列指令來檢視日誌:

    kubectl logs <component name> -n instana-core
    

    <component name> 是您要找到的元件名稱。

使用 kubectl 特定指令來除錯及診斷

kubectl cluster-info dump 指令是用於除錯及診斷 Kubernetes 叢集的有用工具。 它提供 Kubernetes 叢集現行狀態的詳細報告,包括資源的不同資訊。

配置目標名稱空間及目錄以輸出除錯資訊。 在下列範例中,名稱空間是 instana-units ,而目錄是 temp。 當您執行此指令時, kubectl 會針對 instana-units 名稱空間中的每一個資源產生 YAML 檔,並將這些 YAML 檔儲存至 temp 目錄。

kubectl cluster-info dump --namespace instana-units --output-directory temp --output yaml

下列摘錄顯示 temp 目錄中的部分內容。 在 instana-units 子目錄中,您可以在 .yaml 檔案中找到常駐程式集、部署、事件、Pod 及其他資源的詳細資料。 所有 Pod 上的日誌都位於每一個 instana-units\pod name 子目錄中。

├── instana-units
│   ├── daemonsets.yaml
│   ├── deployments.yaml
│   ├── events.yaml
│   ├── pods.yaml
│   ├── replicasets.yaml
│   ├── replication-controllers.yaml
│   ├── services.yaml
│   ├── tu-instana-prod-appdata-legacy-converter-755bb474c7-xn4vg
│   │   └── logs.txt
│   ├── tu-instana-prod-appdata-processor-6b8f448584-nmvgl
│   │   └── logs.txt
│   ├── tu-instana-prod-filler-9485b85d-wj7pv
│   │   └── logs.txt
│   ├── tu-instana-prod-issue-tracker-bbd5f5d5f-98zxx
│   │   └── logs.txt
│   ├── tu-instana-prod-processor-fc956c46c-fxs5z
│   │   └── logs.txt
│   └── tu-instana-prod-ui-backend-89bccd9c5-8lp76
│       └── logs.txt
...
└── nodes.yaml

附註:

  • 您可以選擇另一個名稱空間,例如 instana-core
  • 如果叢集上未安裝 kubectl ,您可以使用指令 oc cluster-info dump,其提供與指令 kubectl cluster-info dump相同的支援。

如需其他疑難排解指令,請參閱 Red Hat OpenShift 文件 透過 kubectl 進行叢集疑難排解Red Hat OpenShift CLI 開發人員指令參考手冊

使用內部後端 API

您可以使用一些內部元件 API 端點,來協助您管理自行管理的 Instana 後端。 可以使用 curl 將這些 API 呼叫從叢集提交至對應的 Pod。 因為資源需要鑑別,您必須先取得有效的認證。 API 認證位於核心名稱空間的 internal-instana 密鑰中。 API 端點包含兩種類型的 AdminAPIUser 和 ServiceAPIUser。 若要取得適用於 Instana 安裝的認證,請執行下列指令:

kubectl get secret instana-internal -n instana-core --template='{{ index .data.serviceAPIUser  | base64decode }}'

kubectl get secret instana-internal -n instana-core --template='{{ index .data.serviceAPIPassword  | base64decode }}'

若要取得管理使用者的認證,請查詢 .data.adminAPIUser.data.adminAPIPassword

這些認證可用於下列程序。

重設 Instana 使用者密碼

若要重設 Instana 使用者帳戶的密碼,請執行下列指令:

kubectl exec -it -n instana-core deploy/butler -- curl -X PUT http://localhost:8601/admin/authentication/{tenant}/reset/user -u {adminAPIUser}:{adminAPIPassword} -H 'Content-Type: application/json' -d '{"email":"{user}","pass":"{newPassword}"}'

取消啟動 SSO 提供者配置 (LDAP/SAML/OIDC)

如果身分提供者用於 Instana 鑑別,您可以使用下列指令來取消啟動該提供者。 之後,內部 Instana 使用者帳戶可以用於鑑別。

kubectl exec -it -n instana-core deploy/butler -- curl -X PUT http://localhost:8601/admin/authentication/{tenant}/idp -u {adminAPIUser}:{adminAPIPassword}

在使用者帳戶上 停用 2FA

若要取消啟動 Instana 使用者帳戶的 2FA (雙因素鑑別) ,請執行下列指令:

kubectl exec -it -n instana-core deploy/butler -- curl -X DELETE http://localhost:8601/admin/2fa/users/{email} -u {adminAPIUser}:{adminAPIPassword}

驗證授權

若要驗證所有儲存的授權,請執行下列指令:

kubectl exec -it -n instana-core deploy/groundskeeper -- curl -X GET http://localhost:8600/license/list/{tenant}/{unit} -u {serviceAPIUser}:{serviceAPIPassword}

部分度量值未顯示在儀表板上

如果部分度量值未顯示在儀表板上,則可能已達到度量值的限制。 依預設,度量限制設為 3000。

提示: 您可以在 filler/config.yaml 檔案中的 maxMetrics 下查看現行限制。 此限制是為了防止部分實體傳送太多度量值,這會增加填充值所使用的儲存體及 CPU ,並增加頻寬以將度量值傳送至使用者介面。

若要增加限制,請在 core.yaml 檔案中新增具有 config.max.metrics 的區塊,如下所示:

kind: Core
metadata:
  name: instana-core
  namespace: instana-core
spec:
...
  properties:
    - name: config.max.metrics
      value: "6000"
...