LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial

Skywalking Tracing

As of Skywalking v6.5.0, there is support for light-4j (both versions 1.6.x and 2.x) in the form of a plugin. This page provides instructions on how to start generating traces on the Skywalking platform for a light-4j application.

Obtaining Skywalking project component binaries

There are many components to the Skywalking project; the ones we are most interested in are: the Observability Analysis Platform (OAP) backend server, the Skywalking UI, and the Java agent which is to be installed to your application of interest.

For the OAP server and Skywalking UI, you have the choice of:

  • building them from source code
  • downloading the distributed packages
  • running Docker images

The Java agent, named skywalking-agent.jar, must be either built from source or downloaded.

In-depth workflow

This section provides an example workflow (suited for development) using macOS with detailed steps to set up Skywalking.

We will make use of the example Petstore project featured in the OpenAPI 3.0 tutorial. Note that you may need to modify the pom to have the release profile set as active by default. This is so that you can execute the petstore-3.0.1.jar with the java -jar command.

Follow the steps mentioned in the Skywalking Build from GitHub section here. In step 4, use the tag v6.5.0 or higher. Upon a successful build, there should be a ~/$WORKSPACE/skywalking/skywalking-agent/skywalking-agent.jar produced.

Run git clone https://github.com/apache/skywalking-docker.git. Navigate to the directory that contains the Skywalking Docker repo that you cloned and then run cd ~/$WORKSPACE/skywalking-docker/6/6.5/compose. Once inside that folder, run docker-compose up, which will download the OAP server and Skywalking UI images if needed and then start the containers.

Alternatively, you can run the OAP server and Skywalking UI locally. When the Skywalking project is built successfully, there is a dist folder which contains .tar.gz (for *nix) and .zip files (for Windows). Extract the appropriate archive and in the bin folder you will see several .sh (for *nix) and .bat (for Windows) files. To start the OAP server, run the oapService script. To start the Skywalking UI, run the webappService.sh script. Note that each script starts a new process, so once finished you will have to search for the pids and then kill them. More details including configuration and advanced features are available here.

Navigate back to the Petstore project and then run java -javaagent:$WORKSPACE/skywalking/skywalking-agent/skywalking-agent.jar -jar target/petstore-3.0.1.jar.

Alternatively, you may run java -javaagent:$WORKSPACE/skywalking/skywalking-agent/skywalking-agent.jar -Dskywalking.plugin.light4j.trace_handler_chain=true -jar target/petstore-3.0.1.jar. By specifying plugin.light4j.trace_handler_chain=true, traces generated upon sending a request to the service endpoint will include spans for whichever light-4j handlers were involved with the request. Detailed information on setting up the Java agent can be found here.

Now make some requests to the Petstore service with curl:

curl -k https://localhost:8443/v1/pets
curl -k https://localhost:8443/v1/pets/1
curl -k https://localhost:8443/abc

When you view the Skywalking UI (located at http://localhost:8080 by default), you should see something like the following for a successful request:

Example Skywalking UI trace screen

Note that Skywalking also has a plugin for Undertow, which is why you can see span information related to Undertow in the light-4j trace from the screenshot.

For HTTP 4xx errors, you will instead see something like:

Example Skywalking UI trace error

Services built with light-4j are shown in the topology as such:

Skywalking UI topology

Troubleshooting

Here are some tips that may be useful:

  • Check that the timezone displayed in the Skywalking UI (bottom right corner) matches the OAP backend server and is the one you expect; traces will not show up immediately otherwise
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute