Quick Start: Export Your First Metrics
Overview
LMC Exporter is a C++ exporter that reads LSEG/LMC shared-memory managed objects and renders app-specific metrics in Prometheus text format.
This quick start shows how to:
- Use the installed tar archive executable.
- Export your first metrics in snapshot mode.
- Run the HTTP metrics endpoint for Prometheus-style scrapes.
The examples use the built-in ads app mapping and the example shared-memory server key 82. Replace those values with the app and server key used by your LMC environment.
This article covers first-run usage only: installation, minimum configuration, snapshot mode, and HTTP metrics mode. It does not cover custom metric mapping generation, filter-group design, or contributor workflows.
Prerequisites
Before you start, make sure you have:
| Requirement | Notes |
|---|---|
| Installed tar archive | Follow Installation, including the active-install link. Examples use el8; use el9 for the EL9 archive. |
| Runtime libraries | The matching platform libraries must be available on the host. |
| Licensing | The examples use a customer license file at /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic. For online entitlement, use Gateway Licensing. |
| Accessible LMC shared memory | Run as an account permitted to discover and read the configured shared-memory server key. |
How It Works
At startup, lmc_exporter creates a shared-memory server pool, discovers visible root handles, selects the best matching root, subscribes to child objects and variables under that root, and renders matched variables as Prometheus text.
The exporter can render metrics in two first-run modes:
Snapshot mode writes periodic Prometheus-style metric output to stdout. The interval is controlled by --metrics-interval or metrics_interval_seconds.
Use this mode when you want to inspect output directly from a terminal or capture snapshots with a process supervisor.
HTTP metrics mode starts a lightweight listener and serves the rendered Prometheus text on /metrics by default.
Use this mode when Prometheus or another scraper will collect metrics over HTTP.
The exporter does not emit scrape output until the selected target subtree is fully subscribed and in sync. In HTTP mode, the endpoint can return 503 until the requested target is ready.
Verify the Installation
Check the installed version:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 --version
The expected version is v0.19.0. Stop an existing exporter service before starting a foreground example on the same port.
Configuration
You can configure the exporter with CLI flags or a TOML file. For quick-start usage, CLI flags are the fastest option.
Required first-run values
| Setting | CLI flag | TOML key | Description |
|---|---|---|---|
| App mapping | --app | app | Selects the metric mapping set. Built-in app values include ads, adh, ats, rtc, and rrcp_trans. |
| Server key | --server-key | server_keys | Shared-memory server key used to discover the target root. Repeat the CLI flag for multiple keys. |
| License file | --license-file | license_file | Path to the customer license JSON file required in local-file mode. |
Optional first-run values
| Setting | CLI flag | TOML key | Description |
|---|---|---|---|
| Instance hint | --instance | instance | Optional root-selection hint. Use a full root ID or a bare instance number when roots follow hostname.instance_no.application naming. |
| Snapshot interval | --metrics-interval | metrics_interval_seconds | Number of seconds between stdout snapshots. |
| Debug logging | --debug | debug | Enables verbose sync, update, and lookup diagnostics. |
| HTTP listener | --enable-metrics-http | metrics_http_enabled | Enables HTTP metrics mode. |
| HTTP bind address | --metrics-bind-address | metrics_bind_address | IPv4 bind address, such as 127.0.0.1 or 0.0.0.0. |
| HTTP port | --metrics-port | metrics_port | HTTP listener port. |
| HTTP path | --metrics-path | metrics_path | Scrape path, usually /metrics. |
When you use --config, TOML values are loaded first. CLI flags override TOML values afterward.
Optional TOML quick-start file
Create ./lmcExporterConfig.toml with the example below, or edit the installed configuration at /opt/particle_horizon/local_config/lmc_exporter/lmc_exporter.toml.
For a minimal single-target HTTP quick start, use:
context_id = "shmApp"
pool_name = "pool"
app = "ads"
server_keys = ["82"]
metrics_interval_seconds = 10
metrics_http_enabled = true
metrics_bind_address = "127.0.0.1"
metrics_port = 9464
metrics_path = "/metrics"
license_file = "/opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic"
Run with the config file:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 --config ./lmcExporterConfig.toml
Usage
Quickstart: Export Your First Metrics
Use a known server key and app mapping. This example uses app ads, server key 82, and a license file at /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic
By default, when HTTP mode is not enabled, the exporter writes Prometheus-style snapshots to stdout.
To make root discovery easier to diagnose during a first run, add --debug:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic \
--debug
If more than one visible root can match the server key, provide an instance hint:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--instance 1 \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic
The --instance value can be either the full root ID or the bare instance_no segment when roots use hostname.instance_no.application naming.
Running in Snapshot Mode
Snapshot mode is the default mode when the HTTP listener is disabled.
Run a snapshot exporter with a 10-second interval:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--metrics-interval 10 \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic
The exporter writes Prometheus-style metric snapshots to stdout. Lookup and event diagnostics are written to stderr.
Snapshot mode behavior
- The exporter discovers the root for the configured server key.
- It subscribes to the selected subtree.
- It waits until the tracked subtree is fully subscribed and in sync.
- It periodically writes rendered metrics to
stdout.
If no metrics appear immediately, the exporter may still be waiting for the tracked subtree to synchronize. Use --debug to inspect root discovery, subscription, and sync diagnostics.
Running in HTTP Metrics Mode
HTTP metrics mode serves the same rendered Prometheus output over an HTTP endpoint.
Start the exporter on port 9464:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--enable-metrics-http \
--metrics-bind-address 127.0.0.1 \
--metrics-port 9464 \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic
Scrape metrics from another shell:
curl "http://127.0.0.1:9464/metrics?server_key=82"
When the HTTP listener is enabled, periodic Prometheus snapshots are no longer written to stdout.
Route by resolved instance
After discovery, you can route by app and resolved instance:
curl "http://127.0.0.1:9464/metrics?app=ads&instance=phoads01.1.ads"
If more than one target shares the same app and instance, include server_key as well:
curl "http://127.0.0.1:9464/metrics?app=ads&instance=phoads01.1.ads&server_key=82"
Use a custom metrics path
Set a custom HTTP path with --metrics-path:
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--enable-metrics-http \
--metrics-port 9464 \
--metrics-path /metrics \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic
Scrape the configured path:
curl "http://127.0.0.1:9464/metrics?server_key=82"
Examples
/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--metrics-interval 10 \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 \
--server-key 82 \
--app ads \
--enable-metrics-http \
--metrics-bind-address 127.0.0.1 \
--metrics-port 9464 \
--license-file /opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.liccurl "http://127.0.0.1:9464/metrics?server_key=82"context_id = "shmApp"
pool_name = "pool"
app = "ads"
server_keys = ["82"]
metrics_interval_seconds = 10
metrics_http_enabled = true
metrics_bind_address = "127.0.0.1"
metrics_port = 9464
metrics_path = "/metrics"
license_file = "/opt/particle_horizon/local_data/lmc_exporter/lmc_exporter.lic"/opt/particle_horizon/lmc_exporter/bin/lmc_exporter-el8 --config ./lmcExporterConfig.toml