When you provision the Elastic Stack add-on on Clever Cloud, you get an Elasticsearch Platinum instance, Kibana and an APM server.
- Elasticsearch is a distributed search and analytics engine that centrally stores your data for real-time discovery and analysis.
- Kibana is a visualization tool that lets you explore Elasticsearch data and track application metrics through dashboards. Organization members access Kibana through an automatically configured SSO system with no additional authentication setup required.
- Elastic APM is an application performance monitoring solution that reveals where your application spends time, helping you identify and resolve issues quickly.
Both APM and Kibana are opt-in options that deploy as separate applications within your organization. Each receives its own application name following the pattern: Component Name - addon_[ID]. Provisioning takes approximately one minute. You can scale up/down or delete them independently, and Clever Cloud updates them automatically.
⚠️ Do not connect the Elastic Stack addon to your apps or you'll get the wrong environment variables. Instead, link your apps to the APM application (see below).
Regardless of the language of your app, you'll need to connect your app to the APM on Clever Cloud.
Follow these steps to connect your app deployed on Clever Cloud to Elastic APM.
- Go to your app menu "Service Dependencies"
- Choose "Link applications" and select your APM app.
- Restart your app to deploy with new APM environment variables.
Now you can open your APM dashboard and check if your app appears in the Services list. It will appear by the name you gave it on the Console.
In some cases (like WordPress), previous steps all you'll need to do, but most apps will need to get the Elastic agent from core.
If you open APM and don't see your app listed in the Services list, it means you'll need to make a quick set up in the code.
Check this repository to find step-by-step instructions that fits your app language. Folders contain ready-to-work-example files that you can just add to your app and commit.
You can export your logs to your Elastic addon with clever-tools, Clever Cloud CLI. See installation options to get started.
Once you got clever-tools installed, just create a log drain with the following commands:
clever drain create ElasticSearch https://xxx-elasticsearch.services.clever-cloud.com/_bulk --username USERNAME --password PASSWORD
What does this command means?
clever drain createis the command to create a drainElasticSearchallows you to use the Elastic bulk API- Fill the rest with Elasticsearch credentials you'll find on your Elastic Addon dashboard.
⚠️ don't forget to add/_bulkat the end the domain name

