A bit of context
When the implementation of the browser SDK started the instrumentations in this repository were only using the logs API and SDK. So including anything related to traces was just making the package to grow with unused code.
To address that combineSdks was made. The idea behind the function was to have in the package only what is required (logs SDK) but let the users to append other components/SDKs if they need it by providing a function with a specific signature. One use case was to be able to add other signals like traces or metrics.
After some discussions in the SIG about porting the instrumentations from opentelemetry-js and opentelemetry-js-contrib repos it was agreed that fetch and XHR instrumentations will also send Spans. The SDK package included the traces signal in its PR.
The combineSdks function is used internally to merge both start{logs,traces}Sdk functions but is not exported. So at the moment users cannot benefit from it. If they want to add, for example, an SDK for metrics they have to do their own "combine" logic.
So. Should we export the function for the users to make things easier or would that complicate things? I guess the options are
- keep it internal
- remove it. that logic can be moved to
startBrowserSdk
- expose it so user can
import { combineSdks } from '@opentelemetry/browser-sdk';
import { startLogsSdk } from '@opentelemetry/browser-sdk/logs';
import { startTracesSdk } from '@opentelemetry/browser-sdk/traces';
const sdkWithMetrics = combineSdks({
logs: startLogsSdk,
traces: startTracesSdk,
metrics: function startMyMetrics (config) {
// return a WebSdk object
},
});
A bit of context
When the implementation of the browser SDK started the instrumentations in this repository were only using the logs API and SDK. So including anything related to traces was just making the package to grow with unused code.
To address that
combineSdkswas made. The idea behind the function was to have in the package only what is required (logs SDK) but let the users to append other components/SDKs if they need it by providing a function with a specific signature. One use case was to be able to add other signals like traces or metrics.After some discussions in the SIG about porting the instrumentations from opentelemetry-js and opentelemetry-js-contrib repos it was agreed that fetch and XHR instrumentations will also send Spans. The SDK package included the traces signal in its PR.
The
combineSdksfunction is used internally to merge bothstart{logs,traces}Sdkfunctions but is not exported. So at the moment users cannot benefit from it. If they want to add, for example, an SDK for metrics they have to do their own "combine" logic.So. Should we export the function for the users to make things easier or would that complicate things? I guess the options are
startBrowserSdk