feat(attributes): Add gcp.function.context.* span attributes#371
feat(attributes): Add gcp.function.context.* span attributes#371chargome wants to merge 3 commits into
gcp.function.context.* span attributes#371Conversation
Add GCP Cloud Function context attributes: type, source, id, specversion, time, eventId, timestamp, eventType, and resource. Needed by the JS SDK (JS-2221) for span streaming. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Bug Fixes 🐛Attributes
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Rename gcp.function.context.eventId to event_id and eventType to event_type to comply with the repo's snake_case naming policy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| }, | ||
| "is_in_otel": false, | ||
| "example": "1234567890", | ||
| "changelog": [ | ||
| { | ||
| "version": "next", | ||
| "prs": [363], | ||
| "description": "Added gcp.function.context.id attribute" | ||
| } | ||
| ] | ||
| } |
There was a problem hiding this comment.
Bug: The documentation for gcp.function.context.id and gcp.function.context.event_id lacks clarity, failing to distinguish between the current CloudEvents (2nd gen) and legacy (1st gen) formats.
Severity: LOW
Suggested Fix
Update the brief description for gcp.function.context.id to clarify that it corresponds to the CloudEvents 2nd generation format. For example: "The CloudEvents (2nd gen) ID of the GCP Cloud Function event." This will clearly distinguish it from the legacy gcp.function.context.event_id attribute.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: model/attributes/gcp/gcp__function__context__id.json#L1-L17
Potential issue: The attributes `gcp.function.context.id` and
`gcp.function.context.event_id` both represent a GCP Cloud Function event ID. However,
the documentation does not clearly state that `id` is for the current CloudEvents (2nd
gen) format, while `event_id` is for the legacy (1st gen) format. This ambiguity,
compounded by identical example values, could lead developers of downstream SDKs to
select the incorrect attribute, potentially causing functional issues when parsing or
processing event data.
Also affects:
model/attributes/gcp/gcp__function__context__event_id.json:1~17
Did we get this right? 👍 / 👎 to inform future reviews.
Summary
type,source,id,specversion,time,eventId,timestamp,eventType,resourceeventId,eventType, andtimestampuse camelCase to match the GCP API field names