Technical “How-To’s”

How to Monitor Host Metrics with OpenTelemtry

Austin Senkowski
Austin Senkowski

OpenTelemetry is at the core of standardizing telemetry solutions. At observIQ, we’re focused on building the very best in open source telemetry software. Our relationship with OpenTelemetry began in 2021, with observIQ, contributing our logging agent, Stanza, to the OpenTelemetry community. Now, we are shifting our focus to simplifying OpenTelemetry solutions to its large base of users. On that note, we launched a collector that combines the best of both worlds, with OpenTelemetry at its core, combined with observIQ’s functionalities to simplify its usage.

In this post, we are taking you through the installation of the observIQ distribution of the OpenTelemetry collector and the steps to configure the collector to gather host metrics, eventually forwarding those metrics to the Google Cloud Operations.

Step 1: Installing the collector

The simplest way to get started is with one of the single-line installation commands shown below. For more advanced options, you’ll find a variety of installation options for Linux, Windows, and macOS on GitHub.

Use the following single-line installation script to install the observiq-otel collector.

Please note that the collector must be installed on the system which you wish to collect host metrics from.


1msiexec /i "" /quiet


1sudo sh -c "$(curl -fsSlL"

Step 2: Setting up pre-requisites and authentication credentials

In the following example, we are using Google Cloud Operations as the destination. However, OpenTelemtry offers exporters for many destinations. Check out the list of exporters here.

Setting up Google Cloud exporter prerequisites:

If running outside of Google Cloud (On prem, AWS, etc) or without the Cloud Monitoring scope, the Google Exporter requires a service account.

Create a service account with the following roles:

  • Metrics: roles/monitoring.metricWriter
  • Logs: roles/logging.logWriter

Create a service account JSON key and place it on the system that is running the collector.


In this example, the key is placed at /opt/observiq-otel-collector/sa.json and its permissions are restricted to the user running the collector process.

1sudo cp sa.json /opt/observiq-otel-collector/sa.json
2sudo chown observiq-otel-collector: /opt/observiq-otel-collector/sa.json
3sudo chmod 0400 /opt/observiq-otel-collector/sa.json

Set the GOOGLE_APPLICATION_CREDENTIALS environment variable by creating a systemd override. A systemd override allows users to modify the systemd service configuration without modifying the service directly. This allows package upgrades to happen seamlessly. You can learn more about systemd units and overrides here.

Run the following command

1sudo systemctl edit observiq-otel-collector

If this is the first time an override is being created, paste the following contents into the file:

1[Service] Environment=GOOGLE_APPLICATION_CREDENTIALS=/opt/observiq-otel-collector/sa.json

If an override is already in place, simply insert the Environment parameter into the existing Service section.

Restart the collector

1sudo systemctl restart observiq-otel-collector


In this example, the key is placed at C:/observiq/collector/sa.json.

Set the GOOGLE_APPLICATION_CREDENTIALS with the command prompt setx command.

Run the following command

1setx GOOGLE_APPLICATION_CREDENTIALS "C:/observiq/collector/sa.json" /m

Restart the service using the services application.

Step 3: Configuring the collector

In this sample configuration, the steps to use the host metrics receiver to fetch metrics from the host system and export them to Google Cloud Operations are detailed. This is how it works:

  1. The collector scrapes metrics and logs from the host and exports them to a destination assigned in the configuration file.
  2. To export the metrics to Google Cloud Operations, use the configurations outlined in the googlecloudexporter

After the installation, the config file for the collector can be found at:

  • C:\Program Files\observIQ OpenTelemetry Collector\config.yaml (Windows)
  • /opt/observiq-otel-collector/config.yaml (Linux)

Edit the configuration file and use the following configuration.

1# Receivers collect metrics from a source. The host metrics receiver will
2# get CPU load metrics about the machine the collector is running on
3# every minute.
5  hostmetrics:
6  collection_interval: 60s
7  scrapers:
8    cpu:
9    disk:
10    load:
11    filesystem:
12    memory:
13    network:
14    paging:
15    processes:
17# Processors are run on data between being received and being exported.
19  # Resourcedetection is used to add a unique (
20  # to the metric resource(s), allowing users to filter
21  # between multiple systems.
22  resourcedetection:
23  detectors: ["system"]
24  system:
25    hostname_sources: ["os"]
27  # Resourceattributetransposer is used to add labels to metrics.
28  resourceattributetransposer:
29  operations:
30    # Process metrics require unique metric labels, otherwise the Google
31    # API will reject some metrics as "out of order" / duplicates.
32    - from: ""
33        to: "hostname"
34    - from: ""
35        to: "pid"
36    - from: ""
37        to: "binary"
39  # Normalizesums smoothes out data points for more
40  # comprehensive visualizations.
41  normalizesums:
43  # The batch processor aggregates incoming metrics into a batch,
44  # releasing them if a certain time has passed or if a certain number
45  # of entries have been aggregated.
46  batch:
48# Exporters send the data to a destination, in this case GCP.
50  googlecloud:
51  retry_on_failure:
52    enabled: false
53  metric:
54    prefix:
56# Service specifies how to construct the data pipelines using
57# the configurations above.
59  pipelines:
60  metrics:
61    receivers:
62    - hostmetrics
63    processors:
64    - resourcedetection
65    - resourceattributetransposer
66    - normalizesums
67    - batch
68    exporters:
69    - googlecloud

3. Restart the collector

1systemctl restart observiq-otel-collector

Step 3: Viewing the metrics in Google Cloud Operations

You should now be able to view the host metrics in your Metrics explorer. Nice work! This is how simple it is to collect host metrics in Linux.

Metrics collected

Processes CreatedTotal number of created
Process CountTotal number of processes in each
Process CPU timeTotal CPU seconds broken down by different
Process Disk IODisk bytes
File System Inodes UsedFileSystem inodes
File System UtilizationFilesystem bytes
Process Physical Memory UtilizationThe amount of physical memory in
Process Virtual Memory UtilizationVirtual memory
Networking ErrorsThe number of errors
Networking ConnectionsThe number of


observIQ’s distribution is a game-changer for companies looking to implement the OpenTelemetry standards. The single line installer, seamlessly integrated receivers, exporter, and processor pool make working with this collector simple. Follow this space to keep up with all our future posts and simplified configurations for various sources. For questions, requests, and suggestions, reach out to our support team at

Austin Senkowski
Austin Senkowski

Related posts

All posts

Get our latest content
in your inbox every week

By subscribing to our Newsletter, you agreed to our Privacy Notice

Community Engagement

Join the Community

Become a part of our thriving community, where you can connect with like-minded individuals, collaborate on projects, and grow together.

Ready to Get Started

Deploy in under 20 minutes with our one line installation script and start configuring your pipelines.

Try it now