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

Schema change for /endpoint_metrics response #2068

Closed
letmaik opened this issue Jan 12, 2021 · 0 comments · Fixed by #2116
Closed

Schema change for /endpoint_metrics response #2068

letmaik opened this issue Jan 12, 2021 · 0 comments · Fixed by #2116

Comments

@letmaik
Copy link
Member

letmaik commented Jan 12, 2021

(Requested by @msftsettiy)

The /endpoint_metrics endpoint currently has a response schema that is inspired by the structure of OpenAPI documents using two nested dictionaries for URL paths and methods:

{
  "metrics": 
  {
    "/foo":
    {
      "GET":
      {
        "calls": 123,
        "errors": 1,
        "failures": 5
      }
    }
  }
}

The following schema is more consistent with the rest of the API, makes schema evolution easier, and makes code of consuming clients more readable (e.g. path and method are now named concepts) and easier to write (self-contained objects with full context, path and method):

{
  "metrics": 
  [
      {
        "path": "/foo",
        "method": "GET",
        "calls": 123,
        "errors": 1,
        "failures": 5
      }
  ]
}

The only downside is that it is not immediately clear anymore that "path" and "method" are the keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant