Skip to content

Tracing with Jaeger ​

The 4ALLPORTAL uses tracing to monitor the software, specifically the duration of requests and their parameters, such as database queries and HTTP requests as well as internal jobs. Tracing enables the administrator to find performance problems, like an unoptimized SQL condition behind a slow frontend.

The monitored events are reported as spans: logical units with an operation name, timestamps and duration, which in their sum define a trace.

The 4ALLPORTAL uses Jaeger's java implementaion of OpenTracing, which is the current open tracing standard.

Testing Jaeger ​

To test Jaeger's functionalities and to see how it looks like, you can start an all-in-one Docker container using the following example setup (testing purposes only):

yml
version: '3.7'
services:
  jaeger:
    image: jaegertracing/all-in-one:latest
    ports:
      - "16686:16686"

  4allportal:
    image: registry.4allportal.net/4allportal:SNAPSHOT
    ports:
      - 8181:8181
    environment:
      APPS_INSTALL: 4allportal-dam
      JAEGER_ENABLED: "true"
      JAEGER_AGENT_HOST: jaeger
      JAEGER_AGENT_PORT: "6831"
      JAEGER_SERVICE_NAME: 4allportal
      JAEGER_TAGS: instance=dev
      JAEGER_SAMPLER_TYPE: const
      JAEGER_SAMPLER_PARAM: "1"

  db:
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: toor

After starting this stack, you can visit the 4allportal (http://localhost:8181) and jaeger (http://localhost:16686), where you can select 4ALLPORTAL as the service and then take a look at the spans.

Basic configuration ​

The basic configuration parameters for starting Jeager in Docker are:

Environment VariableDescriptionExampleExplanation
JAEGER_ENABLEDenables custom 4allportal tracertrueIf not set to "true" a default tracer will be crated to avoid Errors if Jeager is not configured.
JAEGER_AGENT_HOSThostname / IP where the Jaeger agent is availablejaeger-agent / 10.10.10.10
JAEGER_AGENT_PORTport behind which the Jaeger agent is available6831
JAEGER_SERVICE_NAMEservice name, under which the spans are reported4ALLPORTAL
JAEGER_SAMPLER_TYPEsampler typeconstconst means spans are reported deterministically
JAEGER_SAMPLER_PARAMsampler parameter11 means all spans are reported
JAEGER_TAGStags which are added to the spansinstance=devThis makes searching for spans easier

Note: Find out all configuration steps and details by checking out Jaeger's readme.

References ​

  • To get to know how tracing works, please read this overview.
  • Look for a description of spans in the OpenTracing docs here.
  • Details on Jager's java implementation can be found here.
Request missing documentation