Effect CommunityEC
Effect Community12mo ago
3 replies
Stephen Bluck

Troubleshooting OTEL Telemetry Data Not Sending with Effect

We are not getting any telemetry data sent. Using standard JS and curl to the OTEL endpoint works but with Effect it doesn't right now. Does this look ok or am I doing something wrong?

const AppLayer = Layer.mergeAll(
  NodeFileSystem.layer,
  Path.layer,
  Logger.pretty,
  NodeSdk.layer(() => ({
    resource: {
      serviceName: config.value.serviceName,
      attributes: { "service.environment": config.value.serviceEnv },
    },
    spanProcessor: new BatchSpanProcessor(
      new OTLPTraceExporter({ url: config.value.otlpEndpoint }),
    ),
    metricReader: new PeriodicExportingMetricReader({
      exporter: new OTLPMetricExporter({ url: config.value.otlpEndpoint }),
    }),
  })),
)
export const AppRuntime = ManagedRuntime.make(AppLayer)

Switching to the console exporters correctly logs the data but when using the above we get nothing and I have no clue how to debug it.
Was this page helpful?