Skip to content

feat(attributes): Add gcp.function.context.* span attributes#371

Open
chargome wants to merge 3 commits into
mainfrom
chargome/feat/add-gcp-function-span-attributes
Open

feat(attributes): Add gcp.function.context.* span attributes#371
chargome wants to merge 3 commits into
mainfrom
chargome/feat/add-gcp-function-span-attributes

Conversation

@chargome
Copy link
Copy Markdown
Member

Summary

  • Add 9 GCP Cloud Function context attributes: type, source, id, specversion, time, eventId, timestamp, eventType, resource
  • Note: eventId, eventType, and timestamp use camelCase to match the GCP API field names
  • Needed by the JS SDK (JS-2221) for span streaming

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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add gcp.function.context.* span attributes by chargome in #371
  • Add calculated performance scores by loewenheim in #355
  • Add rpc.response.status_code attribute by alexander-alderman-webb in #352
  • Add rpc.method attribute by alexander-alderman-webb in #351
  • Add app vitals start attributes by buenaflor in #353
  • Add process.runtime.engine.* attributes by chargome in #347

Bug Fixes 🐛

Attributes

  • Increase some PII values by loewenheim in #373
  • Change several deprecation statuses to normalize to align with ingestion paths by constantinius in #350

Other

  • (create) Replace angle brackets in file names by loewenheim in #356

Internal Changes 🔧

  • (gh) Remove myself from CODEOWNERS by lcian in #354
  • Bump vulnerable pytest by alexander-alderman-webb in #360
  • Bump vulnerable js packages by chargome in #359

🤖 This preview updates automatically when you update the PR.

@chargome chargome self-assigned this May 12, 2026
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>
@chargome chargome marked this pull request as ready for review May 13, 2026 08:46
@chargome chargome requested review from a team, Lms24, cleptric, mjq and nsdeschenes as code owners May 13, 2026 08:46
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment on lines +7 to +17
},
"is_in_otel": false,
"example": "1234567890",
"changelog": [
{
"version": "next",
"prs": [363],
"description": "Added gcp.function.context.id attribute"
}
]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant