Thank you for the image.
This insect is an Ichneumonid Wasp. It is considered a beneficial insect as it kills certain boring insects of trees.
The long object extending from the end of the abdomen is an egg-laying device, not a stinger. It is used to penetrated wood and insert an egg into a tree-boring larva (youngster). It doesn't attack people or their pets.