Skip to content

Opensearch Observability Dashboard

Pre-release
Pre-release

Choose a tag to compare

@NipunaMadhushan NipunaMadhushan released this 25 Jul 06:03
· 57 commits to main since this release
92e7f58

Ballerina supports observability for OpenSearch, which is a community-driven, Apache 2.0-licensed open source search and analytics suite that makes it easy to ingest, search, visualize, and analyze data. It provides a highly scalable system for providing fast access and response to large volumes of data with an integrated visualization tool, OpenSearch Dashboards, that makes it easy for users to explore their data.

Provided opensearch-observability-dashboard.zip contains the set-up to observe Ballerina programs with OpenSearch.

Follow the steps given below to view Ballerina metrics, traces and logs in OpenSearch.

  1. Download and unzip the opensearch-observability-dashboard.zip in your local machine.
  2. Update OPENSEARCH_INITIAL_ADMIN_PASSWORD in the path/to/opensearch-observability-dashboard/config/.env file.
  3. Run docker compose to start the OpenSearch server.
    docker compose -f docker-compose.yml up -d
    
  4. Create a Ballerina service (e.g. shop service) with the following runtime configurations in the Config.toml file.
    [ballerina.observe]
    metricsLogsEnabled = true
    tracingEnabled=true
    tracingProvider="jaeger"
    
    [ballerinax.jaeger]
    agentHostname="localhost"
    agentPort=4317
    samplerType="const"
    samplerParam=1.0
    reporterFlushInterval=2000
    reporterBufferSize=1000
    
    [ballerinax.metrics.logs]
    logFilePath = "<PATH>/<TO>/opensearch-observability-dashboard/logs/ballerina/<NAME_FOR_SERVICE>/app.log"
  5. Open the main.bal file in the Ballerina package and add the following imports.
    import ballerinax/metrics.logs as _;
    import ballerinax/jaeger as _;
  6. Run the Ballerina service with the following command.
    $ bal run
    
  7. Send requests to your Ballerina service.
  8. Go to http://localhost:5601/ to view metrics, traces and logs in the OpenSearch dashboard.