Skip to main content
Skip to main content

Local Logs & Metrics

This getting started guide allows you collect local logs and metrics from your system, sending them to ClickStack for visualization and analysis.

This example works on OSX and Linux systems only

The following example assumes you have started ClickStack using the instructions for the all-in-one image and connected to the local ClickHouse instance or a ClickHouse Cloud instance and created the Logs source.

Visit http://localhost:8080 to access the HyperDX UI and ensure you've connected to the local instance by accepting the default settings and clicking Create.

Create a local OTel configuration

Create a otel-file-collector.yaml file with the following content:

This configuration collects system logs and metric for OSX and Linux systems, sending the results to ClickStack via the otlp endpoint on port 4317.

For more details on the OTel configuration structure, we recommend the official guide.

Start the collector

Run the following docker command to start an instance of the OTel collector.

The collector will immediately begin collecting local system logs and metrics.

Explore system logs

Navigate to the HyperDX UI. The search UI should be populated with local system logs. Expand the filters to select the system.log:

Create a metric source

The OTel collector was also configured to collect system metrics. To explore these metrics we need to create a new metrics source.

Create a metrics source by clicking the Logs source, followed by Create New Source.

Select OTEL Metrics for the Source Data Type. Complete the form with the following details before selecting Save New Source:

  • Name : Metrics
  • Server Connection: Default
  • Database: Default
  • Gauge Table: otel_metrics_guage
  • Histogram Table: otel_metrics_histogram
  • Sum Table: otel_metrics_sum
  • Correlated Log Source: Logs

Explore system metrics

We can explore these metrics using charts.

Navigate to the Chart Explorer via the left menu. Select the source Metrics and Maximum as the aggregation type.

For the Select a Metric menu simply type memory before selecting system.memory.utilization (Gauge).

Press the run button to visualize your memory utilization over time.

Note the number is returned as a floating point %. To render more clearly, select Set number format.

From the subsequent menu you can select Percentage from the Output format drop down before clicking Apply.