Directory shared with the Prometheus Adapter container 

Prometheus exporter image, exporting on port 9889 

Path to the same log file to which the main application is logging to 

Shared volume is also mounted in the Adapter  container 

Files are shared via an emptyDir  volume from the node’s filesystem 

Another use of this pattern is logging. Different containers may log information in different formats and level of detail. An Adapter  can normalize that information, clean it up, enrich it with contextual information by using the Self Awareness  pattern described in Chapter 13, and then make it available for pickup by the centralized log aggregator. 

## Discussion 

The Adapter  is a specialization of the Sidecar  pattern explained in Chapter 15. It acts as a reverse proxy to a heterogeneous system by hiding its complexity behind a uni‐ fied interface. Using a distinct name different from the generic Sidecar  pattern allows us to more precisely communicate the purpose of this pattern. 

In the next chapter, you’ll get to know another Sidecar  variation: the Ambassador  pat‐ tern, which acts as a proxy to the outside world. 

## More Information 

• Adapter Example 

• The Distributed System Toolkit: Container Patterns for Modular Distributed Sys‐ tem Design 

