Fit sidewaysfigure to page width including caption and source

As far as I can tell, you haven't provided any information yet about the natural size of the image (or of its natural height to width ratio), the dimensions of the textblock, or even of the document class you use. It's thus not possible to give very specific advice.

All I can think of suggesting is to set the image's width to \textwidth and its height to something like 0.7\textheight; see the screenshot below. Depending on the natural size of the image, you will probably have to adjust the factor 0.7; it may also be useful to set the option keepaspectratio.

enter image description here

\documentclass{report}
\usepackage{caption}
\captionsetup{justification=raggedright,
               singlelinecheck=false}
\usepackage{rotating}
\usepackage[showframe]{geometry}
\begin{document}    

\begin{sidewaysfigure}
   \caption{The caption}
   \label{fig:diagramm_hs}
   \includegraphics[width=\textwidth,
                    height=0.7\textheight,
                    %keepaspectratio  % may need to uncomment this option
                   ]{example-image-a}

   Quelle: The source
\end{sidewaysfigure}
\end{document}

First, the original \textwidth is lost using sidewaysfigure. Second, I needed to test if the total figure was too big. Finally, I needed the image height using [width=\textwidth] in order to determine what [height=] should be to compensate.

I tested \listoffigures to make sure only one caption showed up.

\documentclass{article}
\usepackage{showframe}
\usepackage[Export]{adjustbox}
\usepackage{rotating}
\usepackage{caption}
\captionsetup{justification=raggedright,
               singlelinecheck=false}

\newcommand{\source}[1]{\ttfamily #1}

\newsavebox{\tempbox}
\newlength{\tempdima}
\newlength{\tempdimb}
\newlength{\tempdimc}

\begin{document}
  \tempdima=\textwidth% inside \textwidth=\linewidth=\textheight
  \begin{sidewaysfigure}
  \textheight=\tempdima
  \settoheight{\tempdimb}{\includegraphics[width=\textwidth]{example-image-a}}% default height
  \savebox{\tempbox}{\begin{minipage}{\textwidth}
    \caption{The caption}
    \addtocounter{figure}{-1}% reset
    \rule{\textwidth}{\tempdimb}% same size but faster
    \par\source{The source}
    \end{minipage}}%
  \tempdima=\ht\tempbox\relax% can't get \dimexpr to work
  \advance\tempdima by \dp\tempbox\relax
  \tempdimc=\tempdimb
  \ifdim\textheight<\tempdima
    \advance\tempdimb by \textheight
    \advance\tempdimb by -\tempdima
  \fi
  \tempdima=\dimexpr \tempdimb*\textwidth/\tempdimc\relax% compute scaled width
  \hfil\begin{minipage}{\tempdima}
  \caption{The caption}
  \includegraphics[width=\textwidth]{example-image-a}\par
  \source{The source}
  \end{minipage}
  \end{sidewaysfigure}
\end{document}

full page with frames