istio.io/istio@v0.0.0-20240520182934-d79c90f27776/samples/open-telemetry/als/README.md (about)

     1  # Open Telemetry ALS
     2  
     3  This sample demonstrates Istio's Open Telemetry ALS support.
     4  
     5  ## Start otel-collector service
     6  
     7  First, create an `otel-collector` backend with simple configuration.
     8  
     9  ```bash
    10  kubectl apply -f ../otel.yaml -n observability
    11  ```
    12  
    13  With following configuration, otel-collector will create a grpc receiver on port `4317`, and output to stdout. You can find more details from [here](https://github.com/open-telemetry/opentelemetry-collector).
    14  
    15  ```yaml
    16  receivers:
    17    otlp:
    18      protocols:
    19        grpc:
    20        http:
    21  processors:
    22    batch:
    23  exporters:
    24    logging:
    25      loglevel: debug
    26  service:
    27    pipelines:
    28      logs:
    29        receivers: [otlp]
    30        processors: [batch]
    31        exporters: [logging]
    32  ```
    33  
    34  ## Update Istio configmap
    35  
    36  Run the following script to update the `istio` with demo profile:
    37  
    38  ```bash
    39  istioctl install --set profile=demo -y
    40  ```
    41  
    42  Next, add a Telemetry resource that tells Istio to send access logs to the OpenTelemetry collector.
    43  
    44  ```bash
    45  cat <<EOF | kubectl apply -n istio-system -f -
    46  apiVersion: telemetry.istio.io/v1alpha1
    47  kind: Telemetry
    48  metadata:
    49    name: mesh-default
    50    namespace: istio-system
    51  spec:
    52    accessLogging:
    53      - providers:
    54        - name: otel
    55  EOF
    56  ```
    57  
    58  ## Check ALS output
    59  
    60  Following [doc](../../httpbin/README.md), start the `fortio` and `httpbin` services.
    61  
    62  Run the following script to request `httpbin` from `fortio`.
    63  
    64  ```bash
    65  kubectl exec -it $(kubectl get po | grep fortio | awk '{print $1}') -- fortio curl httpbin:8000/ip
    66  ```
    67  
    68  Run the following script to checkout ALS output.
    69  
    70  ```bash
    71  kubectl logs $(kubectl get po -n observability | grep otel | awk '{print $1}') -n observability
    72  ```
    73  
    74  ## Cleanup
    75  
    76  ```bash
    77  kubectl delete -f ../otel.yaml -n observability
    78  kubectl delete telemetry mesh-default -n istio-system
    79  ```