Gateway Licensing
Overview
LMC Exporter 0.18.x supports two licensing modes:
| Mode | Configuration | Behavior |
|---|---|---|
| Local file | license_mode = "local_file" | Validates the configured license_file. This is the default. |
| Gateway | license_mode = "gateway" | Acquires and renews a Gateway lease for the complete configured workload. |
In Gateway mode, the exporter must receive the full requested entitlement before it creates the LMC shared-memory pool, starts workers, or opens the HTTP listener. license_file is not used in this mode.
Gateway mode is qualified for Enterprise Linux 8 and 9 on x86_64. Local-file licensing retains the wider exporter platform support.
Basic Configuration
This example uses one HTTPS Gateway with mutual TLS and two exporter targets:
license_mode = "gateway"
gateway_endpoints = ["https://gateway.example:8443"]
gateway_auth_mode = "mtls"
gateway_tls_ca_file = "/etc/lmc-exporter/gateway-ca.pem"
gateway_tls_cert_file = "/etc/lmc-exporter/client.pem"
gateway_tls_key_file = "/etc/lmc-exporter/client-key.pem"
gateway_state_directory = "/var/lib/lmc-exporter"
[[targets]]
app = "ads"
server_key = "82"
component_instance_id = "ads-primary"
[[targets]]
app = "adh"
server_key = "999"
component_instance_id = "adh-primary"
Gateway settings can appear at the TOML root or in [settings]. CLI options override TOML values. CLI names replace underscores with hyphens; for example, gateway_request_timeout_ms becomes --gateway-request-timeout-ms.
Gateway Settings
| Key | Default | Description |
|---|---|---|
license_mode | "local_file" | Use local_file or gateway. |
gateway_endpoints | [] | One or two distinct Gateway URLs with the same http or https scheme. Repeat --gateway-endpoint on the CLI. |
gateway_auth_mode | "none" | Authentication profile: none, bearer, or mtls. |
gateway_bearer_token_file | "" | Bearer token file, required only for bearer authentication. |
gateway_tls_ca_file | "" | Optional CA bundle for HTTPS. System trust is used when omitted. |
gateway_tls_cert_file | "" | Client certificate and intermediate chain, required for mTLS. |
gateway_tls_key_file | "" | Matching unencrypted private key, required for mTLS. |
gateway_state_directory | "" | Required absolute path for the persisted installation identity. |
gateway_connect_timeout_ms | 2000 | Connection timeout from 1 to 60000; cannot exceed the request timeout. |
gateway_request_timeout_ms | 5000 | Per-endpoint request timeout from 1 to 60000. |
gateway_startup_timeout_ms | 30000 | Total acquisition budget from 1 to 300000. |
gateway_retry_max_attempts | 3 | Retry rounds from 1 to 10; each round can try both endpoints. |
gateway_retry_base_delay_ms | 100 | Initial retry delay from 1 to 60000. |
gateway_retry_max_delay_ms | 2000 | Maximum retry delay from 1 to 60000. |
gateway_renew_base_delay_ms | 1000 | Initial renewal retry delay from 1 to 60000. |
gateway_renew_max_delay_ms | 30000 | Maximum renewal retry delay from 1 to 60000. |
gateway_release_timeout_ms | 5000 | Total shutdown and release budget from 1 to 30000. |
gateway_requested_ttl_seconds | 0 | Requested lease lifetime; 0 uses the Gateway default. The returned expiry remains authoritative. |
Supported authentication profiles are HTTP with none or bearer, and HTTPS with none or mtls. A bearer token must not be placed directly on the command line; configure the token file instead. Credential files are loaded at startup, so rotation requires a restart.
Component Identities and Entitlement Counts
Every selected target needs a component_instance_id in Gateway mode. This value identifies the licensed component and is separate from the target’s discovery instance selector.
Component IDs are case-sensitive, contain 1–128 ASCII characters, and must match [A-Za-z0-9][A-Za-z0-9._:-]{0,127}. Supported application names are adh, ads, ats, and rtc.
The exporter requests one unit for each distinct (app, component_instance_id) pair:
- Aliases that represent the same component can share an ID and count as one unit.
- Different component instances must use different IDs.
- Configured targets count even when their source is temporarily unavailable.
- The same ID used by different application types counts once for each application.
For a single global server_key, set component_instance_id. For multiple global keys, provide IDs in the same order:
app = "ads"
server_keys = ["82", "456"]
component_instance_ids = ["ads-primary", "ads-secondary"]
On the CLI, repeat --server-key and --component-instance-id in corresponding order. Embedded [[targets]] entries require their own component_instance_id; do not combine target-level IDs with the global ID settings.
Persisted Installation Identity
gateway_state_directory stores a generated installation UUID in installation-id. The exporter reuses this identity after restarts so Gateway can reconcile the installation and its workload.
Prepare the directory as follows:
- Use an absolute path owned by the exporter service account.
- Set directory permissions to
0700. - Place it on a local persistent filesystem that supports file locking, atomic publication, and
fsync. - Give each installation its own directory. Do not copy or share an installation identity between hosts.
The exporter creates installation-id with mode 0600 and holds installation-id.lock for its lifetime. A second process using the same state directory fails to start. Unsafe permissions, symlinks, malformed identity data, or storage and lock failures also block startup; the exporter does not replace an invalid identity automatically.
Lease and Shutdown Behavior
After acquisition, the exporter renews the lease in the background. Temporary renewal failures do not interrupt collection while the existing lease remains valid.
If the lease expires or Gateway establishes entitlement loss, the exporter permanently closes collection and output admission and exits with status 1. A later response cannot reopen the process. On a normal SIGINT or SIGTERM, the exporter stops output and attempts to release a valid lease within gateway_release_timeout_ms.
The exporter does not send a release after entitlement loss or lease expiry, including when the lease expires while shutdown threads are joining. A valid release is bounded by both the configured cleanup budget and the lease’s remaining lifetime.
Gateway failover and retries preserve the logical request across configured endpoints. All endpoint URLs must use the same scheme. Gateway access remains an online requirement; the persisted installation ID is not an offline lease.
Security Guidance
- Bearer token and private-key files must be regular files owned by the service user or root, with no group or other permissions. Modes
0400and0600are suitable. - Use TLS 1.2 or later for HTTPS deployments.
- Configure
gateway_tls_ca_filewhen the system trust store does not contain the deployment CA. - Do not include credentials, query strings, or fragments in Gateway endpoint URLs.
- Restart the exporter after changing credentials, endpoints, targets, or entitlement quantities.