grafana / tempo

Grafana Tempo is a high volume, minimal dependency distributed tracing backend.
https://grafana.com/oss/tempo/
GNU Affero General Public License v3.0
3.76k stars 488 forks source link

Add semver version to api/status/buildinfo endpoint #3811

Open joey-grafana opened 1 week ago

joey-grafana commented 1 week ago

Is your feature request related to a problem? Please describe. isFeatureAvailable is used in the Tempo front end to check if features should be made available in the UI based on which version of Tempo is running.

The function above (in the link) returns something like “r154-0b3d297” but for semver to work it needs to be something like “2.5.1” This means that the function above always returns true so it is possible this would enable streaming in an environment where an old version of Tempo is being used.

Describe the solution you'd like To return a semver string from the api/status/buildinfo endpoint.

Having this semver string would also allow us to check if other features are available and cleans up the code/makes it more resilient on the frontend.

Describe alternatives you've considered Removing the function above and simply running a streaming query for example and if it fails then falling back to a non-streaming query.

Additional context Screenshot 2024-06-26 at 09 27 28 Screenshot 2024-06-26 at 09 27 32

joey-grafana commented 1 week ago

There was some discussion and initial improvements in this issue.

ishanjain28 commented 1 week ago

Hey @joey-grafana, Can you explain this a bit more please ?

version field in response comes from main.Version flag set when compiling the program. For normal releases, It's set to a semver value and the response is what you'd expect.

{"version":"2.5.0","revision":"46dad3411","branch":"HEAD","buildUser":"","buildDate":"","goVersion":"go1.21.3"}

If I understand correctly, With this PR, you always want a semver value here ?

joey-grafana commented 4 days ago

Hey this does not work correctly for cloud deployments as the versioning is slightly different. We are basing our check on there being a semver version present.

@fabrizio-grafana I know you worked on the feature initially so if you have any additional context please feel free to share.