Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add status endpoint to list the available endpoints #938

Merged
merged 6 commits into from
Sep 13, 2021

Conversation

zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Sep 7, 2021

Here we include an /admin endpoint that will print all the available endpoints and the regex that will route to the endpoint.

+------------------------------------------+------------------------------------------------+
| NAME                                     | REGEX                                          |
+------------------------------------------+------------------------------------------------+
| /api/echo                                | ^/api/echo$                                    |
| /api/search                              | ^/api/search$                                  |
| /api/search/tag/{tagName}/values         | ^/api/search/tag/(?P<v0>[^/]+)/values$         |
| /api/search/tags                         | ^/api/search/tags$                             |
| /api/traces/{traceID}                    | ^/api/traces/(?P<v0>[^/]+)$                    |
| /config                                  | ^/config$                                      |
| /debug/pprof                             | ^/debug/pprof                                  |
| /flush                                   | ^/flush$                                       |
| /ingester/ring                           | ^/ingester/ring$                               |
| /memberlist                              | ^/memberlist$                                  |
| /metrics                                 | ^/metrics$                                     |
| /querier/api/search                      | ^/querier/api/search$                          |
| /querier/api/search/tag/{tagName}/values | ^/querier/api/search/tag/(?P<v0>[^/]+)/values$ |
| /querier/api/search/tags                 | ^/querier/api/search/tags$                     |
| /querier/api/traces/{traceID}            | ^/querier/api/traces/(?P<v0>[^/]+)$            |
| /ready                                   | ^/ready$                                       |
| /services                                | ^/services$                                    |
| /shutdown                                | ^/shutdown$                                    |
| /status                                  | ^/status$                                      |
+------------------------------------------+------------------------------------------------+

API documentation: https://grafana.com/docs/tempo/latest/api_docs/

Which issue(s) this PR fixes:
Fixes #632

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Contributor

@annanay25 annanay25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

Even though I feel the addition of api docs (https://grafana.com/docs/tempo/latest/api_docs/) has depreciated this endpoint, its still nice to have. Some nits:

  • Can we add a "table header"? It might be confusing to just see the regex
  • Can we add a line at the end pointing to the api docs for further info?

@joe-elliott
Copy link
Member

Should we call this /admin when all it does is print out http endpoints? I feel like we should consolidate here. Perhaps /services and this functionality could be combined into /status or /info and we could continue fleshing it out with info about the running process.

Possibly even support some basic arguments (otherwise dump everything):
/status?config
/status?runtime_config
/status?services
/status?endpoints

@zalegrala
Copy link
Contributor Author

Great suggestions, thanks for the review. Do we want a table printed here, or something machine consumable. I feel like if I were to call something on /status I might expect JSON. We could still keep a docs link in the payload too But if we're looking for something that folks can reference with eyeballs easier, then perhaps just a table.

@zalegrala zalegrala force-pushed the adminEndpoint branch 3 times, most recently from 06cb79f to 5108e27 Compare September 10, 2021 17:47
@zalegrala
Copy link
Contributor Author

I've made some updates here and set us up to add more query params later on a /status endpoint, and the data is now written as a table.

@zalegrala
Copy link
Contributor Author

I'll update the docs page too.

@zalegrala zalegrala changed the title Implement /admin endpoint to list the available endpoints Implement /status endpoint to list the available endpoints Sep 10, 2021
Copy link
Contributor

@achatterjee-grafana achatterjee-grafana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added doc review.

docs/tempo/website/api_docs/_index.md Outdated Show resolved Hide resolved
docs/tempo/website/api_docs/_index.md Outdated Show resolved Hide resolved
docs/tempo/website/api_docs/_index.md Outdated Show resolved Hide resolved
docs/tempo/website/api_docs/_index.md Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@zalegrala zalegrala changed the title Implement /status endpoint to list the available endpoints Add status endpoint to list the available endpoints Sep 10, 2021
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
@joe-elliott joe-elliott merged commit e235c26 into grafana:main Sep 13, 2021
@zalegrala zalegrala deleted the adminEndpoint branch September 13, 2021 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List and reorganise Tempo HTTP API
4 participants