Skip to content
Tags & Metadata
step 1/5

Reading — step 1 of 5

Read

~1 min readService Registry

Tags & Metadata

Real services have metadata: version, region, datacenter, environment, capabilities.

{
  "service": "billing",
  "id": "i-1",
  "addr": "10.0.1.45:8080",
  "tags": ["v2", "production", "us-east-1"],
  "metadata": {"region": "us-east-1", "version": "2.4.1"}
}

Discovery queries can filter:

  • service=billing tags=production → only production instances
  • service=billing tags=v2,canary → canary deployment instances
  • service=billing region=us-east-1 → same region

Useful for:

  • Blue/green deploys: route traffic to new version by tag
  • Canary releases: small % of traffic to v2 tag
  • A/B testing: tag-based variant routing
  • Region-aware routing: prefer same region for latency

Consul has tags + service-meta. Kubernetes has labels (and label selectors). Eureka has metadata maps.

Common patterns:

  • version tag: change as you deploy
  • tier tag: free / pro / enterprise instances
  • feature tag: experimental capabilities
  • health tag: managed by health checks

Be careful with metadata:

  • Lots of unique tag combinations = expensive lookups
  • Stale metadata is worse than no metadata
  • Don't use as a config store (use a real KV)

Discussion

Ask a question, share an insight, or help someone who’s stuck.

Sign in to post a comment or reply.

Loading…