Skip to content

Commit 4f29416

Browse files
AnnatarHeclaude
andcommitted
feat(daemon): add event.kind resource attribute to OTEL processor
Extract and propagate event.kind from OTEL resource attributes for AI code events. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e8fdd2e commit 4f29416

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

daemon/aicode_otel_processor.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ func extractResourceAttributes(resource *resourcev1.Resource) *model.AICodeOtelR
227227
// Standard resource attributes
228228
case "session.id":
229229
attrs.SessionID = value.GetStringValue()
230+
case "event.kind":
231+
attrs.EventKind = value.GetStringValue()
230232
case "conversation.id":
231233
attrs.ConversationID = value.GetStringValue()
232234
case "app.version":
@@ -295,6 +297,7 @@ func applyResourceAttributesToMetric(metric *model.AICodeOtelMetric, attrs *mode
295297
func applyResourceAttributesToEvent(event *model.AICodeOtelEvent, attrs *model.AICodeOtelResourceAttributes) {
296298
// Standard resource attributes
297299
event.SessionID = attrs.SessionID
300+
event.EventKind = attrs.EventKind
298301
event.ConversationID = attrs.ConversationID
299302
event.UserAccountUUID = attrs.UserAccountUUID
300303
event.OrganizationID = attrs.OrganizationID

daemon/cc_info_timer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ func (s *CCInfoTimerService) stopTimer() {
146146
s.activeRanges = make(map[CCInfoTimeRange]bool)
147147
s.gitCache = make(map[string]*GitCacheEntry)
148148
s.mu.Unlock()
149-
150149
s.rateLimitCache.mu.Lock()
151150
s.rateLimitCache.usage = nil
152151
s.rateLimitCache.fetchedAt = time.Time{}

model/aicode_otel_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type AICodeOtelRequest struct {
1515
type AICodeOtelResourceAttributes struct {
1616
// Standard resource attributes
1717
SessionID string
18+
EventKind string
1819
ConversationID string // Codex uses conversation.id instead of session.id
1920
UserAccountUUID string
2021
OrganizationID string

0 commit comments

Comments
 (0)