Effect CommunityEC
Effect Community13mo ago
13 replies
canastro

Debug @effect/opentelemetry NodeSdk

I have tracing working correctly with Tempo locally, but for some reason is not publishing the traces in my staging environment (hosted in railway.app).

Any tips on how I can enable some logs or in any way get some useful insights int what might be happening?


This is my configuration:

export const makeTracing = (config: TracingConfig) =>
  pipe(
    Config.string('OTEL_EXPORTER_OTLP_ENDPOINT'),
    Effect.map((endpoint) =>
      NodeSdk.layer(() => ({
        resource: { serviceName: config.serviceName },
        spanProcessor: new BatchSpanProcessor(
          new OTLPTraceExporter({ url: `http://${endpoint}/v1/traces` }),
        ),
        instrumentations: [getNodeAutoInstrumentations()],
        metricReader: new PeriodicExportingMetricReader({
          exporter: new OTLPMetricExporter({
            url: `http://${endpoint}/v1/metrics`,
          }),
          exportIntervalMillis: 5000,
        }),
      })),
    ),
    Layer.unwrapEffect,
  );
Was this page helpful?