Skip to content

Commit 35eb51b

Browse files
authored
Merge branch 'main' into cijothomas/remove-ordered-float
2 parents 8cc116f + f82dd14 commit 35eb51b

File tree

2 files changed

+59
-134
lines changed

2 files changed

+59
-134
lines changed

opentelemetry-otlp/examples/basic-otlp/README.md

+58-133
Original file line numberDiff line numberDiff line change
@@ -59,208 +59,133 @@ You should be able to see something similar below with different time and ID in
5959
### Span
6060

6161
```text
62-
2023-09-08T21:50:35.884Z info ResourceSpans #0
62+
2024-05-22T20:25:42.892Z info TracesExporter {"kind": "exporter", "data_type": "traces", "name": "logging", "resource spans": 2, "spans": 2}
63+
2024-05-22T20:25:42.892Z info ResourceSpans #0
6364
Resource SchemaURL:
6465
Resource attributes:
65-
-> service.name: Str(basic-otlp-tracing-example)
66+
-> service.name: Str(basic-otlp-example)
6667
ScopeSpans #0
6768
ScopeSpans SchemaURL:
68-
InstrumentationScope ex.com/basic
69+
InstrumentationScope basic
70+
InstrumentationScope attributes:
71+
-> scope-key: Str(scope-value)
6972
Span #0
70-
Trace ID : f8e7ea4dcab43689cea14f708309d682
71-
Parent ID : 8b560e2e7238eab5
72-
ID : 9e36b48dc07b32fe
73+
Trace ID : f3f6a43579f63734fe866d34d9aa0b88
74+
Parent ID : b66eacd1fcc728d3
75+
ID : af01696ea60b9229
7376
Name : Sub operation...
7477
Kind : Internal
75-
Start time : 2023-09-08 21:50:35.872800345 +0000 UTC
76-
End time : 2023-09-08 21:50:35.87282574 +0000 UTC
78+
Start time : 2024-05-22 20:25:42.877134 +0000 UTC
79+
End time : 2024-05-22 20:25:42.8771425 +0000 UTC
7780
Status code : Unset
7881
Status message :
7982
Attributes:
80-
-> lemons: Str(five)
83+
-> another.key: Str(yes)
8184
Events:
8285
SpanEvent #0
8386
-> Name: Sub span event
84-
-> Timestamp: 2023-09-08 21:50:35.872808684 +0000 UTC
87+
-> Timestamp: 2024-05-22 20:25:42.8771371 +0000 UTC
8588
-> DroppedAttributesCount: 0
8689
ResourceSpans #1
8790
Resource SchemaURL:
8891
Resource attributes:
89-
-> service.name: Str(basic-otlp-tracing-example)
92+
-> service.name: Str(basic-otlp-example)
9093
ScopeSpans #0
9194
ScopeSpans SchemaURL:
92-
InstrumentationScope ex.com/basic
95+
InstrumentationScope basic
96+
InstrumentationScope attributes:
97+
-> scope-key: Str(scope-value)
9398
Span #0
94-
Trace ID : f8e7ea4dcab43689cea14f708309d682
99+
Trace ID : f3f6a43579f63734fe866d34d9aa0b88
95100
Parent ID :
96-
ID : 8b560e2e7238eab5
97-
Name : operation
101+
ID : b66eacd1fcc728d3
102+
Name : Main operation
98103
Kind : Internal
99-
Start time : 2023-09-08 21:50:35.872735497 +0000 UTC
100-
End time : 2023-09-08 21:50:35.872832026 +0000 UTC
104+
Start time : 2024-05-22 20:25:42.8770371 +0000 UTC
105+
End time : 2024-05-22 20:25:42.8771505 +0000 UTC
101106
Status code : Unset
102107
Status message :
103108
Attributes:
104-
-> ex.com/another: Str(yes)
109+
-> another.key: Str(yes)
105110
Events:
106111
SpanEvent #0
107112
-> Name: Nice operation!
108-
-> Timestamp: 2023-09-08 21:50:35.872750123 +0000 UTC
113+
-> Timestamp: 2024-05-22 20:25:42.8770471 +0000 UTC
109114
-> DroppedAttributesCount: 0
110115
-> Attributes::
111116
-> bogons: Int(100)
112-
{"kind": "exporter", "data_type": "traces", "name": "logging"}
117+
{"kind": "exporter", "data_type": "traces", "name": "logging"}
113118
```
114119

115120
### Metric
116121

117122
```text
118-
2023-09-08T19:14:12.522Z info ResourceMetrics #0
123+
2024-05-22T20:25:42.908Z info MetricsExporter {"kind": "exporter", "data_type": "metrics", "name": "logging", "resource metrics": 1, "metrics": 1, "data points": 1}
124+
2024-05-22T20:25:42.908Z info ResourceMetrics #0
119125
Resource SchemaURL:
120126
Resource attributes:
121-
-> service.name: Str(basic-otlp-metrics-example)
127+
-> service.name: Str(basic-otlp-example)
122128
ScopeMetrics #0
123-
ScopeMetrics SchemaURL:
124-
InstrumentationScope ex.com/basic
129+
ScopeMetrics SchemaURL: schema_url
130+
InstrumentationScope basic v1.0
131+
InstrumentationScope attributes:
132+
-> scope-key: Str(scope-value)
125133
Metric #0
126134
Descriptor:
127-
-> Name: ex.com.one
128-
-> Description: A gauge set to 1.0
129-
-> Unit:
130-
-> DataType: Gauge
131-
NumberDataPoints #0
132-
Data point attributes:
133-
-> A: Str(1)
134-
-> B: Str(2)
135-
-> C: Str(3)
136-
-> lemons: Int(10)
137-
StartTimestamp: 1970-01-01 00:00:00 +0000 UTC
138-
Timestamp: 2023-09-08 19:14:12.468030127 +0000 UTC
139-
Value: 1.000000
140-
Metric #1
141-
Descriptor:
142-
-> Name: ex.com.two
143-
-> Description:
144-
-> Unit:
145-
-> DataType: Histogram
135+
-> Name: test_counter
136+
-> Description: a simple counter for demo purposes.
137+
-> Unit: my_unit
138+
-> DataType: Sum
139+
-> IsMonotonic: true
146140
-> AggregationTemporality: Cumulative
147-
HistogramDataPoints #0
141+
NumberDataPoints #0
148142
Data point attributes:
149-
-> A: Str(1)
150-
-> B: Str(2)
151-
-> C: Str(3)
152-
-> lemons: Int(10)
153-
StartTimestamp: 2023-09-08 19:14:12.466896812 +0000 UTC
154-
Timestamp: 2023-09-08 19:14:12.468052807 +0000 UTC
155-
Count: 1
156-
Sum: 5.500000
157-
Min: 5.500000
158-
Max: 5.500000
159-
ExplicitBounds #0: 0.000000
160-
ExplicitBounds #1: 5.000000
161-
ExplicitBounds #2: 10.000000
162-
ExplicitBounds #3: 25.000000
163-
ExplicitBounds #4: 50.000000
164-
ExplicitBounds #5: 75.000000
165-
ExplicitBounds #6: 100.000000
166-
ExplicitBounds #7: 250.000000
167-
ExplicitBounds #8: 500.000000
168-
ExplicitBounds #9: 750.000000
169-
ExplicitBounds #10: 1000.000000
170-
ExplicitBounds #11: 2500.000000
171-
ExplicitBounds #12: 5000.000000
172-
ExplicitBounds #13: 7500.000000
173-
ExplicitBounds #14: 10000.000000
174-
Buckets #0, Count: 0
175-
Buckets #1, Count: 0
176-
Buckets #2, Count: 1
177-
Buckets #3, Count: 0
178-
Buckets #4, Count: 0
179-
Buckets #5, Count: 0
180-
Buckets #6, Count: 0
181-
Buckets #7, Count: 0
182-
Buckets #8, Count: 0
183-
Buckets #9, Count: 0
184-
Buckets #10, Count: 0
185-
Buckets #11, Count: 0
186-
Buckets #12, Count: 0
187-
Buckets #13, Count: 0
188-
Buckets #14, Count: 0
189-
Buckets #15, Count: 0
190-
HistogramDataPoints #1
191-
StartTimestamp: 2023-09-08 19:14:12.466896812 +0000 UTC
192-
Timestamp: 2023-09-08 19:14:12.468052807 +0000 UTC
193-
Count: 1
194-
Sum: 1.300000
195-
Min: 1.300000
196-
Max: 1.300000
197-
ExplicitBounds #0: 0.000000
198-
ExplicitBounds #1: 5.000000
199-
ExplicitBounds #2: 10.000000
200-
ExplicitBounds #3: 25.000000
201-
ExplicitBounds #4: 50.000000
202-
ExplicitBounds #5: 75.000000
203-
ExplicitBounds #6: 100.000000
204-
ExplicitBounds #7: 250.000000
205-
ExplicitBounds #8: 500.000000
206-
ExplicitBounds #9: 750.000000
207-
ExplicitBounds #10: 1000.000000
208-
ExplicitBounds #11: 2500.000000
209-
ExplicitBounds #12: 5000.000000
210-
ExplicitBounds #13: 7500.000000
211-
ExplicitBounds #14: 10000.000000
212-
Buckets #0, Count: 0
213-
Buckets #1, Count: 1
214-
Buckets #2, Count: 0
215-
Buckets #3, Count: 0
216-
Buckets #4, Count: 0
217-
Buckets #5, Count: 0
218-
Buckets #6, Count: 0
219-
Buckets #7, Count: 0
220-
Buckets #8, Count: 0
221-
Buckets #9, Count: 0
222-
Buckets #10, Count: 0
223-
Buckets #11, Count: 0
224-
Buckets #12, Count: 0
225-
Buckets #13, Count: 0
226-
Buckets #14, Count: 0
227-
Buckets #15, Count: 0
228-
{"kind": "exporter", "data_type": "metrics", "name": "logging"}
143+
-> test_key: Str(test_value)
144+
StartTimestamp: 2024-05-22 20:25:42.8767804 +0000 UTC
145+
Timestamp: 2024-05-22 20:25:42.8937799 +0000 UTC
146+
Value: 10
147+
{"kind": "exporter", "data_type": "metrics", "name": "logging"}
229148
```
230149

231150
### Logs
232151

233152
```text
234-
2023-09-08T21:50:35.884Z info ResourceLog #0
153+
2024-05-22T20:25:42.914Z info LogsExporter {"kind": "exporter", "data_type": "logs", "name": "logging", "resource logs": 2, "log records": 2}
154+
2024-05-22T20:25:42.914Z info ResourceLog #0
235155
Resource SchemaURL:
236156
Resource attributes:
237-
-> service.name: Str(basic-otlp-logging-example)
157+
-> service.name: Str(basic-otlp-example)
238158
ScopeLogs #0
239159
ScopeLogs SchemaURL:
240-
InstrumentationScope opentelemetry-log-appender 0.1.0
160+
InstrumentationScope opentelemetry-appender-tracing 0.4.0
241161
LogRecord #0
242-
ObservedTimestamp: 2023-09-08 21:50:35.872759168 +0000 UTC
162+
ObservedTimestamp: 2024-05-22 20:25:42.8771025 +0000 UTC
243163
Timestamp: 1970-01-01 00:00:00 +0000 UTC
244164
SeverityText: INFO
245165
SeverityNumber: Info(9)
246166
Body: Str(hello from banana. My price is 2.99. I am also inside a Span!)
247-
Trace ID: f8e7ea4dcab43689cea14f708309d682
248-
Span ID: 8b560e2e7238eab5
167+
Attributes:
168+
-> name: Str(my-event-inside-span)
169+
Trace ID: f3f6a43579f63734fe866d34d9aa0b88
170+
Span ID: b66eacd1fcc728d3
249171
Flags: 1
250172
ResourceLog #1
251173
Resource SchemaURL:
252174
Resource attributes:
253-
-> service.name: Str(basic-otlp-logging-example)
175+
-> service.name: Str(basic-otlp-example)
254176
ScopeLogs #0
255177
ScopeLogs SchemaURL:
256-
InstrumentationScope opentelemetry-log-appender 0.1.0
178+
InstrumentationScope opentelemetry-appender-tracing 0.4.0
257179
LogRecord #0
258-
ObservedTimestamp: 2023-09-08 21:50:35.872833713 +0000 UTC
180+
ObservedTimestamp: 2024-05-22 20:25:42.8771591 +0000 UTC
259181
Timestamp: 1970-01-01 00:00:00 +0000 UTC
260182
SeverityText: INFO
261183
SeverityNumber: Info(9)
262184
Body: Str(hello from apple. My price is 1.99)
185+
Attributes:
186+
-> name: Str(my-event)
263187
Trace ID:
264188
Span ID:
265189
Flags: 0
190+
{"kind": "exporter", "data_type": "logs", "name": "logging"}
266191
```

opentelemetry-otlp/examples/basic-otlp/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync + 'static>> {
154154
info!(name: "my-event", target: "my-target", "hello from {}. My price is {}", "apple", 1.99);
155155

156156
global::shutdown_tracer_provider();
157-
logger_provider.shutdown()?;
158157
meter_provider.shutdown()?;
158+
logger_provider.shutdown()?;
159159

160160
Ok(())
161161
}

0 commit comments

Comments
 (0)