GoogleCloudPlatform / GoogleCloudPlatform/cloud-trace-data-source-plugin

Proposition to not format Trace SpanID

オープン
#24 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Go
スター
16
フォーク
6
PR マージ指標
30日以内にマージされた PR はありません

説明

When using the plugin, I have noticed that SpanIDs are formatted.

```
spanIDField.Append(strconv.FormatUint(s.GetSpanId(), 10))
```
https://github.com/GoogleCloudPlatform/cloud-trace-data-source-plugin/blob/2926fd2d77f30b927663605524ef788d0d014eef/pkg/plugin/plugin.go#L297C3-L297C14

Problem is that makes the Span IDs "unusable":
Say you want to use this ID to check the logs for specific SpanId. Google Cloud Logging expects the spanID in '016x' format, as it is originally set in the Trace span metadata.

I would like to propose that the plugin wouldn't format the spanIDs.

I have tried to format the ID back to '016x' using Grafana variables and Big Query
```
DECLARE spanIDString STRING;
SET spanIDString = "$span_id";

SELECT FORMAT("%016x", CAST(spanIDString AS INT64)) AS spanID;
```

but there are times where the spanID is getting (from the plugin) a value too large to be cast as an INT64. So my workaround doesn't work either.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with pkg/plugin/plugin.go at the linked line and inspect how SpanID is appended to the trace data. Verify that the emitted value preserves the hexadecimal representation expected by Google Cloud Logging, and add or update focused plugin coverage if the repository has a suitable test.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
go, google-cloud
領域
observability-sre
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。