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

feat: generate User-Agent for transport per APM spec #2402

Merged
merged 2 commits into from
Oct 29, 2021
Merged

Conversation

trentm
Copy link
Member

@trentm trentm commented Oct 28, 2021

https://github.com/elastic/apm/blob/master/specs/agents/transport.md#user-agent
This adds serviceName and serviceVersion to the User-Agent.

Closes: #2364

Checklist

  • Implement code
  • Add tests
  • Add CHANGELOG.asciidoc entry
  • Commit message follows commit guidelines

@trentm trentm requested a review from astorm October 28, 2021 21:16
@trentm trentm self-assigned this Oct 28, 2021
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Oct 28, 2021
@trentm
Copy link
Member Author

trentm commented Oct 28, 2021

elastic/apm-nodejs-http-client#169 was the related PR for the http-client (for v10.2.0).

@trentm
Copy link
Member Author

trentm commented Oct 28, 2021

BTW, if serviceVersion was not sanitized and non-ISO-8859-1 chars (or really, non-8-bit chars, or really chars that don't match node's internal const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; used for header value validation, then requests to APM server would error out with:

TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["User-Agent"]

@apmmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-10-28T21:16:55.064+0000

  • Duration: 20 min 15 sec

  • Commit: f4d93a2

Test stats 🧪

Test Results
Failed 0
Passed 22
Skipped 0
Total 22

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run module tests for <modules> : Run TAV tests for one or more modules, where <modules> can be either a comma separated list of modules (e.g. memcached,redis) or the string literal ALL to test all modules

  • run benchmark tests : Run the benchmark test only.

@trentm trentm merged commit 052e396 into master Oct 29, 2021
@trentm trentm deleted the trentm/user-agent branch October 29, 2021 16:03
astorm pushed a commit that referenced this pull request Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[META 527] User-agent header for transport
3 participants