Introducing MetricFire Logging: Visualize Logs alongside Metrics

Introducing MetricFire Logging: Visualize Logs Alongside Metrics

Table of Contents

Introduction

As modern infrastructure grows more dynamic and distributed, collecting logs alongside metrics becomes a critical part of any observability strategy. To make this easy and powerful, MetricFire now supports a direct logging pipeline using Grafana Loki. This allows you to forward system logs from your servers to Hosted Graphite's Loki backend and visualize them in your Hosted Grafana dashboards with full control over queries, filtering, and alerting.

This guide outlines how to set up and use this new integration. We’ll walk through installing a collector on an Ubuntu server, forwarding your system logs to the Hosted Graphite Loki endpoint, configuring Grafana to use Loki as a data source, and building dashboard panels that show both raw logs and extracted metrics.

Start a chat with us today if you are interested in testing MetricFire's new Logging Integration for FREE. We will help you every step of the way, from collection to visualization!

Step 1: Install a Collector on your Server

We support log collection via OpenTelemetry Contrib and Promtail. In this example, we'll detail how to configure Promtail since it is the official log shipping agent for Grafana Loki. It runs as a lightweight binary that tails log files (like /var/log/syslog) and forwards them to a Loki endpoint over HTTP.

Install/unpack Promtail (Ubuntu):

cd /usr/local/bin

wget https://github.com/grafana/loki/releases/latest/download/promtail-linux-amd64.zip
unzip promtail-linux-amd64.zip

mv promtail-linux-amd64 promtail
chmod +x promtail

Create a configuration directory:

sudo mkdir -p /etc/promtail

Step 2: Configure Promtail to Forward Logs

Promtail requires a YAML config file to define where to read logs from and where to send them. Create a file at /etc/promtail/promtail.yaml with the following content:

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
- url: https://<YOUR-API-KEY>@www.hostedgraphite.com/logs/sink

scrape_configs:
  - job_name: syslog
    static_configs:
      - targets:
          - localhost
        labels:
          job: syslog
        host: <HOST-NAME>
          __path__: /var/log/syslog

Notes:

  • Replace <YOUR-API-KEY> with your actual HG API key, and <HOST-NAME> with the name of your server
  • The labels block attaches metadata like the hostname and job name, which will be queryable in Grafana

Step 3: Configure a Loki Data Source in MetricFire's Hosted Grafana

If you reach out about trying our new Logging feature for free, we will create a Loki Access Key in your Hosted Graphite account. If you don't already have a Hosted Graphite account, sign up for a free trial here to obtain a Hosted Graphite API key and Loki Access Key.

Introducing MetricFire Logging: Visualize Logs Alongside Metrics - 1


Now you can navigate to your Hosted Graphite Dashboards => Settings => Data sources => Add New Data source (Loki). Now you will be able to add a URL for our Loki endpoint, which includes your Loki Access Key:

https://www.hostedgraphite.com/logs/<UID>/<LOKI-ACCESS-KEY>

Introducing MetricFire Logging: Visualize Logs Alongside Metrics - 2

Step 4: Query and View Logs in Grafana

After logs are ingested by Loki and the data source is connected, you can create a new dashboard panel, select Loki as your Data source, and format a query in 'code mode'. 

To view syslog messages from your server:

{job="syslog", host="<HOST-NAME>"}

You can filter further using log content:

{job="syslog", host="<HOST-NAME>"} |= "systemd"

Introducing MetricFire Logging: Visualize Logs Alongside Metrics - 3


Loki supports a powerful LogQL syntax with regex filtering, line parsing, and field extraction.

Step 5: Extract and Graph Log-Based Metrics

Loki allows you to convert logs into metrics using count_over_time() and similar functions. This turns raw log patterns into quantifiable data that you can graph and alert on.

Count CRON executions

count_over_time({job="syslog"} |= "CRON" [5m])

Count Failures

count_over_time({job="syslog"} |= "failed" [5m])

Track service starts/stops by name

sum by (svc) (
  count_over_time(
    {job="syslog"} |= "systemd" |~ "Stopped|Started"
    | pattern "<_> systemd[<pid>]: <_> <svc>.service."
    [1h]
  )
)

Introducing MetricFire Logging: Visualize Logs Alongside Metrics - 4

Introducing MetricFire Logging: Visualize Logs Alongside Metrics - 5

Conclusion

Bringing logs and metrics together in one place gives you a much clearer picture of what’s happening on your systems. In this guide, we walked through setting up Promtail on an Ubuntu server, forwarding syslog data to Hosted Graphite’s Loki endpoint, connecting that data to Grafana, and building useful dashboards that let you see both raw logs and visualized metrics.

By combining logs and metrics in Grafana, you can troubleshoot faster, spot patterns more easily, and get critical context around performance issues or system events. Instead of jumping between tools or manually inspecting your server logs, you can correlate a spike in metrics with the exact log line that makes sense in a single dashboard.

This Loki-based logging integration is quick to set up but powerful in practice. Whether you're tracking service restarts, failed jobs, or kernel anomalies, it gives you the visibility you need to stay ahead of problems and reduce time to resolution. If you’re looking to expand this pipeline with automated alerts, structured log parsing, or advanced Graphite metrics, we’d love to help. Reach out to the MetricFire team today and let’s build something great together!

You might also like other posts...
metricfire Jul 01, 2025 · 3 min read

ログをメトリクスに変換: Loki、Python、Telegrafによるオープンソースの構築(前編)

ELKスタックを使用せず、最小限の労力で、軽量でオープンソースのセットアップを使用して、生のログを使用可能なメトリクスに変換する方法を紹介します。Loki、Python、Telegrafを使用して、ログをGraphiteメトリクスに変換し、簡単に監視やアラートを出すことができます。システム管理者、DevOps初心者、またはゼロからより革新的なモニタリングパイプラインを構築することに興味がある方に最適です。 Continue Reading

metricfire Jul 01, 2025 · 5 min read

OpenTelemetryを使用してSnowflakeの観測性を高める方法

このガイドでは、OpenTelemetry(contrib)をSnowflakeに統合して、クエリのパフォーマンス、実行時間、キューイング、ストレージの使用率、課金への影響を可視化する方法を説明します。SnowflakeメトリクスをスクレイピングするためのOpenTelemetry Collectorをセットアップし、データをエクスポートするためのエンドポイントを設定し、よくある落とし穴のトラブルシューティングを行います。最後には、クエリとリソースのパフォーマンスに関する実用的な洞察を提供する、Snowflake用のスケーラブルで自動化されたモニタリングの設定ができるようになります。 Continue Reading

metricfire Jun 30, 2025 · 3 min read

Hosted GraphiteでHerokuアドオンを監視する実践ガイド

このガイドでは、Hosted Graphite by MetricFireを使用してHerokuアドオンのカスタムなリアルタイム監視を設定する方法についてご説明します。このブログでは一例として、Heroku Dynosと選択したアドオンからHosted Graphiteバックエンドにパフォーマンスメトリクスを転送する方法を詳しく説明します。 Continue Reading

header image

We strive for 99.999% uptime

Because our system is your system.

14-day trial 14-day trial
No Credit Card Required No Credit Card Required