Skip to content

Commit 79e1b63

Browse files
committed
fmt
1 parent b3cef72 commit 79e1b63

File tree

4 files changed

+21
-163
lines changed

4 files changed

+21
-163
lines changed

genkit-tools/telemetry-server/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ export async function startTelemetryServer(params: {
108108
logger.error(`Error processing OTLP payload: ${err}`);
109109
response.status(500).json({
110110
code: 13, // INTERNAL
111-
message: 'An internal error occurred while processing the OTLP payload.',
111+
message:
112+
'An internal error occurred while processing the OTLP payload.',
112113
});
113114
}
114115
});

genkit-tools/telemetry-server/src/utils/otlp.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
import { SpanData, TraceData } from './trace';
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { SpanData, TraceData } from '@genkit-ai/tools-common';
218

319
// These interfaces are based on the OTLP JSON format.
420
// A full definition can be found at:
@@ -61,10 +77,7 @@ function toMillis(nano: string): number {
6177
return Math.round(parseInt(nano) / 1_000_000);
6278
}
6379

64-
function toSpanData(
65-
span: OtlpSpan,
66-
scope: OtlpScopeSpan['scope']
67-
): SpanData {
80+
function toSpanData(span: OtlpSpan, scope: OtlpScopeSpan['scope']): SpanData {
6881
const attributes: Record<string, any> = {};
6982
span.attributes.forEach((attr) => {
7083
if (attr.value.stringValue) {

genkit-tools/telemetry-server/src/utils/trace.ts

Lines changed: 0 additions & 156 deletions
This file was deleted.

genkit-tools/telemetry-server/tests/file_store_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ import getPort from 'get-port';
2020
import { afterEach, beforeEach, describe, it } from 'node:test';
2121
import os from 'os';
2222
import path from 'path';
23+
import { Index } from '../src/file-trace-store';
2324
import {
2425
LocalFileTraceStore,
2526
startTelemetryServer,
2627
stopTelemetryApi,
2728
} from '../src/index';
28-
import { Index } from '../src/file-trace-store';
2929
import { sleep, span } from './utils';
3030

3131
const TRACE_ID = '1234';

0 commit comments

Comments
 (0)