Observability Problems

Expected metrics are not being collected

The following procedure helps you diagnose problems where metricsyou are expecting to see reported are not being collected.

The expected flow for metrics is:

  • Envoy reports attributes from requests asynchronously to Mixer in a batch.

  • Mixer translates the attributes into instances based on the operator-provided configuration.

  • Mixer hands the instances to Mixer adapters for processing and backend storage.

  • The backend storage systems record the metrics data.

The Mixer default installations include a Prometheus adapter and the configuration to generate a default set of metric values and send them to the Prometheus adapter. The Prometheus adapter configuration enables a Prometheus instance to scrape Mixer for metrics.

If the Istio Dashboard or the Prometheus queries don’t show the expected metrics, any step of the flow above may present an issue. The following sections provide instructions to troubleshoot each step.

Verify Istio CNI pods are running (if used)

The Istio CNI plugin performs the Istio mesh pod traffic redirection in the Kubernetes pod lifecycle’s network setup phase, thereby removing the NET_ADMIN capability requirement for users deploying pods into the Istio mesh. The Istio CNI plugin replaces the functionality provided by the istio-init container.

  • Verify that the istio-cni-node pods are running:
  1. $ kubectl -n kube-system get pod -l k8s-app=istio-cni-node
  • If PodSecurityPolicy is being enforced in your cluster, ensure the istio-cni service account can use a PodSecurityPolicy with the NET_ADMIN capability requirement

Verify Mixer is receiving report calls

Mixer generates metrics to monitor its own behavior. The first step is to check these metrics:

  • Establish a connection to the Mixer self-monitoring endpoint for the istio-telemetry deployment. In Kubernetes environments, execute the following command:
  1. $ kubectl -n istio-system port-forward <istio-telemetry pod> 15014 &
  • Verify successful report calls. On the Mixer self-monitoring endpoint (http://localhost:15014/metrics), search for grpc_io_server_completed_rpcs. You should see something like:
  1. grpc_io_server_completed_rpcs{grpc_server_method="istio.mixer.v1.Mixer/Report",grpc_server_status="OK"} 2532

If you do not see any data for grpc_io_server_completed_rpcs with a grpc_server_method="istio.mixer.v1.Mixer/Report", then Envoy is not calling Mixer to report telemetry.

Verify the Mixer rules exist

In Kubernetes environments, issue the following command:

  1. $ kubectl get rules --all-namespaces
  2. NAMESPACE NAME AGE
  3. istio-system kubeattrgenrulerule 4h
  4. istio-system promhttp 4h
  5. istio-system promtcp 4h
  6. istio-system promtcpconnectionclosed 4h
  7. istio-system promtcpconnectionopen 4h
  8. istio-system tcpkubeattrgenrulerule 4h

If the output shows no rules named promhttp or promtcp, then the Mixer configuration for sending metric instances to the Prometheus adapter is missing. You must supply the configuration for rules connecting the Mixer metric instances to a Prometheus handler.

For reference, please consult the default rules for Prometheus.

Verify the Prometheus handler configuration exists

  • In Kubernetes environments, issue the following command:
  1. $ kubectl get handlers.config.istio.io --all-namespaces
  2. NAMESPACE NAME AGE
  3. istio-system kubernetesenv 4h
  4. istio-system prometheus 4h

If you’re upgrading from Istio 1.1 or earlier, issue the following command instead:

  1. $ kubectl get prometheuses.config.istio.io --all-namespaces
  2. NAMESPACE NAME AGE
  3. istio-system handler 13d
  • If the output shows no configured Prometheus handlers, you must reconfigure Mixer with the appropriate handler configuration.

For reference, please consult the default handler configuration for Prometheus.

Verify Mixer metric instances configuration exists

  • In Kubernetes environments, issue the following command:
  1. $ kubectl get instances -o custom-columns=NAME:.metadata.name,TEMPLATE:.spec.compiledTemplate --all-namespaces

If you’re upgrading from Istio 1.1 or earlier, issue the following command instead:

  1. $ kubectl get metrics.config.istio.io --all-namespaces
  • If the output shows no configured metric instances, you must reconfigure Mixer with the appropriate instance configuration.

For reference, please consult the default instances configuration for metrics.

Verify there are no known configuration errors

  • To establish a connection to the Istio-telemetry self-monitoring endpoint, setup a port-forward to the Istio-telemetry self-monitoring port as described inVerify Mixer is receiving Report calls.

  • For each of the following metrics, verify that the most up-to-date value is 0:

    • mixer_config_adapter_info_config_errors_total

    • mixer_config_template_config_errors_total

    • mixer_config_instance_config_errors_total

    • mixer_config_rule_config_errors_total

    • mixer_config_rule_config_match_error_total

    • mixer_config_unsatisfied_action_handler_total

    • mixer_config_handler_validation_error_total

    • mixer_handler_handler_build_failures_total

On the page showing Mixer self-monitoring port, search for each of the metrics listed above. You should not find any values for those metrics if everything isconfigured correctly.

If any of those metrics have a value, confirm that the metric value with the largest configuration ID is 0. This will verify that Mixer has generated no errorsin processing the most recent configuration as supplied.

Verify Mixer is sending metric instances to the Prometheus adapter

  • Establish a connection to the istio-telemetry self-monitoring endpoint. Setup a port-forward to the istio-telemetry self-monitoring port as described inVerify Mixer is receiving Report calls.

  • On the Mixer self-monitoring port, search for mixer_runtime_dispatches_total. The output should be similar to:

  1. mixer_runtime_dispatches_total{adapter="prometheus",error="false",handler="prometheus.istio-system",meshFunction="metric"} 2532
  • Confirm that mixer_runtime_dispatches_total is present with the values:
  1. adapter="prometheus"
  2. error="false"

If you can’t find recorded dispatches to the Prometheus adapter, there is likely a configuration issue. Please follow the steps aboveto ensure everything is configured properly.

If the dispatches to the Prometheus adapter report errors, check the Mixer logs to determine the source of the error. The most likely cause is a configuration issue for the handler listed in mixer_runtime_dispatches_total.

  • Check the Mixer logs in a Kubernetes environment with:
  1. $ kubectl -n istio-system logs <istio-telemetry pod> -c mixer

Verify Prometheus configuration

  • Connect to the Prometheus UI

  • Verify you can successfully scrape Mixer through the UI.

  • In Kubernetes environments, setup port-forwarding with:

  1. $ istioctl dashboard prometheus
  • In the Prometheus browser window, select Status then Targets.

  • Confirm the target istio-mesh has a status of UP.

  • In the Prometheus browser window, select Status then Configuration.

  • Confirm an entry exists similar to:

  1. - job_name: 'istio-mesh'
  2. # Override the global default and scrape targets from this job every 5 seconds.
  3. scrape_interval: 5s
  4. # metrics_path defaults to '/metrics'
  5. # scheme defaults to 'http'.
  6. static_configs:
  7. - targets: ['istio-mixer.istio-system:42422']</td>

No traces appearing in Zipkin when running Istio locally on Mac

Istio is installed and everything seems to be working except there are no traces showing up in Zipkin when thereshould be.

This may be caused by a known Docker issue where the time insidecontainers may skew significantly from the time on the host machine. If this is the case,when you select a very long date range in Zipkin you will see the traces appearing as much as several days too early.

You can also confirm this problem by comparing the date inside a Docker container to outside:

  1. $ docker run --entrypoint date gcr.io/istio-testing/ubuntu-16-04-slave:latest
  2. Sun Jun 11 11:44:18 UTC 2017
  1. $ date -u
  2. Thu Jun 15 02:25:42 UTC 2017

To fix the problem, you’ll need to shutdown and then restart Docker before reinstalling Istio.

Missing Grafana output

If you’re unable to get Grafana output when connecting from a local web client to Istio remotely hosted, youshould validate the client and server date and time match.

The time of the web client (e.g. Chrome) affects the output from Grafana. A simple solutionto this problem is to verify a time synchronization service is running correctly within theKubernetes cluster and the web client machine also is correctly using a time synchronizationservice. Some common time synchronization systems are NTP and Chrony. This is especiallyproblematic in engineering labs with firewalls. In these scenarios, NTP may not be configuredproperly to point at the lab-based NTP services.