Skip to content

Commit 71cfbe0

Browse files
committed
[DOCS] Update APM example with latest elastic-apm release information
1 parent be2eaad commit 71cfbe0

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

docs/examples/apm/README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Observability Example
22

3-
This example provides a `docker-compose` file based on the [Quick start development environment](https://www.elastic.co/guide/en/apm/get-started/current/quick-start-overview.html) for APM. It gets the default distributions of Elasticsearch, Kibana and APM Server up and running in Docker.
3+
The Elasticsearch Ruby client integrates seamlessly with Elastic APM via the [Elastic APM Agent](https://github.com/elastic/apm-agent-ruby). This directory includes an example Sinatra App which interacts with Elasticsearch and is configured with APM via the apm agent.
44

5-
The docker-compose file also includes a basic Sinatra App and a script to ping the web app with different endpoints.
5+
A `docker-compose` file based on the [Quick start development environment](https://www.elastic.co/guide/en/apm/get-started/current/quick-start-overview.html) for APM is provided. It gets the default distributions of Elasticsearch, Kibana and APM Server up and running in Docker. The docker-compose file also runs the basic Sinatra App and a script to ping the web app with different endpoints.
66

77
Run `docker-compose up` on the root folder of this example and you'll get everything set up. Follow the steps on the full documentation [at elastic.co](https://www.elastic.co/guide/en/apm/get-started/current/quick-start-overview.html) to get APM set up in your Kibana instance.
88

@@ -24,10 +24,12 @@ Use your web browser or `curl` against http://localhost:9292/ to check that ever
2424

2525
The docker-compose file will also run a `pinger` script. This script will make requests irregularly to the web app to simulate proper traffic and fill your APM Dashboard with data, even errors. You can comment the pinger container from `docker-compose.yml` if you want to have all the services running and test the different endpoints (or add your own) by yourself.
2626

27-
# Screenshot
27+
Once you have some requests to Elasticsearch via the Sinatra app, you can see them in your APM dashboard:
2828

2929
![Kibana APM Dashboard](screenshot.jpg)
3030

31+
If you're using `elastic-apm` v3.8.0 or up, you can set `capture_elasticsearch_queries` to `true` in `config/elastic_apm.yml` to also capture the body from requests in Elasticsearch.
32+
3133
# Routes in the example Sinatra app
3234

3335
Once the app is running, you can open the following routes in your web browser or via `curl`. The responses are in JSON:

docs/examples/apm/config/elastic_apm.yml

+3
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ service_name: 'ruby-client-apm'
88
# Set custom APM Server URL (default: http://localhost:8200)
99
# In this example, we're using the URL from the docker-compose apm-server instance
1010
server_url: 'http://apm-server:8200'
11+
12+
# Capture request body in Elasticsearch queries
13+
capture_elasticsearch_queries: true

elasticsearch-transport/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Full documentation is available at <http://rubydoc.info/gems/elasticsearch-trans
8383
* [Connect using an Elastic Cloud ID](#connect-using-an-elastic-cloud-id)
8484
* [Authentication](#authentication)
8585
* [Logging](#logging)
86+
* [APM integration](#apm-integration)
8687
* [Custom HTTP Headers](#custom-http-headers)
8788
* [Identifying running tasks with X-Opaque-Id](#identifying-running-tasks-with-x-opaque-id)
8889
* [Setting Timeouts](#setting-timeouts)
@@ -248,6 +249,9 @@ log.level = :info
248249

249250
client = Elasticsearch::Client.new logger: log
250251
```
252+
### APM integration
253+
254+
This client integrates seamlessly with Elastic APM via the [Elastic APM Agent](https://github.com/elastic/apm-agent-ruby). It will automatically capture client requests if you are using the agent on your code. If you're using `elastic-apm` v3.8.0 or up, you can set `capture_elasticsearch_queries` to `true` in `config/elastic_apm.yml` to also capture the body from requests in Elasticsearch. See [here](https://github.com/elastic/elasticsearch-ruby/tree/master/docs/examples/apm) for an example.
251255

252256
### Custom HTTP Headers
253257

0 commit comments

Comments
 (0)