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] Remove start and end from setupRequest #112828

Conversation

MiriamAparicio
Copy link
Contributor

Summary

Closes #103878

start and end are the only url params that not explicitly passed to the underlying handler.

What was done

  • Removed start and end from setupRequest
  • Get start and end params from the query
  • Fixed tests and types

@MiriamAparicio MiriamAparicio force-pushed the remove-start-end-params-from-setuprequest branch 3 times, most recently from 087ee96 to af57c6e Compare September 22, 2021 16:24
Comment on lines +33 to +36
const { apmEventClient } = setup;
const { serviceName, environment, transactionType, interval, start, end } =
alertParams;

Copy link
Member

Choose a reason for hiding this comment

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

minor thing but I noticed this elsewhere also: probably unintentional on your part but it's easier for a reviewer to understand the actual changes if lines are not re-ordered like here.

Comment on lines +13 to +15
start: number;
end: number;
value: number;
Copy link
Member

Choose a reason for hiding this comment

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

so much easier to read now 👍

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for doing this!

@MiriamAparicio MiriamAparicio force-pushed the remove-start-end-params-from-setuprequest branch from af57c6e to c93229d Compare September 27, 2021 06:44
Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

Looks good to me. Can be merged when the comments in get_transaction/index.ts are resolved.

@MiriamAparicio MiriamAparicio marked this pull request as ready for review September 27, 2021 08:16
@MiriamAparicio MiriamAparicio requested review from a team as code owners September 27, 2021 08:16
@MiriamAparicio MiriamAparicio added release_note:skip Skip the PR/issue when compiling release notes v7.16.0 auto-backport Deprecated - use backport:version if exact versions are needed labels Sep 27, 2021
@botelastic botelastic bot added Team:APM - DEPRECATED Use Team:obs-ux-infra_services. Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Sep 27, 2021
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@MiriamAparicio MiriamAparicio force-pushed the remove-start-end-params-from-setuprequest branch from 8b8e986 to 68d8065 Compare September 27, 2021 13:55
Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

UX changes LGTM. Smoke-tested on Edge as well.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
apm 30 31 +1

History

  • 💔 Build #155724 failed 8b8e986fac32d1dfa1767cb43d87876f1ead01e1
  • 💔 Build #155663 failed 3910c6bd6207e65e91b523dbf2c5fc8d5a7623fd
  • 💔 Build #155628 failed c93229d1084723d5e504204bd352493d580fb23c
  • 💔 Build #155037 failed af57c6e69de1a31de180b248bd8759b417680aab
  • 💔 Build #154985 failed 087ee96a1d6493dd0877c38011ed87dec12bc64c

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@@ -43,7 +43,7 @@ export const getQueryWithParams = ({ params, termFilters }: QueryParams) => {
getOrElse<t.Errors, { start: number; end: number }>((errors) => {
throw new Error(failure(errors).join('\n'));
})
) as Setup & SetupTimeRange;
) as Setup & { start: number; end: number };
Copy link
Member

Choose a reason for hiding this comment

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

This looks a bit odd. It looks like we are creating a fake setup object that actually only contains start and end.

Copy link
Member

@sorenlouv sorenlouv Sep 27, 2021

Choose a reason for hiding this comment

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

You should drop the explicit type annotations:

  // converts string based start/end to epochmillis
  const decodedRange = pipe(
    rangeRt.decode({ start, end }),
    getOrElse<t.Errors, { start: number; end: number }>((errors) => {
      throw new Error(failure(errors).join('\n'));
    })
  );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I saw the comments after merging. I can do a small PR to fix this 🙏

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@MiriamAparicio MiriamAparicio merged commit 7727bf4 into elastic:master Sep 28, 2021
@MiriamAparicio MiriamAparicio deleted the remove-start-end-params-from-setuprequest branch September 28, 2021 06:51
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 28, 2021
* [APM] Remove start and end from setupRequest

* fix some types

* fix some conflicts

* PR review comments

* fix typing
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Sep 28, 2021
* [APM] Remove start and end from setupRequest

* fix some types

* fix some conflicts

* PR review comments

* fix typing

Co-authored-by: Miriam <31922082+MiriamAparicio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:APM - DEPRECATED Use Team:obs-ux-infra_services. Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Remove start and end from setupRequest
5 participants