This example demonstrates how to instrument the Elasticsearch client.
The opencensus.go example uses the ochttp.Transport wrapper to auto-instrument the client calls, and provides a simple exporter which prints information to the terminal.
The apmelasticsearch.go example demonstrates instrumenting the client with the Go agent for Elastic APM: configuring the transactions for multiple types, creating custom spans within a transaction, and reporting errors.
Run the example interactively with Docker and inspect the UI in Kibana:
docker-compose --file elasticstack.yml up --build
To destroy the Docker assets for the example, run:
docker-compose --file elasticstack.yml down --remove-orphans --volumes
