Package com.github.copilot.sdk.json
Class TelemetryConfig
java.lang.Object
com.github.copilot.sdk.json.TelemetryConfig
OpenTelemetry configuration for the Copilot CLI server.
When set on CopilotClientOptions.setTelemetry(TelemetryConfig), the
CLI server is started with OpenTelemetry instrumentation enabled using the
provided settings.
Example Usage
var options = new CopilotClientOptions()
.setTelemetry(new TelemetryConfig().setOtlpEndpoint("http://localhost:4318").setSourceName("my-app"));
- Since:
- 1.2.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets whether to capture message content as part of telemetry.Gets the exporter type.Gets the file path for the file exporter.Gets the OTLP exporter endpoint URL.Gets the source name for telemetry spans.setCaptureContent(Boolean captureContent) Sets whether to capture message content as part of telemetry.setExporterType(String exporterType) Sets the exporter type.setFilePath(String filePath) Sets the file path for the file exporter.setOtlpEndpoint(String otlpEndpoint) Sets the OTLP exporter endpoint URL.setSourceName(String sourceName) Sets the source name for telemetry spans.
-
Constructor Details
-
TelemetryConfig
public TelemetryConfig()
-
-
Method Details
-
getOtlpEndpoint
Gets the OTLP exporter endpoint URL.Maps to the
OTEL_EXPORTER_OTLP_ENDPOINTenvironment variable.- Returns:
- the OTLP endpoint URL, or
null
-
setOtlpEndpoint
Sets the OTLP exporter endpoint URL.- Parameters:
otlpEndpoint- the endpoint URL (e.g.,"http://localhost:4318")- Returns:
- this config for method chaining
-
getFilePath
Gets the file path for the file exporter.Maps to the
COPILOT_OTEL_FILE_EXPORTER_PATHenvironment variable.- Returns:
- the file path, or
null
-
setFilePath
Sets the file path for the file exporter.- Parameters:
filePath- the path where telemetry spans are written- Returns:
- this config for method chaining
-
getExporterType
Gets the exporter type.Maps to the
COPILOT_OTEL_EXPORTER_TYPEenvironment variable.- Returns:
- the exporter type (e.g.,
"otlp-http"or"file"), ornull
-
setExporterType
Sets the exporter type.- Parameters:
exporterType- the exporter type ("otlp-http"or"file")- Returns:
- this config for method chaining
-
getSourceName
Gets the source name for telemetry spans.Maps to the
COPILOT_OTEL_SOURCE_NAMEenvironment variable.- Returns:
- the source name, or
null
-
setSourceName
Sets the source name for telemetry spans.- Parameters:
sourceName- a name identifying the application producing the spans- Returns:
- this config for method chaining
-
getCaptureContent
Gets whether to capture message content as part of telemetry.Maps to the
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTenvironment variable.- Returns:
trueto capture content,falseto suppress it, ornullto use the default
-
setCaptureContent
Sets whether to capture message content as part of telemetry.- Parameters:
captureContent-trueto capture content,falseto suppress it- Returns:
- this config for method chaining
-