MCPcopy
hub / github.com/promptfoo/promptfoo / encodeOTLPRequest

Function encodeOTLPRequest

test/tracing/protobuf.test.ts:43–53  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

41}
42
43async function encodeOTLPRequest(data: any): Promise<Buffer> {
44 const root = await getProtoRoot();
45 if (!ExportTraceServiceRequest) {
46 ExportTraceServiceRequest = root.lookupType(
47 'opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest',
48 );
49 }
50 const message = ExportTraceServiceRequest.create(data);
51 const encoded = ExportTraceServiceRequest.encode(message).finish();
52 return Buffer.from(encoded);
53}
54
55describe('Protobuf decoding', () => {
56 beforeAll(async () => {

Callers 1

protobuf.test.tsFile · 0.70

Calls 3

getProtoRootFunction · 0.70
createMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…