Skip to content

Latest commit

 

History

History
140 lines (74 loc) · 6.33 KB

ingest-via-cloud-foundry-runtime-f5a7c99.md

File metadata and controls

140 lines (74 loc) · 6.33 KB

Ingest via Cloud Foundry Runtime

Following this guide allows you to benefit from default contents, such as dashboards, index patterns, and retention settings.

Note:

Even without any specific application logs, you can analyze your applications based on the automatically issued request logs from the Cloud Foundry router.

Note:

You can Ingest via OpenTelemetry API Endpoint. There are no predefined dashboards yet, but you can use the observability plugin by OpenSearch Dashboards.

Ship logs from applications deployed on SAP BTP Cloud Foundry by binding the application. Bind applications either using the SAP BTP Cockpit or the Cloud Foundry Command Line Interface (CLI).

Note:

If you delete the service key, the certificates and credentials are invalidated.

Note:

Skip this step and bind to your application directly if you are sending with certificates (as it manages certificate rotation for you).

Bind the application directly to an SAP Cloud Logging instance. However, to be resilient against issues during the binding process (important for automated builds), we recommend an indirection via service key and binding to a user-provided service. Cloud Foundry operations can lead to an implicit rebind, without the need for a rebind. Using service keys provides control over the credential lifecycle.

Using the Cloud Foundry Command Line Interface

  1. cf services lists the service instance.

  2. To create a service key without binding to any application via cf cli, execute the following command:

    cf create-service-key <service-instance> <service-key>
    

    Note:

    SAP Cloud Logging needs no configuration parameters during service key creation.

  3. The service key holds all the credentials. To view a service key, execute:

    cf service-key <service-instance> <service-key>
    
    

    and extract ingest-endpoint, ingest-username, and ingest-password.

  4. Create a user-provided service using the following pattern:

    cf cups <user-provided-service-name> -l https://ingest-username:ingest-password@ingest-endpoint/cfsyslog
    
    

Using the SAP BTP Cockpit

  1. Create a service key according to Creating Service Keys in Cloud Foundry.
  2. Create a User-Provided Service following Creating User-Provided Service Instances in Cloud Foundry Environment, using the information from the service key

Instance Name:<user-provided-service-name>

System Logs Drain URL: https://ingest-username:ingest-password@ingest-endpoint/cfsyslog

Note:

SAP Cloud Logging needs no configuration parameters during service key creation.

Bind the Application Using the Cloud Foundry Command Line Interface

To bind the application using CF CLI, execute the following command:

cf bind-service <app-name> <service-instance>

Note:

CF CLI asks you to restage, but this isn't mandatory to use SAP Cloud Logging.

Bind the Application Using the SAP BTP Cockpit

You can bind service instances to applications both at the application view, and at the service-instance view in the cockpit.

  1. Log On to the Cloud Foundry environment using the SAP BTP Cockpit.

  2. Navigate to the space in which your application is deployed. For more information, see Navigate to Global Accounts, Subaccounts, Orgs, and Spaces in the Cockpit.

  3. In the navigation area, choose Services > Service Marketplace.

  4. Search for SAP Cloud Logging.

  5. In the navigation area, choose Instances.

  6. To create a new instance, choose New Instance. In the following steps, you assign an application to this service. This application then writes its logs to the newly created service instance.

    1. Choose the service plan, then choose Next.
    2. Optional. Browse for the .json file of the app for which you want to write logs. Then choose Next.
    3. Optional. Choose an application from the dropdown that lists all deployed applications. Then choose Next.
    4. Enter the name of the new instance, then choose Finish.
  7. Optional. If you haven't bound an application to the service instance in the optional steps above, you can bind it from the application’s dashboard. For more information, see Bind Service Instances to Applications Using the Cockpit.

You can share a single service instance across multiple spaces. Skip this step if you don't need to share a single instance across multiple spaces of the same org. To share the services in an additional space, execute the following command:

cf share-service <service-instance> -s <other-space>

Caution:

Ensure that you consider the SAP BTP Security Recommendation BTP-CLS-0002.

We recommend using one of the Cloud Foundry open-source logging libraries (Java/NodeJS) within your application.