Let $S$ be the spectrum of $\mathbf{Z}$ or the spectrum of an algebraically closed field. (Actually, one can take $S$ to be any noetherian integral regular scheme.)


Let $f:X\longrightarrow Y$ be a finite morphism of integral normal projective flat $S$-schemes which is etale above the complement of $B$, where $B\subset Y$ is a closed subscheme of codimension $1$. Suppose that $Y$ is regular. 


**Example.** You could take $f$ to be a finite surjective morphism of normal surfaces such that $Y$ is nonsingular.


Since $Y$ is regular, we have a canonical sheaf $\omega\_{Y/S}$. Let $s$ be a nonzero rational section of $\omega\_{Y/S}$.  

Define the cycle $K\_{X/S} := \mathrm{div}(s)$. Note that $K\_{X/S}$ is a canonical divisor.


Let $f^\ast s$ be the induced nonzero rational section of the line bundle $f^\ast \omega\_{Y/S}$ on $X$ and consider the Weil divisor $\mathrm{div}(f^\ast s)$ on $Y$.


Outside $f^{-1}(B)$, we have that $\mathrm{div}(f^\ast s)$ is the pull-back of $K\_{Y/S}$. Therefore, there is a Weil divisor $R\_f$, supported on $f^{-1}(B)$, such that $\mathrm{div}(f^\ast s) = f^\ast K\_{Y/S} + R\_f$. 


**Question 1.** How are the coefficients of $R\_f$ defined?


**Question 2.** Is the Weil divisor $\mathrm{div}(f^\ast s)$ a canonical divisor outside the singular locus of $X$?


**Question 3.** Is $R\_f$ independent of $s$?


Note that I work with cycles and not with classes up to linear equivalence.



Ramification divisor associated to a cover of a regular scheme
Your hypothesis imply that $\omega\_{Y/S}$ is an invertible sheaf (because $Y\to S$ is locally complete intersection).


(**EDIT**) As $f$ is flat at points of codimension $1$ ($Y$ is normal) and we are only interested on codimension 1 cycles, we can restrict $Y$ and suppose that $f$ is flat.


Then the dualizing sheaf $\omega\_{X/Y}$ is invertible and you have the adjunction formula
$$\omega\_{X/S}=f^\*\omega\_{Y/S} \otimes\omega\_{X/Y}.$$
The sheaf $\omega\_{X/Y}$ is trivial outside of $B$ because $f$ is étale outside of $B$. It can be identified with the sheaf $\mathcal{Hom}\_{O\_Y}(f\_{\*}O\_{X}, O\_{Y})$.


Write $\omega\_{X/Y}=O\_X(D)$ for some Cartier divisor $D$ on $X$. Its support is contained in $f^{-1}(B)$. For any point $\eta$ of $X$ over a generic point $\xi$ of $B$, the stalk of $\omega\_{X/Y}$ at $\eta$ is given by the different ideal of the extension of discrete valuation rings $O\_{X,\eta}/O\_{Y, \xi}$. The valuation of the different is known to be the ramification index $e\_{\eta/\xi}$ minus $1$ when the ramification is tame and bigger or equal to $e\_{\eta/\xi}$ otherwise (see Serre: Local fields). So the support of $D$ is equal to $f^{-1}(B)$ and is the ramification locus by definition.


In short, the coefficient of $R\_f=D$ at the Zariski closure of $\eta$ is the valuation of the different ideal of $O\_{X,\eta}/O\_{Y, \xi}$. As for the computation, you can pass to the completions.
A finite extension of complete DVR $R'/R$ is monogenous if the residue extension ($k(\eta)/k(\xi)$ in your case) is separable. If $R'=R[\theta]$, and $P(T)\in R[T]$ is the minimal polynomial of $\theta$, then the different ideal is generated by $P'(\theta)$. See Serre's book for more details.


