Configure Exporter Targets
Overview
lmc_exporter exposes LMC shared-memory managed object data as Prometheus-compatible metrics. Target configuration controls which LMC root the exporter discovers, subscribes to, and renders during a scrape.
This article explains how to configure:
- single-target scraping
- preloaded multi-target scraping
- HTTP query routing with
server_key,app, andinstance
Use TOML configuration with --config for most deployments. A legacy flat target file is also supported for minimal multi-target setups.
Prerequisites
Before configuring targets, ensure that:
lmc_exporterhas been built successfully.- The target LMC shared-memory roots are visible from the host running the exporter.
- You know the shared-memory
server_keyvalues for the targets you want to scrape. - You know the application metric mapping to use, such as
ads,adh, orats. - A valid
license_fileis configured for normal startup. - HTTP scraping is enabled if Prometheus or
curlwill scrape the exporter.
A minimal HTTP-enabled configuration requires:
metrics_http_enabled = true
metrics_bind_address = "0.0.0.0"
metrics_port = 9464
metrics_path = "/metrics"
How It Works
At startup, lmc_exporter creates a shared-memory server pool, discovers visible root handles, selects a matching root, subscribes to the target subtree, and renders metrics after the tracked objects and variables are ready.
The selected target is determined from:
| Configuration value | Purpose |
|---|---|
server_key or server_keys | Identifies the shared-memory server key used to discover a target root. |
app | Selects the application-specific metric mapping set, such as ads, adh, or ats. |
instance | Optional root-selection hint. It can be a full resolved root id or the instance_no segment when roots follow hostname.instance_no.application naming. |
variable | Optional descendant variable path to highlight. |
classes | Optional app-specific class aliases that limit subscribed and rendered metrics. |
seed_path_groups | Optional named app-specific filter groups that limit subscription and rendered metrics. |
seed_paths | Optional raw seed-path prefixes that limit subscription and rendered metrics. |
When instance is omitted, the exporter resolves the selected root instance from the configured server_key at runtime.
Configuration Modes
Use single-target mode when one exporter process should scrape one logical target selection from the top-level TOML values.
Single-target mode is active when the TOML file has no [[targets]] entries.
context_id = "shmApp"
pool_name = "pool"
app = "ads"
server_keys = ["82"]
metrics_http_enabled = true
metrics_bind_address = "0.0.0.0"
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"Run the exporter:
lmc_exporter --config ./lmcExporterConfig.tomlScrape the target:
curl "http://127.0.0.1:9464/metrics?server_key=82"Use preloaded multi-target mode when one exporter process should serve multiple scrape targets.
Multi-target mode is active when the TOML file contains one or more [[targets]] tables.
context_id = "shmApp"
pool_name = "pool"
metrics_http_enabled = true
metrics_bind_address = "0.0.0.0"
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"
[[targets]]
app = "ads"
server_key = "82"
[[targets]]
app = "ads"
server_key = "456"
[[targets]]
app = "adh"
server_key = "999"Run the exporter:
lmc_exporter --config ./lmcExporterConfig.tomlScrape a specific target by server_key:
curl "http://127.0.0.1:9464/metrics?server_key=82"Use the legacy flat target format only when you need a minimal target-only registry.
Create targets.conf:
target app=ads server_key=82
target app=ads server_key=456Run the exporter with HTTP scraping enabled:
lmc_exporter --targets-config ./targets.conf --enable-metrics-http --metrics-port 9464Scrape a target:
curl "http://127.0.0.1:9464/metrics?server_key=82"Single-Target Scraping
Single-target mode uses the top-level target values in the TOML file.
Use this mode when:
- one exporter process maps to one primary application target
- the target can be selected from
server_keys - you do not need preloaded
[[targets]]entries
Minimal Single-Target Configuration
context_id = "shmApp"
pool_name = "pool"
app = "ads"
server_keys = ["82"]
metrics_interval_seconds = 10
metrics_http_enabled = true
metrics_bind_address = "0.0.0.0"
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"
Add an Instance Hint
Use instance when multiple roots may be visible and you want to guide root selection.
app = "ads"
instance = "1"
server_keys = ["82"]
You can also use the full resolved root id:
app = "ads"
instance = "phoads01.1.ads"
server_keys = ["82"]
Limit the Target Scope
Use classes, seed_path_groups, or seed_paths to reduce the subscribed subtree and rendered metrics.
app = "ads"
server_keys = ["82"]
classes = ["ManagedProcess.SinkDist", "WSOCKServer"]
seed_path_groups = ["core", "sink_ripc"]
seed_paths = ["serviceGenerator.srcPrdServicePool"]
For ADS, the core group includes root-scoped variables.
Run Single-Target Mode from CLI
You can also configure a single target with CLI flags:
lmc_exporter --app ads --server-key 82 --enable-metrics-http --metrics-port 9464
With an instance hint:
lmc_exporter --app ads --instance phoads01.1.ads --server-key 82 --enable-metrics-http --metrics-port 9464
Multi-Target Scraping
Preloaded multi-target mode uses repeated [[targets]] tables. Each table defines one scrape target.
Each [[targets]] table supports:
| Key | Required | Description |
|---|---|---|
app | Yes | Application metric mapping set for the target. |
server_key | Yes | Shared-memory server key for the target. |
instance | No | Optional root-selection hint. |
variable | No | Optional descendant variable path to highlight. |
classes | No | Optional app-specific class aliases. |
seed_path_groups | No | Optional app-specific filter groups. |
seed_paths | No | Optional raw seed-path prefixes. |
Multi-Target TOML Example
context_id = "shmApp"
pool_name = "pool"
metrics_http_enabled = true
metrics_bind_address = "0.0.0.0"
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"
[[targets]]
app = "ads"
instance = "1"
server_key = "82"
classes = ["ManagedProcess.SinkDist", "ConsumerDataStream"]
seed_path_groups = ["core", "users"]
[[targets]]
app = "ads"
instance = "1"
server_key = "456"
classes = ["SSLDispatcher", "ManagedSSLChannel"]
seed_paths = ["sourceApplicationPool"]
[[targets]]
app = "adh"
server_key = "999"
seed_path_groups = [
"consumer_mqos_service_service",
"mqos_service_attributes",
"mqos_service_datastreams"
]
Query Routing
When multiple targets are configured, the HTTP endpoint uses query parameters to select which target to render.
The default metrics path is /metrics.
Route by server_key
Use server_key when you know the shared-memory server key for the target.
/metrics?server_key=82
Example:
curl "http://127.0.0.1:9464/metrics?server_key=82"
This is the clearest routing method for multi-target deployments.
Route by app and instance
Use app and instance when you want to route by the resolved root identity after discovery.
/metrics?app=ads&instance=phoads01.1.ads
Example:
curl "http://127.0.0.1:9464/metrics?app=ads&instance=phoads01.1.ads"
Disambiguate duplicate app and instance targets
If more than one target shares the same app and instance, add server_key.
/metrics?app=ads&instance=phoads01.1.ads&server_key=82
Example:
curl "http://127.0.0.1:9464/metrics?app=ads&instance=phoads01.1.ads&server_key=82"
Metric Scopes with Target Routing
Metric scopes expose named subsets of the rendered Prometheus output. They are configured with repeated [[metric_scopes]] tables.
[[metric_scopes]]
name = "client_threads"
metrics = [
"ads_client_session_thread_*"
]
[[metric_scopes]]
name = "process_health"
metrics = [
"ads_managed_process_sink_dist_state",
"ads_managed_process_sink_dist_process_id",
"ads_shmem_mo_server_stats_num_clients"
]
A scope can be selected as a path segment:
/metrics/client_threads?server_key=82
Or as a query parameter:
/metrics?scope=client_threads&server_key=82
When multiple targets are configured, target routing is still required with scoped endpoints.
curl "http://127.0.0.1:9464/metrics/process_health?server_key=82"
If a scoped endpoint is requested without enough target routing information in multi-target mode, the request fails with:
scope selected, but target routing still required when multiple targets are configured.
CLI Override Behavior
TOML values are loaded first. CLI flags override TOML values afterwards.
Common overrides include:
| CLI flag | Effect |
|---|---|
--metrics-port 9564 | Overrides metrics_port. |
--debug | Enables debug logging even if debug = false in TOML. |
--instance ... | Switches to single-target mode and clears TOML [[targets]]. |
--server-key ... | Switches to single-target mode and clears TOML [[targets]]. |
--targets-config ... | Uses the legacy flat target file instead of TOML targets. |
Examples
Single ADS Target
context_id = "shmApp"
pool_name = "pool"
app = "ads"
server_keys = ["82"]
metrics_http_enabled = true
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"
Run:
lmc_exporter --config ./lmcExporterConfig.toml
Scrape:
curl "http://127.0.0.1:9464/metrics?server_key=82"
Multiple ADS Targets
metrics_http_enabled = true
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"
[[targets]]
app = "ads"
server_key = "82"
[[targets]]
app = "ads"
server_key = "456"
Scrape each target separately:
curl "http://127.0.0.1:9464/metrics?server_key=82"
curl "http://127.0.0.1:9464/metrics?server_key=456"
Multiple Applications
metrics_http_enabled = true
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"
[[targets]]
app = "ads"
server_key = "82"
[[targets]]
app = "adh"
server_key = "999"
Scrape by server_key:
curl "http://127.0.0.1:9464/metrics?server_key=82"
curl "http://127.0.0.1:9464/metrics?server_key=999"
Scoped Multi-Target Scrape
metrics_http_enabled = true
metrics_port = 9464
metrics_path = "/metrics"
license_file = "./scratch/example.lic"
[[metric_scopes]]
name = "process_health"
metrics = [
"ads_managed_process_sink_dist_state",
"ads_managed_process_sink_dist_process_id",
"ads_shmem_mo_server_stats_num_clients"
]
[[targets]]
app = "ads"
server_key = "82"
[[targets]]
app = "ads"
server_key = "456"
Scrape the scoped output for one target:
curl "http://127.0.0.1:9464/metrics/process_health?server_key=82"
Equivalent query-parameter form:
curl "http://127.0.0.1:9464/metrics?scope=process_health&server_key=82"