Closed willie closed 10 months ago
A cleaner way of initialization as an example:
const config: ResolveConfigFn = (env: Env, _trigger) => {
const exporterConfigs: OTLPExporterConfig[] = [
{
url: 'https://otlp.uptrace.dev/v1/traces',
headers: { 'uptrace-dsn': env.UPTRACE_DSN }
},
{
url: 'https://ingest.signoz.io/v1/traces',
headers: { 'signoz-access-token': env.SIGNOZ_ACCESS_TOKEN }
},
{
url: 'https://otlp.nr-data.net/v1/traces',
headers: { 'api-key': env.NR_API_KEY }
// },
// {
// url :'http://localhost:4318/v1/traces',
}
];
const exporters: SpanExporter[] = exporterConfigs.map(config => new OTLPExporter(config));
return {
exporter: new MultiSpanExporter(exporters),
service: { name: env.NR_SERVICE_NAME },
}
}
Includes an alternate MultiSpanExporterAsync implementation, which in local testing, seems to tickle some bugs in wrangler dev. Has no impact on how it works, but providing this as an alternate for now.
I use this in my code like so: