Sign in
agent:
Auto Exec

List all my services in jaeger excludes system related services

There was a problem that the LLM was not able to address. Please rephrase your prompt and try again.

Fetches and lists all services available in Jaeger using the services API endpoint

Exclude system/non-application services from Jaeger analysis.

These create false positives or represent infrastructure traffic.

Skip all traces where process.serviceName matches:

-- jaeger-all-in-one (internal Jaeger backend)

-- flagd (long-lived feature flag streams) (false latency)

-- load-generator (synthetic load traffic)

-- "ad"# optional: often noisy / not core to checkout

-- "recommendation"# optional: can inherit external/flagd delays

--"fraud-detection" # optional: can inherit external/flagd delays

import requests import json from datetime import datetime # --- Config / Environment --- jaeger_base = getEnvVar('JAEGER_URL_OTEL') # provided by your env if not jaeger_base: raise RuntimeError("Missing env var JAEGER_URL_OTEL") # Normalize base URL (allow with/without trailing slash) if not jaeger_base.endswith('/'): jaeger_base += '/' services_url = f"{jaeger_base}services" # Exclusions: infra, synthetic traffic, and known-noisy services EXCLUDED = { "jaeger-all-in-one", # Jaeger backend itself "flagd", # long-lived event streams cause misleading latency "load-generator", # synthetic traffic "ad", # optional: often noisy / not core to checkout "recommendation", # optional: can inherit external/flagd delays "fraud-detection" } result = { "time_queried": datetime.utcnow().isoformat() + "Z", "jaeger_services_endpoint": services_url, "total_services_found": 0, "excluded_services_requested": sorted(list(EXCLUDED)), "excluded_services_present": [], "services_included": [], "service_count": 0 } try: resp = requests.get(services_url, timeout=6) resp.raise_for_status() data = resp.json() # Jaeger API returns {"data": ["svc1","svc2",...]} ; fall back to raw list if needed raw_services = data.get("data", data if isinstance(data, list) else []) raw_services = [s for s in raw_services if isinstance(s, str)] result["total_services_found"] = len(raw_services) # Which excluded are actually present present_excluded = sorted([s for s in raw_services if s in EXCLUDED]) result["excluded_services_present"] = present_excluded # Apply filter filtered = [s for s in raw_services if s not in EXCLUDED] result["services_included"] = filtered result["service_count"] = len(filtered) service_count = len(filtered) target_services = filtered except requests.exceptions.RequestException as e: result["error"] = f"Error connecting to Jaeger: {e}" result["services_included"] = [] result["service_count"] = 0 except Exception as e: result["error"] = f"Error processing Jaeger response: {e}" result["services_included"] = [] result["service_count"] = 0 # Print JSON for the job runner to capture as outputs print(json.dumps(result, indent=2))
copied