Skip to content

Files

instrumentation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 20, 2019
Feb 20, 2019
Apr 17, 2019
Dec 7, 2021
Apr 17, 2019
May 6, 2021
Apr 17, 2019
Dec 7, 2021
Dec 7, 2021
Dec 7, 2021
May 6, 2021
Feb 20, 2019

Example: Instrumentation

This example demonstrates how to instrument the Elasticsearch client.

OpenCensus

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.

Elastic APM

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.

Screenshot

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