Opensearch Observability Dashboard
Pre-release
Pre-release
·
57 commits
to main
since this release
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.
- Download and unzip the opensearch-observability-dashboard.zip in your local machine.
- Update
OPENSEARCH_INITIAL_ADMIN_PASSWORDin thepath/to/opensearch-observability-dashboard/config/.envfile. - Run
docker composeto start the OpenSearch server.docker compose -f docker-compose.yml up -d - Create a Ballerina service (e.g. shop service) with the following runtime configurations in the
Config.tomlfile.[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"
- Open the
main.balfile in the Ballerina package and add the following imports.import ballerinax/metrics.logs as _; import ballerinax/jaeger as _;
- Run the Ballerina service with the following command.
$ bal run - Send requests to your Ballerina service.
- Go to http://localhost:5601/ to view metrics, traces and logs in the OpenSearch dashboard.