fix telemetry export signals
This commit is contained in:
@@ -173,10 +173,10 @@ async function registerProviders(signalConfig: SignalConfig): Promise<void> {
|
||||
const exporter = new OTLPLogExporter();
|
||||
logProvider = new LoggerProvider({
|
||||
resource,
|
||||
processors: [new BatchLogRecordProcessor(exporter)],
|
||||
processors: [new BatchLogRecordProcessor({ exporter })],
|
||||
});
|
||||
logs.setGlobalLoggerProvider(logProvider);
|
||||
otelLogger = logs.getLogger("@oh-my-pi/pi-coding-agent");
|
||||
otelLogger = logProvider.getLogger("@oh-my-pi/pi-coding-agent");
|
||||
unregisterLogSink = logger.registerLogSink(event => {
|
||||
emitOtelLog(
|
||||
event.level,
|
||||
|
||||
@@ -105,7 +105,7 @@ const server = Bun.serve({
|
||||
port: 0,
|
||||
async fetch(req) {
|
||||
const path = new URL(req.url).pathname;
|
||||
if (req.method === "POST" && req.headers.get("content-type") === "application/x-protobuf") {
|
||||
if (req.method === "POST" && req.headers.get("content-type")?.startsWith("application/x-protobuf")) {
|
||||
const body = await req.arrayBuffer();
|
||||
if (path.endsWith("/v1/metrics")) metricPayloads.push(new Uint8Array(body));
|
||||
if (body.byteLength > 0) {
|
||||
|
||||
Reference in New Issue
Block a user