% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}

\usepackage[colorlinks]{hyperref}
\usepackage
 %[debug=showtargets]% requires glossaries.sty v4.32
 {glossaries-extra}

%\renewcommand*{\glsshowtarget}[1]{\texttt{\small [#1]}}

\makeglossaries

\newglossaryentry{sample}{name={sample},description={an example}}

\renewcommand{\thesection}{S.\arabic{section}}
\renewcommand{\theHsection}{\thepart.\thesection}

\begin{document}
\part{Sample Part}
\section{Sample Section}

\part{Another Part}
\section{Another Section}
\gls[counter=section]{sample}.

\printglossaries
\end{document}
