mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 19:52:02 +00:00
Add support for HTTP OpenTelemetry exporters (#6357)
This commit is contained in:
parent
4896c7739f
commit
d57cc0b930
10 changed files with 301 additions and 34 deletions
|
|
@ -81,6 +81,7 @@ export interface TelemetrySettings {
|
|||
enabled?: boolean;
|
||||
target?: TelemetryTarget;
|
||||
otlpEndpoint?: string;
|
||||
otlpProtocol?: 'grpc' | 'http';
|
||||
logPrompts?: boolean;
|
||||
outfile?: string;
|
||||
}
|
||||
|
|
@ -292,6 +293,7 @@ export class Config {
|
|||
enabled: params.telemetry?.enabled ?? false,
|
||||
target: params.telemetry?.target ?? DEFAULT_TELEMETRY_TARGET,
|
||||
otlpEndpoint: params.telemetry?.otlpEndpoint ?? DEFAULT_OTLP_ENDPOINT,
|
||||
otlpProtocol: params.telemetry?.otlpProtocol,
|
||||
logPrompts: params.telemetry?.logPrompts ?? true,
|
||||
outfile: params.telemetry?.outfile,
|
||||
};
|
||||
|
|
@ -564,6 +566,10 @@ export class Config {
|
|||
return this.telemetrySettings.otlpEndpoint ?? DEFAULT_OTLP_ENDPOINT;
|
||||
}
|
||||
|
||||
getTelemetryOtlpProtocol(): 'grpc' | 'http' {
|
||||
return this.telemetrySettings.otlpProtocol ?? 'grpc';
|
||||
}
|
||||
|
||||
getTelemetryTarget(): TelemetryTarget {
|
||||
return this.telemetrySettings.target ?? DEFAULT_TELEMETRY_TARGET;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue