The metal part looks like a piece of scaffolding pipe, and the yellow part looks like a sleeve to put it over another piece of pipe. With the rounded end, it could be a safety piece for the end of some scaffolding or a fence, so that there's less chance of injury if someone walks into it.
I don't remember where I've seen one before, but I'm pretty sure it's the metal end that is inserted into another pipe, thereby making a visible yellow concrete end.
That's why I said a portion of one, I'm fairly sure that's the top six inches or so that got broken off. What's the bottom look like?
EDIT: A comment or above saying gate post might also very well be right. Whatever specifically, my guess stands on it being some kind of post of some sort.
Approximate size? It kind of looks like it might be the casing to a light explosive that you set off like a match stick. We call them 'strijkers' in the Netherlands. Only difference is the bigger underside there.
Roughly 6 inches or 15 cm. I thought it was an unexploded firework from a distance but it looks like it's made of steel and plastic. For context, it was (and still is afaik) laying on the edge of the parking lot of a dog park near a small airport.
I don't know where you are, but if your local PD has a slow line then you might try calling that and describe it to them. I say to use the slow line because it could be nothing and it's probably not an emergency as long as no one's fucking with it; but if there's a possibility that it might be explosive then someone should check it out.
I can't really see it being anything other than a casing of some sort. Considering the shape, size and materials it would have to be something pressurised, maybe a gas. This is not typically what nitrous tanks look like (the ones people are doing in traffic for a laugh oh my god what has happened to this world).
I've seen some applications of drugs but this does not look like any of them.
So as far as I can tell it's either going to be something to do with construction or it's something very specific to either dogs or aviation.
Edit: considering the car park, could it be like a shell one would put on the longer end of a spark plug? They usually come in boxes without cases or shells but maybe a very particular one has this as a protective cover and someone has been fiddling with their vehicle there?
Hmm, my first thought is that it's the end piece of a "concrete vibrator". Not typically used for sexual pleasure, but rather for consolidating fresh concrete while building.
Bit weird, though, that it's so comparatively short and has that yellow, wider section. That seems like it would have concrete stuck on it all the time...