LogFlux Service Discovery

Service Discovery

LogFlux provides automatic service discovery so SDKs and agents can connect to the correct regional endpoints without manual URL configuration.

How It Works

Region-Prefixed Keys

When you create an API key or Personal Access Token (PAT) through the LogFlux dashboard, the key includes a region prefix based on your account’s data residency setting:

Data ResidencyAPI Key FormatPAT Format
EUeu-lf_abc123...eu-lf_usr_abc123...
USus-lf_abc123...us-lf_usr_abc123...
CAca-lf_abc123...ca-lf_usr_abc123...
AUau-lf_abc123...au-lf_usr_abc123...
APap-lf_abc123...ap-lf_usr_abc123...

The region prefix tells SDKs and agents which regional endpoints to use. API Keys (lf_) are used by agents and SDKs for log ingestion, while PATs (lf_usr_) are used by CLI tools and Grafana for log queries. See Authentication Setup for details on when to use each.

Legacy keys without a region prefix continue to work — they use the authenticated discovery fallback.

Static Discovery Endpoints

Each region has a static, unauthenticated discovery endpoint:

RegionDiscovery URL
EU (Frankfurt)https://discover.eu.logflux.io
US (Virginia)https://discover.us.logflux.io
CA (Montreal)https://discover.ca.logflux.io
AU (Sydney)https://discover.au.logflux.io
AP (Singapore)https://discover.ap.logflux.io

These endpoints return a JSON response with the regional service URLs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "version": "1.1",
  "region": "eu",
  "endpoints": {
    "backend_url": "https://api.inspect.eu.logflux.io",
    "ingestor_url": "https://api.ingest.eu.logflux.io",
    "stream_url": "https://api.stream.eu.logflux.io",
    "dashboard_url": "https://dashboard.logflux.io"
  },
  "updated_at": "2026-03-15T00:00:00Z"
}

Discovery Flow

When an SDK initializes with a region-prefixed key:

  1. Extract region from the key prefix (e.g., eu from eu-lf_abc123...)
  2. Fetch static discovery from https://discover.{region}.logflux.io
  3. Connect to the returned regional endpoints
  4. Fall back to authenticated discovery via the API Service if static discovery is unavailable

For legacy keys without a region prefix, SDKs use the authenticated discovery endpoint directly.

SDK Configuration

With region-prefixed keys, you typically only need to provide the key — no server URL required:

Go SDK

1
2
3
4
config := &logflux.Config{
    APIKey: os.Getenv("LOGFLUX_PAT"),
    // ServerURL is auto-discovered from the key's region prefix
}

Environment Variables

1
2
3
4
5
# Region-prefixed token — endpoints auto-discovered
export LOGFLUX_PAT="eu-lf_usr_your_token_here"

# Optional: override auto-discovery with explicit URL
export LOGFLUX_SERVER_URL="https://api.ingest.eu.logflux.io"

Data Residency

The region prefix on your keys corresponds to your account’s data residency setting. This determines where your log data is stored and processed:

RegionData LocationCompliance
EUFrankfurt, GermanyGDPR
USVirginia, USASOC 2
CAMontreal, CanadaPIPEDA
AUSydney, AustraliaPrivacy Act
APSingaporePDPA

You can set your data residency when creating your account or by contacting support.

Backward Compatibility

  • Legacy keys (without region prefix) continue to work with all LogFlux services
  • Region prefix is metadata only — it does not affect key validation or HMAC computation
  • No migration required — existing keys and configurations remain functional

Troubleshooting

Verify Discovery

1
2
3
4
5
6
# Test static discovery for your region
curl https://discover.eu.logflux.io

# Check your token's region
echo $LOGFLUX_PAT | cut -d'-' -f1
# Should output: eu, us, ca, au, or ap

Common Issues

  • No region prefix: Legacy token — set LOGFLUX_SERVER_URL explicitly or create a new token
  • Wrong region: Create a new token after updating your data residency setting
  • Discovery timeout: Check firewall rules for outbound HTTPS to *.logflux.io:443