Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana committed Nov 28, 2024
1 parent 60a6b92 commit e9da4ca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
13 changes: 13 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
| `aws_event["headers"]["Host"]` | `server.address` |
| `aws_context["function_name"]` | `faas.name` |

- 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:

| Old sampling context key | New sampling context key |
| --------------------------------- | -------------------------- |
| `gcp_env["function_name"]` | `faas.name` |
| `gcp_env["function_region"]` | `faas.region` |
| `gcp_env["function_project"]` | `gcp.function.project` |
| `gcp_env["function_identity"]` | `gcp.function.identity` |
| `gcp_env["function_entry_point"]` | `gcp.function.entry_point` |
| `gcp_event.method` | `http.request.method` |
| `gcp_event.query_string` | `url.query` |


### Removed

- Spans no longer have a `description`. Use `name` instead.
Expand Down
6 changes: 3 additions & 3 deletions sentry_sdk/integrations/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ def _get_google_cloud_logs_url(final_time):

ENV_TO_ATTRIBUTE = {
"FUNCTION_NAME": "faas.name",
"ENTRY_POINT": "gcp.entry_point",
"FUNCTION_IDENTITY": "gcp.function_identity",
"ENTRY_POINT": "gcp.function.entry_point",
"FUNCTION_IDENTITY": "gcp.function.identity",
"FUNCTION_REGION": "faas.region",
"GCP_PROJECT": "gcp.project",
"GCP_PROJECT": "gcp.function.project",
}

EVENT_TO_ATTRIBUTE = {
Expand Down
6 changes: 3 additions & 3 deletions tests/integrations/gcp/test_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ def cloud_function(functionhandler, event):
DictionaryContaining({
"faas.name": "chase_into_tree",
"faas.region": "dogpark",
"gcp.function_identity": "func_ID",
"gcp.entry_point": "cloud_function",
"gcp.project": "SquirrelChasing",
"gcp.function.identity": "func_ID",
"gcp.function.entry_point": "cloud_function",
"gcp.function.project": "SquirrelChasing",
"cloud.provider": "gcp",
})
)
Expand Down

0 comments on commit e9da4ca

Please sign in to comment.