Skip to main content

Leveraging OCI Logging Analytics for Deeper Troubleshooting Using Logs from Traefik Hub

Prerequisites

Before you begin, ensure you have:

Enable Logging Analytics

First, ensure you have the necessary permissions and access to OCI Logging Analytics. You'll need:

  1. Access to the Logging Analytics service
  2. Appropriate IAM policies for Logging Analytics
  3. Access to the compartment where you want to store logs
info

If you haven't enabled Logging Analytics yet, follow the official documentation to set it up.

Import Traefik Log Source Configuration

  1. Navigate to Logging Analytics in the OCI Console
  2. Select Administration from the left menu
  3. Under Actions, select Import Configuration Content
  4. Upload the Traefik Log Source configuration zip file

Import Log Source Configuration

Import Log Source Configuration

Configure Kubernetes Monitoring

  1. Navigate to Observability & Management >> Solutions

Configure Kubernetes Monitoring

  1. Select Connect Clusters

Configure Kubernetes Monitoring

  1. Choose Oracle OCI Kubernetes Engine under Monitor Kubernetes

Configure Kubernetes Monitoring

  1. Select your OCI Kubernetes Engine cluster and proceed to the next step
Configure log collection settings
  • If your cluster already has a metrics server installed, uncheck the "Install Metrics Server" option
  • If not, leave it checked to install the metrics server

Update Traefik Hub Configuration

For OCI DevOps Deployment

  1. Navigate to your DevOps project: Developer Services >> Projects >> Your Project Name >> Artifacts
  2. Locate your Traefik Helm Values artifact and select Edit
  3. Add the following configuration to enable log collection:
deployment:
podAnnotations:
oracle.com/oci_la_log_source_name: Traefik - Access Logs - v2
  1. Save the changes
  2. Run your deployment pipeline to apply the changes:
    • Go to Deployment Pipelines
    • Select your pipeline
    • Click Run pipeline and select Start manual run

For OCI Marketplace Deployment

  1. Access your OCI Kubernetes Engine cluster—either locally using the cluster’s kubeconfig file or via the OCI Cloud Shell.
  2. Patch the Traefik deployment to add the annotation:
kubectl patch deployment traefik -n traefik --patch '{"spec":{"template":{"metadata":{"annotations":{"oracle.com/oci_la_log_source_name":"Traefik - Access Logs - v2"}}}}}'

Viewing and Creating Dashboards

You have two options for creating dashboards to visualize your Traefik Hub logs:

Option 1: Create a Custom Dashboard

  1. Navigate to Observability & Management >> Logging Analytics >> Dashboards
  2. Click Create Dashboard
  3. Add logging chart widgets to visualize your Traefik Hub logs:
    • Select Logging chart as the widget type
    • Configure the widget with:
      • Name and description
      • Region selection
      • Visualization type (e.g., line chart, bar chart)
      • Time interval for refreshes
      • Grouping criteria
      • Custom filters for your Traefik logs
    • Add multiple widgets to monitor different aspects:
      • API Requests
      • API Requests Duration
      • IngressRoutes
      • API Plans
      • Requests TLS
      • Request per Endpoint

Option 2: Import a Pre-configured Dashboard

If you prefer a pre-configured dashboard:

  1. Navigate to Observability & Management >> Logging Analytics >> Dashboards
  2. Select Import Dashboards
  3. Upload the Traefik Dashboard configuration file and configure the import as shown in the image below:

Logging - Upload Dashboard

  1. After uploading, you should see this dashboard:

Traefik Dashboard

info
  • For more information on creating custom dashboards, refer to the OCI documentation.
  • You can customize any imported dashboard by adding or modifying widgets to suit your specific monitoring needs.

Verifying Log Collection

To verify that logs are being collected:

  1. Navigate to Logging Analytics >> Log Explorer
  2. Select your compartment
  3. Search for logs from the "Traefik - Access Logs - v2" source
  4. You should see recent log entries from your Traefik Hub deployment

Log Explorer

Troubleshooting

If you don't see logs being collected:

  1. Verify the annotation is correctly applied to the Traefik pods:
  kubectl describe pod -n traefik -l app.kubernetes.io/name=traefik
  1. Verify the Logging Analytics service is correctly configured in your tenancy

Next Steps

With the logging analytics in place, you can:

  • Set up alerts based on log patterns
  • Configure log retention policies
  • Create custom log queries for specific troubleshooting scenarios
  • Integrate with other OCI monitoring services

That's it! You have successfully configured OCI Logging Analytics for Traefik Hub.