I’m working on a bunch of backend services and want to give our team an easy way to check service info without digging into Docker or Kubernetes. Some of our stuff runs on Docker Compose, not Kubernetes. I’m looking for a good way to share things like the service name, version, build date, and which branch and commit it’s from.
Is there a standard route or method for this? I’ve heard of the Server header, but I’m not sure if that’s the best option. Anyone know of an RFC or best practice for this kind of thing?
Basically, I want a simple REST endpoint that spits out all this info. Something like a /whoami
route that gives all the details about the service. Has anyone done something similar or know of a good approach?
I’m trying to make it easier for our devs to get this info quickly, especially for troubleshooting or when they need to know what version of a service is running. Any ideas or suggestions would be really helpful!
One effective approach I’ve implemented is creating a dedicated /info endpoint. This route can return a JSON object containing all the relevant service details you mentioned. We found it particularly useful to include fields like serviceName, version, buildTimestamp, gitBranch, and commitHash. To keep things secure, we ensured this endpoint was only accessible internally or through proper authentication. Additionally, we integrated this information with our logging system, which proved invaluable during debugging sessions. Remember to keep the response payload lightweight to avoid unnecessary overhead. This method has significantly streamlined our development and troubleshooting processes, allowing team members to quickly access crucial service information without delving into infrastructure details.
have u considered using a /status endpoint? it’s pretty straightforward and can give u all that info in one go. maybe even add some runtime stats? just make sure to secure it properly. oh, and u could use environment variables to inject the build details. wat do u think? any specific challenges you’re facing?
hey there growingTree! i’ve done smthing similar before. we used a /health endpoint that returned basic service info. it’s simple and works great. just make sure to not expose sensitive stuff. you could also consider using swagger for api docs, which can include some of that info too. hope this helps!