Class TelemetryConfig

java.lang.Object
com.github.copilot.sdk.json.TelemetryConfig

public class TelemetryConfig extends Object
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 Details

    • TelemetryConfig

      public TelemetryConfig()
  • Method Details

    • getOtlpEndpoint

      public String getOtlpEndpoint()
      Gets the OTLP exporter endpoint URL.

      Maps to the OTEL_EXPORTER_OTLP_ENDPOINT environment variable.

      Returns:
      the OTLP endpoint URL, or null
    • setOtlpEndpoint

      public TelemetryConfig setOtlpEndpoint(String otlpEndpoint)
      Sets the OTLP exporter endpoint URL.
      Parameters:
      otlpEndpoint - the endpoint URL (e.g., "http://localhost:4318")
      Returns:
      this config for method chaining
    • getFilePath

      public String getFilePath()
      Gets the file path for the file exporter.

      Maps to the COPILOT_OTEL_FILE_EXPORTER_PATH environment variable.

      Returns:
      the file path, or null
    • setFilePath

      public TelemetryConfig setFilePath(String filePath)
      Sets the file path for the file exporter.
      Parameters:
      filePath - the path where telemetry spans are written
      Returns:
      this config for method chaining
    • getExporterType

      public String getExporterType()
      Gets the exporter type.

      Maps to the COPILOT_OTEL_EXPORTER_TYPE environment variable.

      Returns:
      the exporter type (e.g., "otlp-http" or "file"), or null
    • setExporterType

      public TelemetryConfig setExporterType(String exporterType)
      Sets the exporter type.
      Parameters:
      exporterType - the exporter type ("otlp-http" or "file")
      Returns:
      this config for method chaining
    • getSourceName

      public String getSourceName()
      Gets the source name for telemetry spans.

      Maps to the COPILOT_OTEL_SOURCE_NAME environment variable.

      Returns:
      the source name, or null
    • setSourceName

      public TelemetryConfig setSourceName(String sourceName)
      Sets the source name for telemetry spans.
      Parameters:
      sourceName - a name identifying the application producing the spans
      Returns:
      this config for method chaining
    • getCaptureContent

      public Boolean getCaptureContent()
      Gets whether to capture message content as part of telemetry.

      Maps to the OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT environment variable.

      Returns:
      true to capture content, false to suppress it, or null to use the default
    • setCaptureContent

      public TelemetryConfig setCaptureContent(Boolean captureContent)
      Sets whether to capture message content as part of telemetry.
      Parameters:
      captureContent - true to capture content, false to suppress it
      Returns:
      this config for method chaining