| copyright | lastupdated | keywords | subcollection | ||
|---|---|---|---|---|---|
|
2026-01-27 |
fleets, fleet logging, fleet monitoring, fleet observability, observability, logging, monitoring, Cloud Logs, Cloud Monitoring |
codeengine |
{{site.data.keyword.attribute-definition-list}}
{: #fleet-observability}
Logging and monitoring can help you troubleshoot issues in {{site.data.keyword.codeenginefull}} and can provide insight into your workload performance. Setting up logging and monitoring for fleets is done at the project level and is different from other {{site.data.keyword.codeengineshort}} features.
Logging and monitoring are optional, and can be set up any time after a fleet is created. {: note}
{: #fleet-log}
Logging for fleets is set up at the project level. After you perform these set up steps for a project, logging is available for all fleets in that project.
{: #log-instance}
You must have a Cloud Logs service instance that targets the region of the Code Engine project that your fleets run in. To check your existing Cloud Logs service instances, navigate to the Logging routing page{: external} in the UI and identify the instance that targets the relevant region. If the region does not have a targeted logging instance, follow the UI prompts to set one.
{: #log-perm}
Make sure you have a service ID and an API key that assign access to the Cloud Logs instance and set the required permissions.
- Create a service ID. Then assign the service ID an access policy that targets the Cloud Logs instance in your account. Assign this access policy the Sender service access level.
- Create an API key for the service ID. Save the API key in a secure location so you can reference it later.
{: #log-ingress-endpoint}
Get the private Ingress endpoint for the Cloud Logs instance.
- Navigate to the Logging instances page{: external} in the UI and click the relevant instance.
- Click Endpoints.
- Find the private Ingress endpoint. Save this value in a secure location so you can reference it later.
{: #log-vpe}
Create a virtual private endpoint gateway that connects to the logging instance. This VPE gateway must be created in the VPC that your fleets run in.
- Navigate to the VPE gateways page{: external} in the console.
- Click Create.
- Select the location and region that your Cloud Logs instance exists in.
- Select the VPC that your fleets run in.
- Connect the service to your Cloud Logs instance.
- In the Request connection to a service section, select the option for IBM Cloud Service.
- Under Cloud service offerings, select Cloud Logs.
- Under Cloud service regions, select the region that your Cloud Logs instance exists in.
- From the table, select the relevant Cloud Logs instance to connect to the VPE.
- Click Create.
{: #log-ip}
For each zone in the VPE, add a reserved IP address to one subnet.
- Navigate to the VPE gateways page{: external} in the console.
- Click the VPE you created in the previous step.
- Click Manage attached resources.
- Click Reserve or bind IP.
- Follow the prompts to reserve an IP address for a subnet in one of the VPE zones.
- Repeat this process for one subnet in each VPE zone.
{: #log-secret}
Add the required logging values to the fleets default secret.
- In the console, go to the Code Engine projects page{: external} and select the project that your fleets run in.
- Click Secrets and configmaps.
- Click the
codeengine-fleet-defaultssecret.- If it was not created before: click Create.
- Select Generic secret, then click Next.
- Name the secret
codeengine-fleet-defaults. You must use this exact name and formatting.
- Add the key-value pairs listed in the table below. Note that the
logging_sender_api_keyandlogging_ingress_endpointwere saved in earlier steps.
| Key | Value |
|---|---|
logging_ingress_endpoint |
The private Ingress endpoint for the Cloud Logs instance. This value is saved in a previous step. |
logging_sender_api_key |
The API key for the service ID that targets the Cloud Logs instance. This value is saved in a previous step. |
logging_ingress_port |
The port used to connect to the Cloud Logs instance. For private VPEs, specify 443. |
logging_level_worker |
The level of details you want to include in your worker logs. Accepted levels include: DEBUG, INFO, WARN, and ERROR. Default level: WARN. |
logging_level_agent |
The level of details you want to include in your fleet agent logs. Accepted levels include: DEBUG, INFO, WARN, and ERROR. Default level: WARN. |
| {: caption="Logging key-value pairs for the fleets default secret." caption-side="bottom"} |
{: #log-view}
Now that logging is set up for fleets in your Code Engine project, you can view your fleet logs. See Viewing logs and monitoring data for fleets for steps.
{: #fleet-monitor}
Monitoring for fleets is set up at the project level. After you perform these set up steps for a project, monitoring is available for all fleets in that project.
{: #monitor-instance}
You must have a Cloud Monitoring instance in the same region of the Code Engine project that your fleet belongs to. To check your existing Cloud Monitoring service instances, navigate to the Monitoring instances{: external} page in the UI and identify an instance in the relevant region. If you do not have a suitable instance, follow the UI prompts to create one.
{: #monitor-key}
Find the agent key for the monitoring instance.
- Navigate to the Monitoring instances{: external} page in the UI and click the relevant instance. On the instance details page, click Actions > Manage key, then click the option to view all keys in the dashboard.
- Click the agent key, which may have a format similar to
ab1c2345-****-678d9efgh012. Then click the option to copy the full agent key. - Save the agent key in a secure location where you can access it later.
{: #monitor-vpe}
Create a virtual private endpoint gateway that connects to the monitoring instance. This VPE gateway must be created in the VPC that your fleets run in.
- Navigate to the VPE gateways page{: external} in the console.
- Click Create.
- Select the location and region that your Cloud Logs instance exists in.
- Select the VPC that your fleets run in.
- Connect the service to your Cloud Logs instance.
- In the Request connection to a service section, select the option for IBM Cloud Service.
- Under Cloud service offerings, select Cloud Monitoring.
- Under Cloud service regions, select the region that your Cloud Monitoring instance exists in.
- From the table, select the relevant Cloud Monitoring instance to connect to the VPE.
- Click Create.
{: #monitor-ip}
For each zone in the VPE, add a reserved IP address to one subnet.
- Navigate to the VPE gateways page{: external} in the console.
- Click the VPE you created in the previous step.
- Click Manage attached resources.
- Click Reserve or bind IP.
- Follow the prompts to reserve an IP address for a subnet in one of the VPE zones.
- Repeat this process for one subnet in each VPE zone.
{: #monitor-secret}
- In the console, go to the Code Engine projects page{: external} and select the project that your fleets run in.
- Click Secrets and configmaps.
- Click the
codeengine-fleet-defaultssecret.- If it was not created before: click Create.
- Select Generic secret, then click Next.
- Name the secret
codeengine-fleet-defaults. You must use this exact name and formatting.
- Add the key-value pairs listed in the table below. Note that the
monitoring_ingestion_keywas saved in an earlier step.
| Key | Value |
|---|---|
monitoring_ingestion_region |
The region that the Cloud Monitoring instance exists in. Example: au-syd. |
monitoring_ingestion_key |
The monitoring agent key. This value was found in a previous step. |
| {: caption="Logging key-value pairs for the fleets default secret." caption-side="bottom"} |
{: #monitor-view}
Now that monitoring is set up for fleets in your Code Engine project, you can view your fleet monitoring data. See Viewing logs and monitoring data for fleets for steps.