Conversation
🦋 Changeset detectedLatest commit: 9baea6d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| Stats.initRemoteMetrics( | ||
| legacySettings.metrics ?? { host: options.metricsEndpoint } | ||
| ) |
There was a problem hiding this comment.
What happens if Stats.initRemoteMetrics receives { host: undefined } ? Given that we were always sending the legacySettings.metrics object which looks like could be either full or undefined.
I'm also curious if we need this coalescing here as just above we're already overriding it.
| /** | ||
| * Allows you to change the metrics endpoint used | ||
| */ | ||
| metricsEndpoint?: string |
There was a problem hiding this comment.
Can you provide some background about the impetus / use case for a new setting (maybe link to the issue / description is OK)? (I saw an issue around this, but I figured we would just default to the overridden apiHost / protocol.)
i.e.
integrations: {
'Segment.io': {
// assume https://MY-CUSTOM-API-PROXY.com/v1/m proxies to
// https://api.segment.io/v1/m
apiHost: 'MY-CUSTOM-API-PROXY.com/v1',
protocol: 'https' // optional
}
(forgive me if I am missing something silly)
There was a problem hiding this comment.
No that makes sense! Updated to default to that value and to respect protocol if set
Allows users to set a custom metrics endpoint when loading Analytics. Tested locally by setting a custom endpoint and confirming it was used.
yarn changeset. Read about changesets here).