# Istio

[Istio](https://istio.io/latest/) is a service mesh solution for Kubernetes, for managing and proxying network traffic between services. For monitoring, it provides metrics, logs and traces of the traffic it handles.

groundcover's Traces support Istio-managed traffic and by default translate the proxy redirections done by the service mesh to display communication across different services. This page explains how more to integrate Istio's observability capabilities into groundcover.

You can read more about configuring Istio's observability features in [Istio's documentation](https://istio.io/latest/docs/tasks/observability/) (external link to Istio website).

## Traces

To integrate Istio Distributed Tracing into groundcover, it's possible to use either Istio's Datadog or Zipkin plugins. Both methods work by directing the traces to groundcover's sensor ingestion endpoint, as described below.

#### Applying the Istio configuration

Choose your preferred plugin and add the values below to Istio's configuration accordingly using a YAML file as described in Istio's docs [here](https://istio.io/latest/docs/tasks/observability/distributed-tracing/mesh-and-proxy-config/#using-meshconfig-for-trace-settings).

{% hint style="info" %}
In the example values below, we use a [**sampling rate**](https://istio.io/latest/docs/tasks/observability/distributed-tracing/mesh-and-proxy-config/#customizing-trace-sampling) of 1%. We recommend this sampling rate as best practice when ingesting traces in order to prevent your storage from getting full.
{% endhint %}

{% tabs %}
{% tab title="DataDog Tracer" %}

```yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    enableTracing: true
    defaultConfig:
      tracing:
        sampling: 1
    extensionProviders:
    - name: datadog-tracing
      datadog:
          address: groundcover-sensor.groundcover.svc.cluster.local:8126  
```

Traces integrated using this method will have "Datadog" as their source tag in the app.
{% endtab %}

{% tab title="OpenTelemetry Tracer" %}

```yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    enableTracing: true
    defaultConfig:
      tracing:
        sampling: 1
    extensionProviders:
    - name: otel-tracing
      opentelemetry:
        port: 4318
        service: groundcover-sensor.groundcover.svc.cluster.local:4318
        http:
          path: "/v1/traces"
          timeout: 5s
```

Traces integrated using this method will have "OpenTelemetry" as their source tag in the app.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Traces from Istio are associated to a specific Pod rather than a specific container. For this reason, traces integrated from Istio will not have Container Info stats available.
{% endhint %}

#### The changes will take effect after the istio deployments are restarted.

## Metrics

Each of Istio's mesh components export Prometheus metrics, which can be scraped by groundcover using the [Custom Metrics](https://docs.groundcover.com/integrations/data-sources/broken-reference) feature.

For explanation on Istio's metrics, head over to their docs - <https://istio.io/latest/docs/ops/integrations/prometheus/#option-1-metrics-merging>
