Getting Started with Metrics
Install OpenTelemetry
Go to https://opentelemetry.io/docs/collector/installation/ or https://github.com/open-telemetry/opentelemetry-collector-releases/releases/ to find the package you want to install. At the point of writing this guide, 0.115.1 is the latest package so we’ll install otelcol-contrib_0.115.1_linux_amd64
On the machine you wish to collect metrics from, run the following 4 commands:
Deb-based
sudo apt-get update
sudo apt-get -y install wget
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.115.1/otelcol-contrib_0.115.1_linux_amd64.deb
sudo dpkg -i otelcol-contrib_0.115.1_linux_amd64.deb
RHEL-based
sudo dnf update -y
sudo dnf install -y wget
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.115.1/otelcol-contrib_0.115.1_linux_amd64.rpm
sudo rpm -ivh otelcol-contrib_0.115.1_linux_amd64.rpm
Navigate to /etc/otelcol-contrib/
Edit the file with your favourite file editor, for example: nano config.yaml
Paste the following into the config file overwriting it completely:
Replace <YOUR-ASCENT-ENV>with your Ascent domain, e.g. company.apica.io
Replace <YOUR-INGEST-TOKEN>with your Ascent Ingest Token, e.g. eyXXXXXXXXXXX...
Follow this guide on how to obtain your ingest token - https://docs.apica.io/integrations/overview/generating-a-secure-ingest-token
When you’ve finished editing the config, save it and run otelcol-contrib validate --config=config.yaml
If you get no error returned, the config file is valid.
Restart the service with sudo systemctl restart otelcol-contrib
Verify that the service is up and running correctly with sudo systemctl status otelcol-contrib
A good result should look like this:
You can also view live logs using journalctl -u otelcol-contrib -f. With the above config you would see entries every 10 seconds.
Verify metrics in the Ascent platform
Click on the green “+ Create” button on the top navigation bar and select Query
In the dropdown menu on the left hand side, select Ascent Metrics
In the search bar, search for system_
This will present all the different system metrics that is being scraped with your Otel configuration
You can click any of the metrics directly to insert it into the query text, and hit execute to see the latest metrics.
Last updated