Skip to content

Commit e9da4ca

Browse files
committed
.
1 parent 60a6b92 commit e9da4ca

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

MIGRATION_GUIDE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
105105
| `aws_event["headers"]["Host"]` | `server.address` |
106106
| `aws_context["function_name"]` | `faas.name` |
107107

108+
- If you're using the GCP integration, the `sampling_context` argument of `traces_sampler` doesn't contain the `gcp_env` and `gcp_event` keys anymore. Instead, the following, if available, is accessible:
109+
110+
| Old sampling context key | New sampling context key |
111+
| --------------------------------- | -------------------------- |
112+
| `gcp_env["function_name"]` | `faas.name` |
113+
| `gcp_env["function_region"]` | `faas.region` |
114+
| `gcp_env["function_project"]` | `gcp.function.project` |
115+
| `gcp_env["function_identity"]` | `gcp.function.identity` |
116+
| `gcp_env["function_entry_point"]` | `gcp.function.entry_point` |
117+
| `gcp_event.method` | `http.request.method` |
118+
| `gcp_event.query_string` | `url.query` |
119+
120+
108121
### Removed
109122

110123
- Spans no longer have a `description`. Use `name` instead.

sentry_sdk/integrations/gcp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ def _get_google_cloud_logs_url(final_time):
223223

224224
ENV_TO_ATTRIBUTE = {
225225
"FUNCTION_NAME": "faas.name",
226-
"ENTRY_POINT": "gcp.entry_point",
227-
"FUNCTION_IDENTITY": "gcp.function_identity",
226+
"ENTRY_POINT": "gcp.function.entry_point",
227+
"FUNCTION_IDENTITY": "gcp.function.identity",
228228
"FUNCTION_REGION": "faas.region",
229-
"GCP_PROJECT": "gcp.project",
229+
"GCP_PROJECT": "gcp.function.project",
230230
}
231231

232232
EVENT_TO_ATTRIBUTE = {

tests/integrations/gcp/test_gcp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ def cloud_function(functionhandler, event):
306306
DictionaryContaining({
307307
"faas.name": "chase_into_tree",
308308
"faas.region": "dogpark",
309-
"gcp.function_identity": "func_ID",
310-
"gcp.entry_point": "cloud_function",
311-
"gcp.project": "SquirrelChasing",
309+
"gcp.function.identity": "func_ID",
310+
"gcp.function.entry_point": "cloud_function",
311+
"gcp.function.project": "SquirrelChasing",
312312
"cloud.provider": "gcp",
313313
})
314314
)

0 commit comments

Comments
 (0)