Thick smoke and flames could be seen rising up from the refinery at around 11:45 a.m. It was deemed a Level 2 out of three on the community warning system scale.
Businesses are located across the street from the refinery and people said they saw the black smoke and knew something was wrong.
Tesoro said later on Tuesday afternoon the warning level was down to zero and the health advisory has been lifted.
"There was a lot of it. Normally it's kind of narrow. This time it was a pool of black smoke just going up," said Renae Stapleton, a witness.
A refinery spokeswoman says the plant lost its primary steam generation unit, which basically means it lost power. The flaring had to be done to release pressure and because the smoke was blowing offsite. Contra Costa County Health officials issued an advisory, recommending that people stay indoors.
The Bay Area Air Quality Management District sent investigators to the scene.
"It's pretty windy out here. It's dissipated quite well. Will there be a fine? Perhaps, but investigators will get to the bottom of it," said Mark Ross of the Bay Area Quality Management District.
Tesoro says no one was hurt and they do not expect any adverse health effects. But the incident was enough to worry people who work nearby.
"It makes you question what's safe and what is deemed safe," Stapleton said.
The flaring is over, but the refinery is still working to fully restore operations.
Public Health Advisory for Martinez, Pacheco, North Concord and Clyde(50) (https://t.co/eyxYXfjkhP)— Contra Costa CWS (@CoCoCWS) December 15, 2015
The Public Health Advisory for Martinez, Pacheco, North Concord and Clyde has been lifted by CCHS.— Contra Costa CWS (@CoCoCWS) December 15, 2015