Bird
0
0

You want to add a new feature to collect metrics from multiple microservices without changing their code. How can the Sidecar pattern help?

hard📝 Trade-off Q8 of 15
Microservices - Advanced Patterns
You want to add a new feature to collect metrics from multiple microservices without changing their code. How can the Sidecar pattern help?
AUse a Sidecar that merges all microservices into one
BRewrite each microservice to include metrics collection code
CDeploy a centralized metrics collector that replaces all microservices
DDeploy a Sidecar alongside each microservice to collect and export metrics independently
Step-by-Step Solution
Solution:
  1. Step 1: Understand Sidecar for metrics

    Sidecars can be added alongside services to collect metrics without modifying service code.
  2. Step 2: Evaluate options

    Rewriting code or replacing services is costly. Merging services breaks microservices principles.
  3. Final Answer:

    Deploy a Sidecar alongside each microservice to collect and export metrics independently -> Option D
  4. Quick Check:

    Sidecar for metrics = Independent collection without code change [OK]
Quick Trick: Sidecar collects metrics without touching service code [OK]
Common Mistakes:
  • Thinking rewriting services is needed
  • Assuming centralized collector replaces services
  • Believing Sidecar merges services

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes