The best way to ensure the survival of the German Empire in the long term would be to effectively avoid World War I as we know it, but that will require one or more points of divergence, probably before 1871 to do something with the intricate system of alliances between European nations that led the nations to the First World War.
Another point of divergence something more reasonable would be to make the UK formally accept the idea of an Anglo-German alliance, something that the Kaiser Whilhem II apparently was desperately looking for in agreement with many of the commentators who have already written here.
This hypothetical Anglo-German Alliance would be somewhat fearsome, respectable and almost untouchable for the other European powers, unless somehow or other France offers or makes some kind of "alliance / pact" to Austria-Hungary, although I am not sure how likely or absurd would be something like this if we take into account the decades we are talking about ...
The most plausible option to guarantee the survival of the German Empire until today would be one that some others have already written here:
Do not invade neutral Belgium.
Only with that, there will no longer be any Causus Belli for the British Empire to join the Great War, and they would maintain the position of No-intervention for several (and vital for the Central Powers) months more.
All that Germany would have had to do was to adopt a purely defensive stance against France and that the Central Powers concentrate all the capacity of their advanced Military Industrial Complex to behead the Russian Empire and thus conquer that great portion of their European territories and thus use their resources and conquered labor force to fuel their war machine in an imminent complete offensive against France.
On the other hand, by not forcing the way through Belgium, it would prevent the British media from painting the German Empire and the Central Powers as the aggressors of the War, and this will allow both Berlin and Vienna to persuade Italy (even a member of the Central Powers by treaty) to join their war effort making Russia and Serbia seem like the real cause of the war, although Austria-Hungary would have to make certain territorial concessions to Italy in exchange for its entry into the Great War on the side of the Central Powers.
If Italy enters the side of the Central Powers, then the Mediterranean would no longer be a "Lake Entente" and the Italian Navy, along with the Austrian-Hungarian Navy could tie much of the naval assets of France in the Mediterranean, including if the French had numerical superiority in warships.
In addition, Italy could try raids in French territory although the Italian army was mediocre (as was shown in Our Time Line) when attacking, it was more or less decent when defending its territory from enemy incursions.
This could divide the French war effort between its border with Germany and its border with Italy, and therefore wear it out even more than what is worn out in Our Time Line. With Italy fighting with the Central Powers and with the entry of the British (and therefore of the Japanese) delayed half a year or a whole year, the Imperial Russia will fall / sue for peace sometime in the first or second quarter 1916 to more to take, in the middle of 1916. Now would be the moment where Germany and allies would have concentrated all their military might in crushing France. If this happens more or less as I see it, for the sake of diplomatic realism, here or a little earlier it would be where the United Kingdom would probably enter the Great War on the side of the Entente, only to see that Russia was almost defeated, it could not be saved, they will only enter to prevent France from being completely destroyed.
Now, recapitulating if the United Kingdom does not join the war to see that Russia is technically destroyed by the Central Powers, then everything will be finished by 1917, the Central Powers will impose a peace of the type-Verasalles or worse to the France and they will see part of their territory occupied by the victorious powers for some years.
Now, if for some reason, the United Kingdom enters the war on the side of the Triple Understanding, there is not really much that they are capable of doing, other than delaying the end of the war one or even two more years, because in at this moment Germany and the Central Powers would be to proofs of blockades with Belarus, Baltic states, Poland and Ukraine and their conquered resources of Russia under their control.
The best thing that can happen to Germany here is that Austria-Hungary, even if it is on the winning side of the war, ends up imploding sooner or later due to internal ethnic tensions, which will allow the German Empire to annex German Austria to the German Empire, therefore gaining access to the Adriatic and other 7 million additional people who would pass to be part of the German empire, but also Slovakians, Czechs and ethnic Italians would be added to the population of the Empire. It would have been interesting to see what the German authorities had done with these ethnically non-German regions such as Czech Bohemia and parts of the Italian South Tyrol ...
The final guarantee of long-term survival for the German Empire would be that a victorious Central Powers also intervene the Russian Civil War on the side of the White Army, to prevent the atheist and antimonarchist Bolsheviks from seizing power and creating a potential threat in the East. the German sphere of influence in Eastern Europe. If this also happens after everything described above, then the Victory Central Powers would have their own hegemonic block in Continental Europe that could to a certain degree completely avoid a Second World War, at least on European soil, even if this defeated France succumbed to Facism or to Bolshevik Communism, since they would not dare to try to attack Germany without allies.
With all of the above, it is perhaps the most plausible scenario to guarantee the survival of the German Empire until today.