CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-google--gemini-cli-core

Gemini CLI Core - Core functionality library for the open-source AI agent that brings the power of Gemini directly into your terminal.

Overall
score

87%

Evaluation87%

1.01x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-10/

Telemetry Configuration for Gemini CLI Application

Build a system to configure and initialize OpenTelemetry-based telemetry for a Gemini CLI application. The system should support multiple export backends and provide structured observability data.

Requirements

Telemetry Configuration

Create a telemetry configuration module that enables OpenTelemetry tracing and metrics for Gemini CLI operations. The configuration should:

  1. Support GCP Cloud Trace as the primary export backend
  2. Allow customization of the service name and version
  3. Enable both traces and metrics collection
  4. Use the OTLP protocol for data export

Configuration Structure

The configuration should accept the following parameters:

  • projectId: The GCP project ID for Cloud Trace
  • serviceName: The name of the service (default: "gemini-cli-app")
  • serviceVersion: The version of the service (default: "1.0.0")
  • enabled: Whether telemetry is enabled (default: true)

Test Cases

  • Given a configuration with projectId "test-project-123", serviceName "my-app", and serviceVersion "2.0.0", the telemetry should initialize with these values @test
  • When telemetry is disabled (enabled: false), no telemetry data should be exported @test
  • The system should properly export span data when a simple operation is traced @test

Implementation

@generates

API

/**
 * Configuration options for OpenTelemetry telemetry
 */
export interface TelemetryConfig {
  projectId: string;
  serviceName?: string;
  serviceVersion?: string;
  enabled?: boolean;
}

/**
 * Initialize OpenTelemetry telemetry with the given configuration
 * Sets up tracing and metrics export to GCP Cloud Trace using OTLP protocol
 *
 * @param config - Telemetry configuration options
 * @returns A cleanup function to shut down telemetry
 */
export function initializeTelemetry(config: TelemetryConfig): () => Promise<void>;

/**
 * Get the configured tracer for creating spans
 *
 * @returns The tracer instance, or undefined if telemetry is not initialized
 */
export function getTracer(): any;

Dependencies { .dependencies }

@google/gemini-cli-core { .dependency }

Provides OpenTelemetry configuration and telemetry utilities for Gemini CLI applications.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-google--gemini-cli-core

tile.json