Skip to content

Commit 556f347

Browse files
authored
feat: Replace Node.js telemetry with Docker (#15)
This change replaces the Node.js-based telemetry setup with a more streamlined Docker-based approach. - The `scripts/telemetry.js` and `scripts/telemetry_utils.js` files have been removed. - The `action.yml` now uses a Docker container to run the OpenTelemetry collector. - A `collector-gcp.yaml.template` file has been added to provide a configuration for the collector. Fixes #11 Fixes #14 Thanks to @sethvargo for pairing on this!
1 parent cd43504 commit 556f347

4 files changed

Lines changed: 48 additions & 426 deletions

File tree

action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,23 @@ runs:
5050
project_id: '${{ env.OTLP_GOOGLE_CLOUD_PROJECT }}'
5151
workload_identity_provider: '${{ env.OTLP_GCP_WIF_PROVIDER }}'
5252

53-
- name: 'Setup Telemetry Collector for Google Cloud'
53+
- name: 'Run Telemetry Collector for Google Cloud'
5454
if: |-
5555
${{ env.OTLP_GCP_WIF_PROVIDER != '' }}
5656
env:
5757
OTLP_GOOGLE_CLOUD_PROJECT: '${{ env.OTLP_GOOGLE_CLOUD_PROJECT }}'
5858
GITHUB_ACTION_PATH: '${{ github.action_path }}'
5959
shell: 'bash'
6060
run: |-
61-
node "${GITHUB_ACTION_PATH}/scripts/telemetry.js"
61+
set -euo pipefail
62+
mkdir -p .gemini/
63+
sed "s/OTLP_GOOGLE_CLOUD_PROJECT/${OTLP_GOOGLE_CLOUD_PROJECT}/g" "${GITHUB_ACTION_PATH}/scripts/collector-gcp.yaml.template" > ".gemini/collector-gcp.yaml"
64+
65+
docker run -d --name gemini-telemetry-collector --network host \
66+
-v "${GITHUB_WORKSPACE}:/github/workspace" \
67+
-e "GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS/$GITHUB_WORKSPACE//github/workspace}" \
68+
-w "/github/workspace" \
69+
otel/opentelemetry-collector-contrib:0.128.0
6270
6371
- name: 'Install Gemini CLI'
6472
id: 'install'
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
receivers:
2+
otlp:
3+
protocols:
4+
grpc:
5+
endpoint: 'localhost:4317'
6+
processors:
7+
batch:
8+
timeout: '1s'
9+
exporters:
10+
googlecloud:
11+
project: 'OTLP_GOOGLE_CLOUD_PROJECT'
12+
metric:
13+
prefix: 'custom.googleapis.com/gemini_cli'
14+
log:
15+
default_log_name: 'gemini_cli'
16+
debug:
17+
verbosity: 'detailed'
18+
sampling_initial: '2'
19+
sampling_thereafter: '500'
20+
service:
21+
telemetry:
22+
logs:
23+
level: 'debug'
24+
metrics:
25+
level: 'none'
26+
pipelines:
27+
traces:
28+
receivers: ['otlp']
29+
processors: ['batch']
30+
exporters: ['googlecloud', 'debug']
31+
metrics:
32+
receivers: ['otlp']
33+
processors: ['batch']
34+
exporters: ['googlecloud', 'debug']
35+
logs:
36+
receivers: ['otlp']
37+
processors: ['batch']
38+
exporters: ['googlecloud', 'debug']

scripts/telemetry.js

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)