Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified sap-cloud-logging/assets/choose-index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added sap-cloud-logging/assets/log-pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
apiVersion: telemetry.kyma-project.io/v1alpha1
apiVersion: telemetry.kyma-project.io/v1beta1
kind: LogPipeline
metadata:
name: my-cls-application-logs
name: my-cls
spec:
input:
application:
containers:
exclude:
- istio-proxy
runtime:
enabled: true
output:
http:
dedot: true
host:
otlp:
endpoint:
valueFrom:
secretKeyRef:
name: my-cls-binding
namespace: cls
key: ingest-mtls-endpoint
key: ingest-otlp-endpoint
tls:
cert:
valueFrom:
secretKeyRef:
name: my-cls-binding
namespace: cls
key: ingest-mtls-cert
key: ingest-otlp-cert
key:
valueFrom:
secretKeyRef:
name: my-cls-binding
namespace: cls
key: ingest-mtls-key
uri: /customindex/kyma
key: ingest-otlp-key
4 changes: 2 additions & 2 deletions sap-cloud-logging/k8s/tracing/trace-istio-telemetry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
spec:
accessLogging:
- providers:
- name: stdout-json
- name: kyma-logs
tracing:
- providers:
- name: "kyma-traces"
- name: kyma-traces
randomSamplingPercentage: 1.0
4 changes: 2 additions & 2 deletions sap-cloud-logging/k8s/tracing/traces-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: telemetry.kyma-project.io/v1alpha1
apiVersion: telemetry.kyma-project.io/v1beta1
kind: TracePipeline
metadata:
name: my-cls-trace-pipeline
name: my-cls
spec:
output:
otlp:
Expand Down
148 changes: 68 additions & 80 deletions sap-cloud-logging/ship-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Welcome to the first sample in our three-part series, where we will explore how Kyma can seamlessly integrate with the SAP Cloud Logging service. By enabling the three pillars of observability - logs, traces, and metrics - Kyma developers and operators can effectively troubleshoot issues, identify root causes, investigate performance bottlenecks, and gain a comprehensive understanding of system behavior.

In this sample, we will delve into the following topics:
This sample covers the following topics:

1. SAP Cloud Logging: An Overview
- Learn about the SAP Cloud Logging service and its significance in the context of Kyma integration.
Expand All @@ -11,7 +11,7 @@ In this sample, we will delve into the following topics:
2. Shipping Logs to SAP Cloud Logging
- Explore the step-by-step process of shipping logs from applications deployed on SAP BTP, Kyma runtime to SAP Cloud Logging.

In the subsequent samples, we will continue our exploration by discussing the integration of traces and metrics.
The subsequent samples cover the integration of traces and metrics.

## What is SAP Cloud Logging?

Expand All @@ -23,11 +23,11 @@ For Cloud Foundry and Kyma, SAP Cloud Logging offers an easy integration by prov

To get started with SAP Cloud Logging, visit the [Discovery Center](https://discovery-center.cloud.sap/serviceCatalog/cloud-logging?service_plan=overall-(large,-standard,-and-dev)&region=all&commercialModel=cloud&tab=feature) where you will find more detailed information about its features and capabilities.

Pricing for the SAP Cloud Logging service can be determined using the [SAP Cloud Logging Capacity Unit Estimator](https://sap-cloud-logging-estimator.cfapps.us10.hana.ondemand.com/). It is important to note that for Kyma, the "Ingest Otel" option needs to be enabled, which should be taken into account when estimating pricing. This option is used for shipping traces and metrics.
To estimate pricing, use the [SAP Cloud Logging Capacity Unit Estimator](https://sap-cloud-logging-estimator.cfapps.us10.hana.ondemand.com/). For Kyma, you must enable the **Ingest Otel** option, which is used for shipping traces and metrics.

## Provision an Instance of SAP Cloud Logging

Now, let's explore how we can leverage SAP Cloud Logging to ingest logs from applications deployed on SAP BTP, Kyma runtime.
Now, let's explore how we can use SAP Cloud Logging to ingest logs from applications deployed on SAP BTP, Kyma runtime.

### Prerequisites

Expand All @@ -37,128 +37,116 @@ Now, let's explore how we can leverage SAP Cloud Logging to ingest logs from app

### Procedure

You can refer to the [official SAP documentation](https://help.sap.com/docs/cloud-logging/cloud-logging/create-sap-cloud-logging-instance-through-sap-btp-service-operator?version=Cloud) to create an SAP Cloud Logging service instance for details.

- Export your namespace's name as an environment variable.

```shell
# In the instructions, all resources are created in cls namespace. If you want to use a different namespace, adjust the files appropriately
export NS=cls
kubectl create ns ${NS}
```

- To provision an instance of SAP Cloud Logging, create an instance of SAP Cloud Logging and a service binding:

```shell
kubectl -n ${NS} apply -f ./k8s/cls-instance.yaml
```

For reference, this is the service instance specification:

```yaml
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: my-cls
spec:
serviceOfferingName: cloud-logging
servicePlanName: dev
parameters:
retentionPeriod: 7
esApiEnabled: false
ingest_otlp:
For details, see [Create an SAP Cloud Logging Instance through SAP BTP Service Operator](https://help.sap.com/docs/cloud-logging/cloud-logging/create-sap-cloud-logging-instance-through-sap-btp-service-operator?version=Cloud).

1. Export your namespace name as an environment variable:

```shell
# In the instructions, all resources are created in cls namespace. If you want to use a different namespace, adjust the files appropriately
export NS=cls
kubectl create ns ${NS}
```

2. To provision an instance of SAP Cloud Logging, create a service instance and a service binding:

```shell
kubectl -n ${NS} apply -f ./k8s/cls-instance.yaml
```

For reference, this is the service instance specification:

```yaml
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: my-cls
spec:
serviceOfferingName: cloud-logging
servicePlanName: dev
parameters:
retentionPeriod: 7
esApiEnabled: false
ingest_otlp:
enabled: true
```

This is the corresponding service binding.

```yaml
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
name: my-cls-binding
spec:
serviceInstanceName: my-cls
credentialsRotationPolicy:
enabled: true
```

This is the corresponding service binding.

```yaml
apiVersion: services.cloud.sap.com/v1
kind: ServiceBinding
metadata:
name: my-cls-binding
spec:
serviceInstanceName: my-cls
credentialsRotationPolicy:
enabled: true
rotationFrequency: "720h"
rotatedBindingTTL: "24h"
```
rotationFrequency: "720h"
rotatedBindingTTL: "24h"
```

The service binding specifies the credentials rotation policy. It is a great developer experience that the Telemetry module intelligently switches to new credentials once they are rotated. This does not require any action from the developer.
The service binding specifies the credentials rotation policy. The Telemetry module automatically switches to new credentials after they are rotated, which requires no action from you.

> **NOTE:** The same instance will be reused for configuring tracing and monitoring.
> **NOTE:** You reuse this same instance to configure tracing and monitoring in the subsequent tutorials.

The service binding also generates a Secret with the same name. It contains the details to access the dashboard of the SAP Cloud Logging instance previously created.
The service binding also generates a Secret with the same name. It contains the details to access the dashboard of the SAP Cloud Logging instance previously created.

![cls-binding-secret](./assets/cls-binding-secret.png)
![cls-binding-secret](./assets/cls-binding-secret.png)

## Ship your application logs to SAP Cloud Logging

To ship your logs to SAP Cloud Logging, create LogPipeline custom resources (CRs).

Your application running in SAP BTP, Kyma runtime will send logs to stdout. The Telemetry module based on the LogPipeline will capture and ship them to SAP Cloud Logging.
Your application running in SAP BTP, Kyma runtime sends logs to stdout. Based on the LogPipeline, the Telemetry module captures and ships them to SAP Cloud Logging.

### Create a LogPipeline CR for Your Application Logs

To create the LogPipeline, run:

```shell
kubectl apply -f ./k8s/logging/logs-pipeline-application-logs.yaml
kubectl apply -f ./k8s/logging/logs-pipeline.yaml
```

In the LogPipeline, configure the details about shipping the logs to SAP Cloud Logging. Include major configurations such as:
In the LogPipeline, you configure how logs are shipped to SAP Cloud Logging with the following options:

- Input: From which applications, containers, and namespaces the logs should be shipped
- Output: The access details of the SAP Cloud Logging instance to which logs will be shipped
- Input: Specifies the applications, containers, and namespaces from which logs are shipped
- Output: Contains the access details of the SAP Cloud Logging instance to which logs are shipped.

You can learn about all the parameters in detail from the official Telemetry [LogPipeline](https://kyma-project.io/#/telemetry-manager/user/resources/02-logpipeline?id=custom-resource-parameters) documentation.

This is an example of the LogPipeline configuration used for this sample:

![log-pipeline](./assets/log-pipeline-app-logs.png)

### Create a LogPipeline CR for the Istio access logs
![log-pipeline](./assets/log-pipeline.png)

Referred from [kyma-project.io documentation about istio access logs](https://kyma-project.io/#/istio/user/tutorials/01-45-enable-istio-access-logs).
### Enable Istio Access logs

Istio access logs provide fine-grained details about the traffic when accessing the workloads that are part of Istio service mesh. The only prerequisite is to enable Istio sidecar injection for your workloads. The Istio access logs provide useful information relating to 4 golden signals, such as latency, traffic, errors, and saturation as well as any troubleshooting anomalies.
For details, see [Configure Istio Access Logs](https://kyma-project.io/external-content/telemetry-manager/docs/user/collecting-logs/istio-support.html).

[Configure Istio access logs for the entire mesh](https://kyma-project.io/#/istio/user/tutorials/01-45-enable-istio-access-logs?id=configure-istio-access-logs-for-the-entire-mesh)
Istio access logs provide fine-grained details about traffic to workloads in the Istio service mesh, related to the four golden signals (latency, traffic, errors, and saturation) and help troubleshoot anomalies. Before you enable Istio access logs, enable Istio sidecar injection for your workloads.

It is also possible to have [fine grained configuration](https://kyma-project.io/#/istio/user/tutorials/01-45-enable-istio-access-logs?id=configuration) for Istio access logs.
For details, see [Enable Istio Logs for the Entire Mesh](https://kyma-project.io/external-content/telemetry-manager/docs/user/collecting-logs/istio-support.html#enable-istio-logs-for-the-entire-mesh).

```shell
kubectl apply -f ./k8s/tracing/trace-istio-telemetry.yaml
```

> Note: We use the same Istio telemetry configuration for tracing and logging.

To create the LogPipeline, run:

```shell
kubectl apply -f ./k8s/logging/logs-pipeline-istio-access-logs.yaml
```

This is an example of the LogPipeline configuration used for this sample:

![log-pipeline-istio-access-logs](./assets/log-pipeline-istio-access-logs.png)
> **NOTE:** This and the subsequent samples use the same Istio Telemetry configuration for tracing and logging.

## View the logs

You can access the SAP Cloud Logging instance dashboard. The access details are available in the Secret generated by the service binding.
To access the SAP Cloud Logging dashboard, use the credentials from the Secret generated by the service binding.

![cls-binding-secret](./assets/cls-binding-secret.png)

The simplest way to start exploring the logs is to navigate to **Discover** and choose the appropriate index.

![cls-access](./assets/cls-access.png)

You can choose the index pattern to view the relevant logs, apply a filter or search term to narrow down your search or use other Open Search capabilities.
You can choose an index pattern to view relevant logs, apply a filter or search term to narrow down results, or use other OpenSearch capabilities.

![choose-index](./assets/choose-index.png)

We will talk more about metrics in one of the next samples. However, I would like to bring your attention to the Four Golden Signals dashboard. It is provided out of the box and is based on the Istio access logs which we configured previously.
While metrics are covered in a later sample, note the **Four Golden Signals** dashboard. SAP Cloud Logging provides this dashboard out-of-the-box, based on the Istio access logs that you configured previously.

For reference, check out the generic and latency dashboards.

Expand Down
Loading