Skip to content

Commit 70d75ec

Browse files
Merge branch 'master' into fix-integration-asyncio-iscoroutine-function-warning
2 parents 1e6b296 + 22fc6a6 commit 70d75ec

23 files changed

Lines changed: 3053 additions & 948 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
token: ${{ steps.token.outputs.token }}
3232
fetch-depth: 0
3333
- name: Prepare release
34-
uses: getsentry/craft@ba01e596c4a4c07692f0de10b0d4fe05f3dd0292 # v2.25.2
34+
uses: getsentry/craft@97d0c4286f32a80d09c8b89366d762fecc3e27b6 # v2.25.4
3535
env:
3636
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
3737
with:

scripts/populate_tox/package_dependencies.jsonl

Lines changed: 15 additions & 16 deletions
Large diffs are not rendered by default.

scripts/populate_tox/releases.jsonl

Lines changed: 41 additions & 41 deletions
Large diffs are not rendered by default.

sentry_sdk/_span_batcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _to_transport_format(item: "StreamedSpan") -> "Any":
109109
res: "dict[str, Any]" = {
110110
"trace_id": item.trace_id,
111111
"span_id": item.span_id,
112-
"name": item._name,
112+
"name": item._name if item._name is not None else "<unlabeled span>",
113113
"status": item._status,
114114
"is_segment": item._is_segment(),
115115
"start_timestamp": item._start_timestamp.timestamp(),

sentry_sdk/consts.py

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,24 +406,54 @@ class SPANDATA:
406406

407407
CODE_FILEPATH = "code.filepath"
408408
"""
409+
.. deprecated::
410+
This attribute is deprecated. Use CODE_FILE_PATH instead.
411+
412+
The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
413+
Example: "/app/myapplication/http/handler/server.py"
414+
"""
415+
416+
CODE_FILE_PATH = "code.file.path"
417+
"""
409418
The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).
410419
Example: "/app/myapplication/http/handler/server.py"
411420
"""
412421

413422
CODE_FUNCTION = "code.function"
414423
"""
424+
.. deprecated::
425+
This attribute is deprecated. Use CODE_FUNCTION_NAME instead.
426+
427+
The method or function name, or equivalent (usually rightmost part of the code unit's name).
428+
Example: "server_request"
429+
"""
430+
431+
CODE_FUNCTION_NAME = "code.function.name"
432+
"""
415433
The method or function name, or equivalent (usually rightmost part of the code unit's name).
416434
Example: "server_request"
417435
"""
418436

419437
CODE_LINENO = "code.lineno"
420438
"""
439+
.. deprecated::
440+
This attribute is deprecated. Use CODE_LINE_NUMBER instead.
441+
421442
The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.
422443
Example: 42
423444
"""
424445

446+
CODE_LINE_NUMBER = "code.line.number"
447+
"""
448+
The line number in `code.file.path` best representing the operation. It SHOULD point within the code unit named in `code.function.name`.
449+
Example: 42
450+
"""
451+
425452
CODE_NAMESPACE = "code.namespace"
426453
"""
454+
.. deprecated::
455+
This attribute is deprecated. Use CODE_FUNCTION_NAME instead; the namespace should be included within the function name.
456+
427457
The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.
428458
Example: "http.handler"
429459
"""
@@ -437,10 +467,19 @@ class SPANDATA:
437467

438468
DB_NAME = "db.name"
439469
"""
470+
.. deprecated::
471+
This attribute is deprecated. Use DB_NAMESPACE instead.
472+
440473
The name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).
441474
Example: myDatabase
442475
"""
443476

477+
DB_NAMESPACE = "db.namespace"
478+
"""
479+
The name of the database being accessed.
480+
Example: "customers"
481+
"""
482+
444483
DB_DRIVER_NAME = "db.driver.name"
445484
"""
446485
The name of the database driver being used for the connection.
@@ -449,18 +488,36 @@ class SPANDATA:
449488

450489
DB_OPERATION = "db.operation"
451490
"""
491+
.. deprecated::
492+
This attribute is deprecated. Use DB_OPERATION_NAME instead.
493+
452494
The name of the operation being executed, e.g. the MongoDB command name such as findAndModify, or the SQL keyword.
453495
See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md
454496
Example: findAndModify, HMSET, SELECT
455497
"""
456498

499+
DB_OPERATION_NAME = "db.operation.name"
500+
"""
501+
The name of the operation being executed.
502+
Example: "SELECT"
503+
"""
504+
457505
DB_SYSTEM = "db.system"
458506
"""
507+
.. deprecated::
508+
This attribute is deprecated. Use DB_SYSTEM_NAME instead.
509+
459510
An identifier for the database management system (DBMS) product being used.
460511
See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md
461512
Example: postgresql
462513
"""
463514

515+
DB_SYSTEM_NAME = "db.system.name"
516+
"""
517+
An identifier for the database management system (DBMS) product being used. See OpenTelemetry's list of well-known DBMS identifiers.
518+
Example: "postgresql"
519+
"""
520+
464521
DB_USER = "db.user"
465522
"""
466523
The name of the database user used for connecting to the database.
@@ -492,6 +549,12 @@ class SPANDATA:
492549
Example: "Hello!"
493550
"""
494551

552+
GEN_AI_FUNCTION_ID = "gen_ai.function_id"
553+
"""
554+
Framework-specific tracing label for the execution of a function or other unit of execution in a generative AI system.
555+
Example: "my-awesome-function"
556+
"""
557+
495558
GEN_AI_OPERATION_NAME = "gen_ai.operation.name"
496559
"""
497560
The name of the operation being performed.
@@ -530,10 +593,19 @@ class SPANDATA:
530593

531594
GEN_AI_RESPONSE_TEXT = "gen_ai.response.text"
532595
"""
596+
.. deprecated::
597+
This attribute is deprecated. Use GEN_AI_OUTPUT_MESSAGES instead.
598+
533599
The model's response text messages.
534600
Example: ["The weather in Paris is rainy and overcast, with temperatures around 57°F", "The weather in London is sunny and warm, with temperatures around 65°F"]
535601
"""
536602

603+
GEN_AI_OUTPUT_MESSAGES = "gen_ai.output.messages"
604+
"""
605+
The model's response messages. It has to be a stringified version of an array of message objects, which can include text responses and tool calls.
606+
Example: [{"role": "assistant", "parts": [{"type": "text", "content": "The weather in Paris is currently rainy with a temperature of 57°F."}], "finish_reason": "stop"}]
607+
"""
608+
537609
GEN_AI_RESPONSE_TIME_TO_FIRST_TOKEN = "gen_ai.response.time_to_first_token"
538610
"""
539611
The time it took to receive the first token from the model.
@@ -542,16 +614,28 @@ class SPANDATA:
542614

543615
GEN_AI_RESPONSE_TOOL_CALLS = "gen_ai.response.tool_calls"
544616
"""
617+
.. deprecated::
618+
This attribute is deprecated. Use GEN_AI_OUTPUT_MESSAGES instead.
619+
545620
The tool calls in the model's response.
546621
Example: [{"name": "get_weather", "arguments": {"location": "Paris"}}]
547622
"""
548623

549624
GEN_AI_REQUEST_AVAILABLE_TOOLS = "gen_ai.request.available_tools"
550625
"""
626+
.. deprecated::
627+
This attribute is deprecated. Use GEN_AI_TOOL_DEFINITIONS instead.
628+
551629
The available tools for the model.
552630
Example: [{"name": "get_weather", "description": "Get the weather for a given location"}, {"name": "get_news", "description": "Get the news for a given topic"}]
553631
"""
554632

633+
GEN_AI_TOOL_DEFINITIONS = "gen_ai.tool.definitions"
634+
"""
635+
The list of source system tool definitions available to the GenAI agent or model.
636+
Example: [{"type": "function", "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": {"type": "object", "properties": {"location": {"type": "string", "description": "The city and state, e.g. San Francisco, CA"}, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}}, "required": ["location", "unit"]}}]
637+
"""
638+
555639
GEN_AI_REQUEST_FREQUENCY_PENALTY = "gen_ai.request.frequency_penalty"
556640
"""
557641
The frequency penalty parameter used to reduce repetitiveness of generated tokens.
@@ -572,10 +656,19 @@ class SPANDATA:
572656

573657
GEN_AI_REQUEST_MESSAGES = "gen_ai.request.messages"
574658
"""
659+
.. deprecated::
660+
This attribute is deprecated. Use GEN_AI_INPUT_MESSAGES instead.
661+
575662
The messages passed to the model. The "content" can be a string or an array of objects.
576663
Example: [{role: "system", "content: "Generate a random number."}, {"role": "user", "content": [{"text": "Generate a random number between 0 and 10.", "type": "text"}]}]
577664
"""
578665

666+
GEN_AI_INPUT_MESSAGES = "gen_ai.input.messages"
667+
"""
668+
The messages passed to the model. It has to be a stringified version of an array of objects. Role values must be "user", "assistant", "tool", or "system".
669+
Example: [{"role": "user", "parts": [{"type": "text", "content": "Weather in Paris?"}]}, {"role": "assistant", "parts": [{"type": "tool_call", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "name": "get_weather", "arguments": {"location": "Paris"}}]}, {"role": "tool", "parts": [{"type": "tool_call_response", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "result": "rainy, 57°F"}]}]
670+
"""
671+
579672
GEN_AI_REQUEST_MODEL = "gen_ai.request.model"
580673
"""
581674
The model identifier being used for the request.
@@ -614,10 +707,19 @@ class SPANDATA:
614707

615708
GEN_AI_SYSTEM = "gen_ai.system"
616709
"""
710+
.. deprecated::
711+
This attribute is deprecated. Use GEN_AI_PROVIDER_NAME instead.
712+
617713
The name of the AI system being used.
618714
Example: "openai"
619715
"""
620716

717+
GEN_AI_PROVIDER_NAME = "gen_ai.provider.name"
718+
"""
719+
The Generative AI provider as identified by the client or server instrumentation.
720+
Example: "openai"
721+
"""
722+
621723
GEN_AI_TOOL_DESCRIPTION = "gen_ai.tool.description"
622724
"""
623725
The description of the tool being used.
@@ -626,10 +728,19 @@ class SPANDATA:
626728

627729
GEN_AI_TOOL_INPUT = "gen_ai.tool.input"
628730
"""
731+
.. deprecated::
732+
This attribute is deprecated. Use GEN_AI_TOOL_CALL_ARGUMENTS instead.
733+
629734
The input of the tool being used.
630735
Example: {"location": "Paris"}
631736
"""
632737

738+
GEN_AI_TOOL_CALL_ARGUMENTS = "gen_ai.tool.call.arguments"
739+
"""
740+
The arguments of the tool call. It has to be a stringified version of the arguments to the tool.
741+
Example: {"location": "Paris"}
742+
"""
743+
633744
GEN_AI_TOOL_NAME = "gen_ai.tool.name"
634745
"""
635746
The name of the tool being used.
@@ -638,10 +749,19 @@ class SPANDATA:
638749

639750
GEN_AI_TOOL_OUTPUT = "gen_ai.tool.output"
640751
"""
752+
.. deprecated::
753+
This attribute is deprecated. Use GEN_AI_TOOL_CALL_RESULT instead.
754+
641755
The output of the tool being used.
642756
Example: "rainy, 57°F"
643757
"""
644758

759+
GEN_AI_TOOL_CALL_RESULT = "gen_ai.tool.call.result"
760+
"""
761+
The result of the tool call. It has to be a stringified version of the result of the tool.
762+
Example: "rainy, 57°F"
763+
"""
764+
645765
GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens"
646766
"""
647767
The number of tokens in the input.
@@ -692,6 +812,15 @@ class SPANDATA:
692812

693813
HTTP_METHOD = "http.method"
694814
"""
815+
.. deprecated::
816+
This attribute is deprecated. Use HTTP_REQUEST_METHOD instead.
817+
818+
The HTTP method used.
819+
Example: GET
820+
"""
821+
822+
HTTP_REQUEST_METHOD = "http.request.method"
823+
"""
695824
The HTTP method used.
696825
Example: GET
697826
"""

0 commit comments

Comments
 (0)