
Observability helps to take data-driven informed decisions based on runtime Observability telemetry data (logs, metrics, traces, events, ...) and provides insights into SAP & customer services and systems to understand and improve efficiency, scalability, resilience, and availability.
When you seek for fully detailed observability data of your application, you can use SAP Cloud Logging. SAP Cloud Logging allows you to slice and dice logs, metrics, and traces in order to analyze functional and performance behaviour of your BTP workload on Cloud Foundry and Kyma.
Metrics are "measurements captured at runtime", which help you understand your app's health and performance.
Out of the box, @cap-js/telemetry offers metrics regarding the app's database pool, namely the pool info statistics of generic-pool.
Documentation can be found at cap.cloud.sap and opentelemetry.io.
1. You have Incident Management Application configured till this step
Metrics are "measurements captured at runtime", which help you understand your app's health and performance.
Out of the box, @cap-js/telemetry offers metrics regarding the app's database pool, namely the pool info statistics of generic-pool.
Once the application has all the requried configurations. The application can be tested locally.
In the terminal run the application with cds watch
Open the application and create a incident.
Check the logs in terminal
Example db pool metrics printed to the console:
[telemetry] - db.pool: size | available | pending 1/1 | 1/1 | 0
The business user could check how many "High" incidents are being currently handled in the system using the custom metrics. Custom metrics can be added as shown in the following example:
const cds = require('@sap/cds') // Import necessary modules const { metrics } = require('@opentelemetry/api'); const meter = metrics.getMeter('@capire/incidents:incidents.urgency.high'); // Create a counter const counter = meter.createUpDownCounter('incidents.urgency.high'); cds.on('served', async () => { const { ProcessorService } = cds.services // Increase count when new incident with high urgency is created ProcessorService.after("CREATE", "Incidents", (results, req) => { if (results.urgency_code === "H" && results.status_code !== "C") { counter.add(1, { 'sap.tenancy.tenant_id': req.tenant }); } }); // Reduce count once incident is closed ProcessorService.after("UPDATE", "Incidents", (results, req) => { if (results.urgency_code === "H" && results?.status_code === "C") { counter.add(-1, { 'sap.tenancy.tenant_id': req.tenant }); } }); }); module.exports = cds.server
In the previous chapter, you created a custom metric to count the "High" urgency incidents. You can create a custom visualisation to show the count.
On the left side breadcrumb, choose Visualize.
Choose Create visualization.
A dialog appears. Choose Metric.
On the right side of the screen, choose Metric.
Choose the dropdown under Aggregation and select Top Hit.
Choose the Field dropdown menu and select the value.
Under the Custom label, enter a name such as High Urgency Incidents.
Choose Update at the bottom of the screen.
The visualisation will be created.
You can save this visualisation for quick access.
#Observability #opentelemetry #SAPCloudLogging #SAPBTP #BTP #Metrics
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
18 | |
13 | |
11 | |
9 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 |