How Pernod Ricard uses Grafana and Loki to scale and monitor its global e-commerce business
Pernod Ricard is the toast of the wine and spirits industry, with a comprehensive portfolio that includes brands such as Jameson, Absolut Vodka, and Havana Club.
While the $53 billion company has thrived on traditional distribution channels such as restaurants, clubs, stores, and duty-free shops, Pernod Ricard has recently focused on growing its direct-to-consumer (D2C) e-commerce business. And it’s no surprise why: In 2019, e-commerce accounted for 14% of their business, and it’s expected to grow to more than 22% by 2023.
The COVID-19 pandemic has only accelerated those projections. Between March and mid-April 2020, U.S. sales alone jumped more than 234%. With the exponential growth in consumers looking online for cocktails and supplies for their homestead bars “we need to be there and we need to be there fast,” said Pernod Ricard Digital Commerce IT Manager Tony Khosravi.
How did they scale their e-commerce platforms quickly and efficiently? The Pernod Ricard team uncorked the details in their GrafanaCONline 2021 session titled “Monitoring global e-commerce Magento sites with Grafana and Loki.”
To keep up with the global demand, Pernod Ricard focused on building a solid consumer-centric platform that not only fosters profitability, but also provides great customer service 24-7 because “that’s the core of our business,” said Khosravi.
The D2C infrastructure also needed to be replicable and scalable so that more than 80 affiliates around the world could bootstrap within minutes and scale up on demand — especially during major campaigns such as Black Friday.
Yet, the developers needed the autonomy to handle issues with advanced tooling. “We need to give them the ability to deploy whenever they want, no matter the availability of our DevOps team,” said Khosravi. “They need to be able to debug at any time as well.”
The solution was an e-commerce framework built with Magento as well as custom in-house modules for interacting with external services that developers can then mix and match to form their own website “blend” that’s tailored to their needs. The infrastructure is deployed on AWS over four different regions, containerized and orchestrated with ECS, and uses Grafana and Loki for monitoring and logging. (Want to get started on your own journey with Grafana and Loki? Sign up for Grafana Cloud for free.)
The stack, which is referred to as E-commerce Factory, is provided to all Pernod Ricard affiliates as a service that reduces the time to market. “Every website that we deploy comes with ‘batteries included.’ It has all of the integration that we need to call all the APIs but also everything that’s needed so you have a clear overview of how the site is functioning,” said Pernod Ricard IT Solutions Architect Hakim Rouatbi. “It allows us to deploy new websites at the push of a button.”
To date, there are more than 30 e-commerce sites around the world. “The complexity and number of stores is growing very, very fast,” said Rouatbi. “In the last few weeks, we had four new websites ready for production.”
To oversee the aggressive growth and ensure a high-quality customer experience across all affiliate sites, the team needed to monitor the whole stack, access all of the logs, as well as have the ability to export logs to development teams, some of which don’t have access to AWS and many of whom have different dev backgrounds.
“We needed to establish a common ground with the 24x7 team,” said Rouatbi. “We needed to speak the same language regarding logging and monitoring with them, so we can pinpoint an issue that can arise and understand each other very quickly.”
In the end, they adopted Cloudwatch, Container Insights, and Loki with all the data centralized in Grafana.
Rouatbi demonstrated how the effective monitoring stack has produced Grafana dashboards that provide an overview of database-related metrics (above) as well as an in-depth look at ECS clusters.
Pernod Ricard Head of IT Architecture & Innovation Laurent Bel then walked through how they solved the need to send Cloudfront logs in real-time to Loki by developing a custom component to transport data directly from Kinesis to Loki. He then showcased how a Grafana dashboard provided a detailed look at log data to diagnose the source of increasing Cloudfront errors.
Loki is also used for monitoring the ECS container logs. (For a detailed tutorial of how to send logs from Amazon’s ECS to Loki, check out this helpful guide by Grafanista Cyril Tovena.)
“As a result, our developers can easily access application logs from Grafana,” said Bel. “If there’s any problem on dev staging or production environments, we can give [developers] access to logs and identify the issue. It’s completely self-service.”
Overall, “Grafana and Loki have been helpful in having identical stacks making it easier to maintain a scalable infrastructure to support business growth,” said Bel. From a technical perspective, “we have completely harmonized metrics across all sides and the data is accessible to anyone in the company which helps in troubleshooting.”
Most importantly, one of the main characteristics that the Pernod Ricard team valued about Grafana Labs is “we like the company’s mindset,” said Bel, “and we are inspired by the open source spirit.”
Learn more about how Pernod Ricard deploys Grafana and Loki to scale its e-commerce business by watching the full session here. All of the GrafanaCONline 2021 sessions are now available on demand.