-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add telemetry to HTTP requests #23
Conversation
@@ -4,9 +4,18 @@ const url = require('url'); | |||
const urlJoin = require('url-join'); | |||
const pkg = require('../package.json'); | |||
|
|||
const telemetryHeader = { | |||
name: 'express-oidc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shortened the name a bit but still recognizable.
custom.setHttpOptionsDefaults({ | ||
headers: { | ||
'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})` | ||
'User-Agent': `${pkg.name}/${pkg.version}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a good user agent? I removed the homepage, seems like unnecessary data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshcanhelp Do you care about Node version or possibly the OS?
If not, package name and version is probably enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node version is sent in the env
object. We don't parse the user agent (at this point) for telemetry.
before(async function() { | ||
client = await getClient(config); | ||
|
||
nock('https://flosser.auth0.com') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nock was the best way I could think of/find for getting the options being used. They are not (understandably) exposed outside of the library.
Description
Add a telemetry header to HTTP requests.
Testing
Checklist