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

[APM] APM client for supertest #84969

Closed
sorenlouv opened this issue Dec 3, 2020 · 2 comments
Closed

[APM] APM client for supertest #84969

sorenlouv opened this issue Dec 3, 2020 · 2 comments
Labels
Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture

Comments

@sorenlouv
Copy link
Member

Related to: #83429 (comment)

Similar to how we have a API client that type checks parameters, and adds return types to responses, we should have a client that wraps supertest.

Example:

const res = await apmSupertest({
 endpoint: 'GET /api/apm/services/opbeans-java/overview_transaction_groups',
 query: {
   start,
   end,
   uiFilters: '{}',
   size: 5,
   numBuckets: 20,
   pageIndex: 0,
   sortDirection: 'desc',
   sortField: 'impact',
 },
})

In the above case res should have the correct return type. All parameters supplied should also be type checked.

I think that would provide an awesome DX - especially when editing a test to accommodate an API change

@sorenlouv sorenlouv added [zube]: Inbox Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture labels Dec 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@sorenlouv
Copy link
Member Author

This is already implement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:APM All issues that need APM UI Team support technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

2 participants