The story so far (Wikipedia) [wikipedia.org]:
On January 1st 2008, the German Paliament passed a law that any communications data had to be retained for six months. On 2 March 2010, the Federal Constitutional Court of Germany ruled the law unconstitutional as a violation of the guarantee of the secrecy of correspondence.
Today (2015-10-16), Deutsche Welle reports [dw.com]:
The German parliament on Friday agreed to reintroduce a revised law to collect and retain information about phone calls and Internet use.
While 404 lawmakers voted in favor of the legislation, 148 voted against.
Chancellor Angela Merkel has said a law allowing retention would be necessary to detect terrorists should Germany be attacked. The data would be stored by providers, and investigators would have to ask a judge for access to it.
In detail [dw.com], this means
[...] the retention of key phone "metadata." This includes the number called and call duration as well as Internet Provider (IP) addresses, but not data on emails, nor recordings of phone calls.
A caller's location details are to be deleted after four weeks; the remaining call details after 10 weeks.
Investigators wanting access to an individual's metadata must get a judge's consent and the person traced must be notified.
[...]
Access would be banned on calls involving pastoral counselors, lawyers, medical doctors, pharmacists, journalists and social or church providers offering anonymous counseling services.
Condemnation came promptly, however, from parliament's opposition Greens and Left parties as well as data privacy advocates and media representatives, who said retention could still expose informants acting in the public interest.
Police had wanted data log files kept for up to two years, for example, to trace a suspected terrorist's contacts.