@@ -52,37 +52,70 @@ The resulting logs will appear in the output from the collector and look similar
52
52
53
53
.. code-block :: sh
54
54
55
- Resource SchemaURL:
56
- Resource labels:
57
- -> telemetry.sdk.language: STRING(python)
58
- -> telemetry.sdk.name: STRING(opentelemetry)
59
- -> telemetry.sdk.version: STRING(1.8.0)
60
- -> service.name: STRING(shoppingcart)
61
- -> service.instance.id: STRING(instance-12)
62
- InstrumentationLibraryLogs # 0
63
- InstrumentationLibraryMetrics SchemaURL:
64
- InstrumentationLibrary __main__ 0.1
65
- LogRecord # 0
66
- Timestamp: 2022-01-13 20:37:03.998733056 +0000 UTC
67
- Severity: WARNING
68
- ShortName:
69
- Body: Jail zesty vixen who grabbed pay from quack.
70
- Trace ID:
71
- Span ID:
72
- Flags: 0
73
- LogRecord # 1
74
- Timestamp: 2022-01-13 20:37:04.082757888 +0000 UTC
75
- Severity: ERROR
76
- ShortName:
77
- Body: The five boxing wizards jump quickly.
78
- Trace ID:
79
- Span ID:
80
- Flags: 0
81
- LogRecord # 2
82
- Timestamp: 2022-01-13 20:37:04.082979072 +0000 UTC
83
- Severity: ERROR
84
- ShortName:
85
- Body: Hyderabad, we have a major problem.
86
- Trace ID: 63491217958f126f727622e41d4460f3
87
- Span ID: d90c57d6e1ca4f6c
88
- Flags: 1
55
+ ResourceLog # 0
56
+ Resource SchemaURL:
57
+ Resource attributes:
58
+ -> telemetry.sdk.language: Str(python)
59
+ -> telemetry.sdk.name: Str(opentelemetry)
60
+ -> telemetry.sdk.version: Str(1.33.0.dev0)
61
+ -> service.name: Str(shoppingcart)
62
+ -> service.instance.id: Str(instance-12)
63
+ ScopeLogs # 0
64
+ ScopeLogs SchemaURL:
65
+ InstrumentationScope myapp.area2
66
+ LogRecord # 0
67
+ ObservedTimestamp: 2025-04-22 12:16:57.315179 +0000 UTC
68
+ Timestamp: 2025-04-22 12:16:57.315152896 +0000 UTC
69
+ SeverityText: WARN
70
+ SeverityNumber: Warn(13)
71
+ Body: Str(Jail zesty vixen who grabbed pay from quack.)
72
+ Attributes:
73
+ -> code.filepath: Str(/Users/jayclifford/Repos/opentelemetry-python/docs/examples/logs/example.py)
74
+ -> code.function: Str(< module> )
75
+ -> code.lineno: Int(47)
76
+ Trace ID:
77
+ Span ID:
78
+ Flags: 0
79
+ LogRecord # 1
80
+ ObservedTimestamp: 2025-04-22 12:16:57.31522 +0000 UTC
81
+ Timestamp: 2025-04-22 12:16:57.315213056 +0000 UTC
82
+ SeverityText: ERROR
83
+ SeverityNumber: Error(17)
84
+ Body: Str(The five boxing wizards jump quickly.)
85
+ Attributes:
86
+ -> code.filepath: Str(/Users/jayclifford/Repos/opentelemetry-python/docs/examples/logs/example.py)
87
+ -> code.function: Str(< module> )
88
+ -> code.lineno: Int(48)
89
+ Trace ID:
90
+ Span ID:
91
+ Flags: 0
92
+ LogRecord # 2
93
+ ObservedTimestamp: 2025-04-22 12:16:57.315445 +0000 UTC
94
+ Timestamp: 2025-04-22 12:16:57.31543808 +0000 UTC
95
+ SeverityText: ERROR
96
+ SeverityNumber: Error(17)
97
+ Body: Str(Hyderabad, we have a major problem.)
98
+ Attributes:
99
+ -> code.filepath: Str(/Users/jayclifford/Repos/opentelemetry-python/docs/examples/logs/example.py)
100
+ -> code.function: Str(< module> )
101
+ -> code.lineno: Int(61)
102
+ Trace ID: 8a6739fffce895e694700944e2faf23e
103
+ Span ID: a45337020100cb63
104
+ Flags: 1
105
+ ScopeLogs # 1
106
+ ScopeLogs SchemaURL:
107
+ InstrumentationScope myapp.area1
108
+ LogRecord # 0
109
+ ObservedTimestamp: 2025-04-22 12:16:57.315242 +0000 UTC
110
+ Timestamp: 2025-04-22 12:16:57.315234048 +0000 UTC
111
+ SeverityText: ERROR
112
+ SeverityNumber: Error(17)
113
+ Body: Str(I have custom attributes.)
114
+ Attributes:
115
+ -> user_id: Str(user-123)
116
+ -> code.filepath: Str(/Users/jayclifford/Repos/opentelemetry-python/docs/examples/logs/example.py)
117
+ -> code.function: Str(< module> )
118
+ -> code.lineno: Int(53)
119
+ Trace ID:
120
+ Span ID:
121
+ Flags: 0
0 commit comments