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

refactor: remove built in payload truncation logic #498

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

watson
Copy link
Contributor

@watson watson commented Aug 6, 2018

Changes for intake API v2.

Depends on elastic/apm-nodejs-http-client#8

This will instead be handled by the elastic-apm-http-client module when the above PR have been merged.

@@ -37,7 +37,7 @@ test('extract URL from request', function (t) {
t.equal(request.url.search, '?foo=bar')
t.equal(request.url.raw, '/captureError?foo=bar')
t.equal(request.url.hostname, 'localhost')
t.equal(request.url.port, String(server.info.port))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 Previously, the act of truncating this property would convert it to a string. Now that truncation isn't part of this module any more, it's a number. But that's technically not a legal type for this property according to the intake API JSON spec:

https://github.com/elastic/apm-server/blob/27acff4c0ba45efdbbe20de3ca403d3b5c481416/docs/spec/request.json#L78-L82

Should the JSON spec allow for a number here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we even truncate ports? They can't ever be longer than 5 digits. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When implementing the truncation logic, I just went over all strings that had a limit on them and added the truncation.

Using a filter the user can overwrite it with anything they want. You could argue though that if they did the server JSON schema validation would just reject it, so it might not be that important.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In related news, I realized the other day that process.title cannot be more than 16 bytes on Linux

@watson
Copy link
Contributor Author

watson commented Aug 6, 2018

The CI failures are because of the npm bug with the github link in the dependencies

This will instead be handled by the elastic-apm-http-client module in
the future.
@watson watson merged commit c000df1 into elastic:api-v2 Aug 9, 2018
@watson watson deleted the truncate branch August 9, 2018 22:10
watson added a commit that referenced this pull request Aug 10, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit that referenced this pull request Aug 29, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
Qard pushed a commit to Qard/apm-agent-nodejs that referenced this pull request Aug 30, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit that referenced this pull request Aug 30, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit that referenced this pull request Sep 6, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit that referenced this pull request Sep 13, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit that referenced this pull request Oct 19, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit to watson/apm-agent-nodejs that referenced this pull request Oct 27, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
Qard pushed a commit that referenced this pull request Oct 31, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit to watson/apm-agent-nodejs that referenced this pull request Nov 6, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit that referenced this pull request Nov 6, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
Qard pushed a commit that referenced this pull request Nov 8, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit that referenced this pull request Nov 10, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit to watson/apm-agent-nodejs that referenced this pull request Nov 13, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit to watson/apm-agent-nodejs that referenced this pull request Nov 13, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
watson added a commit to watson/apm-agent-nodejs that referenced this pull request Nov 13, 2018
This will instead be handled by the elastic-apm-http-client module in
the future.
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.

2 participants