It’s no secret that Brandon Brooks has struggled with anxiety the past few years. He has sought treatment and addressed the issue publicly. It was on full display Sunday when the Philadelphia Eagles offensive lineman had to leave the game in the first quarter because he was ill.

Brooks, 30, used Twitter on Monday to explain his absence from the 17-9 loss to the Seattle Seahawks, saying he was “NOT ashamed or embarrassed” for having a setback during an important game.

“I’d like to address what happened yesterday,” he tweeted. “I woke up and did my typical routine of morning vomiting. It didn’t go away like it normally does, but I figured it would calm down once I got to the stadium. It did, but I felt exhausted. The nausea came back and I tried to battle through it and went out for the first drive. The nausea and vomiting came back until I left the field and I tried everything I could to get back for my teammates but just wasn’t able to do it.

“Make no mistake, I’m NOT ashamed or embarrassed by this nor what I go through daily. I’ve had this under control for a couple of years and had a setback yesterday. The only thing I’m upset about is that when my team needed me, I wasn’t able to be out there with and for them. Lastly, I appreciate the support of my coaches, teammates and fans. It doesn’t go unnoticed.”

Brooks, who wasn’t made available to reporters after the game, missed two games because of panic attacks in 2016, when the “anxiety condition” that he had also experienced was diagnosed, he said. With treatment, he was able to become one of the NFL’s top guards and, two weeks ago, he signed a four-year, $56.2 million contract extension that made him the league’s highest-paid guard. The pressure to perform and the absence of fellow lineman Lane Johnson, out with a concussion, didn’t help him Sunday.

His anxiety, he explained in 2016, stems from an “unhealthy obsession” with football and the pursuit of perfection.

“I wanted to get to the bottom of what’s going on,” Brooks told reporters in 2016. “Basically, I found out recently that I have an anxiety condition. What I mean by anxiety condition [is] not nervousness or fear of the game.

“What it is that I have like an obsession with the game. It’s an unhealthy obsession right now and I’m working with team doctors to get everything straightened out and getting the help that I need and things like that.”

His problems manifested themselves in nausea and vomiting that he had always figured were related to a stomach ulcer. He said then that he takes two medications and had sought counseling.

“For me, it’s just I always want to be perfect in what I do, and if I’m not perfect it’s not good enough, and sometimes that just really weighs on you,” he said. “And I have to learn how to kind of chill out and understand it’s okay to make mistakes. It’s okay to not be perfect.”

Brooks described what he goes through on the day of a game. “What happens is, I wake up at 4 or 5 in the morning — not to be too graphic — but uncontrollable vomiting and there’s nothing the doctors can give me once it happens that stops it,” he said in 2016. “It goes for a full 24 hours. That’s what happens.”

Other present and former athletes, such as Michael Phelps, Clint Malarchuk, Kevin Love, Brandon Marshall, Steve Smith Sr. and Serena Williams, have, like Brooks, gone public with their personal stories to get people to talk about being mentally and physically healthy.

“You’ve got an issue or a problem, you’ve first got to admit it and accept it,” Brooks said in 2016. “I admit it, I accept it, I own it."

More sports coverage from The Post: