/
com.azure.core.util.tracing.Tracer.yml
543 lines (543 loc) · 47.4 KB
/
com.azure.core.util.tracing.Tracer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
### YamlMime:JavaType
uid: "com.azure.core.util.tracing.Tracer"
fullName: "com.azure.core.util.tracing.Tracer"
name: "Tracer"
nameWithType: "Tracer"
summary: "Contract that all tracers must implement to be pluggable into the SDK."
syntax: "public interface **Tracer**"
fields:
- uid: "com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY"
fullName: "com.azure.core.util.tracing.Tracer.AZ_TRACING_NAMESPACE_KEY"
name: "AZ_TRACING_NAMESPACE_KEY"
nameWithType: "Tracer.AZ_TRACING_NAMESPACE_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the Azure resource provider namespace."
deprecatedTag: "Pass Azure Resource Provider Namespace to Tracer factory method <xref uid=\"com.azure.core.util.tracing.TracerProvider.createTracer(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.TracingOptions)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TracerProvider#createTracer(String, String, String, TracingOptions)\"></xref>"
modifiers:
- "static"
- "final"
field:
value: "az.namespace"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String AZ_TRACING_NAMESPACE_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the Azure resource provider namespace."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY"
fullName: "com.azure.core.util.tracing.Tracer.DIAGNOSTIC_ID_KEY"
name: "DIAGNOSTIC_ID_KEY"
nameWithType: "Tracer.DIAGNOSTIC_ID_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a \"Diagnostic Id\" for the service call."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.extractContext(java.util.function.Function<java.lang.String,java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#extractContext(Function)\"></xref> and <xref uid=\"com.azure.core.util.tracing.Tracer.injectContext(java.util.function.BiConsumer<java.lang.String,java.lang.String>,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#injectContext(BiConsumer, Context)\"></xref> for context propagation."
modifiers:
- "static"
- "final"
field:
value: "Diagnostic-Id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String DIAGNOSTIC_ID_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a \"Diagnostic Id\" for the service call."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.DISABLE_TRACING_KEY"
fullName: "com.azure.core.util.tracing.Tracer.DISABLE_TRACING_KEY"
name: "DISABLE_TRACING_KEY"
nameWithType: "Tracer.DISABLE_TRACING_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which disables tracing for the request associated with the current context."
modifiers:
- "static"
- "final"
field:
value: "disable-tracing"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String DISABLE_TRACING_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which disables tracing for the request associated with the current context."
- uid: "com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY"
fullName: "com.azure.core.util.tracing.Tracer.ENTITY_PATH_KEY"
name: "ENTITY_PATH_KEY"
nameWithType: "Tracer.ENTITY_PATH_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains an entity path."
modifiers:
- "static"
- "final"
field:
value: "entity-path"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String ENTITY_PATH_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains an entity path."
- uid: "com.azure.core.util.tracing.Tracer.HOST_NAME_KEY"
fullName: "com.azure.core.util.tracing.Tracer.HOST_NAME_KEY"
name: "HOST_NAME_KEY"
nameWithType: "Tracer.HOST_NAME_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the hostname."
modifiers:
- "static"
- "final"
field:
value: "hostname"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String HOST_NAME_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the hostname."
- uid: "com.azure.core.util.tracing.Tracer.MESSAGE_ENQUEUED_TIME"
fullName: "com.azure.core.util.tracing.Tracer.MESSAGE_ENQUEUED_TIME"
name: "MESSAGE_ENQUEUED_TIME"
nameWithType: "Tracer.MESSAGE_ENQUEUED_TIME"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the time of the last enqueued message in the partition's stream."
deprecatedTag: "Use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> and pass enqueued time as an attribute on link."
modifiers:
- "static"
- "final"
field:
value: "x-opt-enqueued-time"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String MESSAGE_ENQUEUED_TIME"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the time of the last enqueued message in the partition's stream."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.PARENT_SPAN_KEY"
fullName: "com.azure.core.util.tracing.Tracer.PARENT_SPAN_KEY"
name: "PARENT_SPAN_KEY"
nameWithType: "Tracer.PARENT_SPAN_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains parent span data."
deprecatedTag: "Deprecated in favor of PARENT\\_TRACE\\_CONTEXT\\_KEY, use it to propagate full io.<wbr>opentelemetry.<wbr>Context"
modifiers:
- "static"
- "final"
field:
value: "parent-span"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String PARENT_SPAN_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains parent span data. This span will be used as the parent span for all spans the SDK creates.\n\nIf no span data is listed when the span is created it will default to using this span key as the parent span."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.PARENT_TRACE_CONTEXT_KEY"
fullName: "com.azure.core.util.tracing.Tracer.PARENT_TRACE_CONTEXT_KEY"
name: "PARENT_TRACE_CONTEXT_KEY"
nameWithType: "Tracer.PARENT_TRACE_CONTEXT_KEY"
summary: "<xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> key to store trace context."
modifiers:
- "static"
- "final"
field:
value: "trace-context"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String PARENT_TRACE_CONTEXT_KEY"
desc: "<xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> key to store trace context. This context will be used as a parent context for new spans and propagated in outgoing HTTP calls."
- uid: "com.azure.core.util.tracing.Tracer.SCOPE_KEY"
fullName: "com.azure.core.util.tracing.Tracer.SCOPE_KEY"
name: "SCOPE_KEY"
nameWithType: "Tracer.SCOPE_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> the scope of code where the given Span is in the current Context."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.makeSpanCurrent(com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#makeSpanCurrent(Context)\"></xref> instead."
modifiers:
- "static"
- "final"
field:
value: "scope"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String SCOPE_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> the scope of code where the given Span is in the current Context."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.SPAN_BUILDER_KEY"
fullName: "com.azure.core.util.tracing.Tracer.SPAN_BUILDER_KEY"
name: "SPAN_BUILDER_KEY"
nameWithType: "Tracer.SPAN_BUILDER_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the shared span builder that is in the current Context."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> instead"
modifiers:
- "static"
- "final"
field:
value: "builder"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String SPAN_BUILDER_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates the shared span builder that is in the current Context."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY"
fullName: "com.azure.core.util.tracing.Tracer.SPAN_CONTEXT_KEY"
name: "SPAN_CONTEXT_KEY"
nameWithType: "Tracer.SPAN_CONTEXT_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a message span context."
modifiers:
- "static"
- "final"
field:
value: "span-context"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public static final String SPAN_CONTEXT_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains a message span context."
- uid: "com.azure.core.util.tracing.Tracer.USER_SPAN_NAME_KEY"
fullName: "com.azure.core.util.tracing.Tracer.USER_SPAN_NAME_KEY"
name: "USER_SPAN_NAME_KEY"
nameWithType: "Tracer.USER_SPAN_NAME_KEY"
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the name for the user spans that are created."
deprecatedTag: "please pass span name to Tracer.<wbr>start methods."
modifiers:
- "static"
- "final"
field:
value: "user-span-name"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public static final String USER_SPAN_NAME_KEY"
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> which indicates that the context contains the name for the user spans that are created.\n\nIf no span name is listed when the span is created it will default to using the calling method's name."
hasDeprecatedTag: true
methods:
- uid: "com.azure.core.util.tracing.Tracer.addEvent(java.lang.String,java.util.Map<java.lang.String,java.lang.Object>,java.time.OffsetDateTime)"
fullName: "com.azure.core.util.tracing.Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
name: "addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
nameWithType: "Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
summary: "Adds an event to the current span with the provided `timestamp` and `attributes`."
deprecatedTag: "Use <xref uid=\"com.azure.core.util.tracing.Tracer.addEvent(java.lang.String,java.util.Map<java.lang.String,java.lang.Object>,java.time.OffsetDateTime,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#addEvent(String, Map, OffsetDateTime, Context)\"></xref>"
modifiers:
- "default"
parameters:
- description: "the name of the event."
name: "name"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the additional attributes to be set for the event."
name: "attributes"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>>"
- description: "The instant, in UTC, at which the event will be associated to the span."
name: "timestamp"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html\">OffsetDateTime</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default void addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp)"
desc: "Adds an event to the current span with the provided `timestamp` and `attributes`.\n\nThis API does not provide any normalization if provided timestamps are out of range of the current span timeline\n\nSupported attribute values include String, double, boolean, long, String \\[\\], double \\[\\], long \\[\\]. Any other Object value type and null values will be silently ignored."
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.addEvent(java.lang.String,java.util.Map<java.lang.String,java.lang.Object>,java.time.OffsetDateTime,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
name: "addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
nameWithType: "Tracer.addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
summary: "Adds an event to the span present in the `Context` with the provided `timestamp` and `attributes`."
modifiers:
- "default"
parameters:
- description: "the name of the event."
name: "name"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the additional attributes to be set for the event."
name: "attributes"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>>"
- description: "The instant, in UTC, at which the event will be associated to the span."
name: "timestamp"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html\">OffsetDateTime</a>"
- description: "the call metadata containing information of the span to which the event should be associated with."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void addEvent(String name, Map<String,Object> attributes, OffsetDateTime timestamp, Context context)"
desc: "Adds an event to the span present in the `Context` with the provided `timestamp` and `attributes`.\n\nThis API does not provide any normalization if provided timestamps are out of range of the current span timeline\n\nSupported attribute values include String, double, boolean, long, String \\[\\], double \\[\\], long \\[\\]. Any other Object value type and null values will be silently ignored.\n\n```java\nContext span = tracer.start(\"Cosmos.getItem\", Context.NONE);\n tracer.addEvent(\"trying another endpoint\", Collections.singletonMap(\"endpoint\", \"westus3\"), OffsetDateTime.now(), span);\n```"
- uid: "com.azure.core.util.tracing.Tracer.addLink(com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.addLink(Context context)"
name: "addLink(Context context)"
nameWithType: "Tracer.addLink(Context context)"
summary: "Provides a way to link multiple tracing spans."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> )\\}"
modifiers:
- "default"
parameters:
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default void addLink(Context context)"
desc: "Provides a way to link multiple tracing spans. Used in batching operations to relate multiple requests under a single batch.\n\n**Code samples**\n\nLink multiple spans using their span context information"
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.end(int,java.lang.Throwable,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.end(int responseCode, Throwable error, Context context)"
name: "end(int responseCode, Throwable error, Context context)"
nameWithType: "Tracer.end(int responseCode, Throwable error, Context context)"
summary: "Completes the current tracing span."
deprecatedTag: "set specific attribute e.<wbr>g. http\\_status\\_code explicitly and use <xref uid=\"com.azure.core.util.tracing.Tracer.end(java.lang.String,java.lang.Throwable,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#end(String, Throwable, Context)\"></xref>."
modifiers:
- "default"
parameters:
- description: "Response status code if the span is in an HTTP call context."
name: "responseCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "<xref uid=\"java.lang.Throwable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Throwable\"></xref> that happened during the span or <code>null</code> if no exception occurred."
name: "error"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html\">Throwable</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default void end(int responseCode, Throwable error, Context context)"
desc: "Completes the current tracing span.\n\n**Code samples**\n\nCompletes the tracing span present in the context, with the corresponding OpenTelemetry status for the given response status code"
hasDeprecatedTag: true
- uid: "com.azure.core.util.tracing.Tracer.end(java.lang.String,java.lang.Throwable,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.end(String errorMessage, Throwable throwable, Context context)"
name: "end(String errorMessage, Throwable throwable, Context context)"
nameWithType: "Tracer.end(String errorMessage, Throwable throwable, Context context)"
summary: "Completes span on the context."
modifiers:
- "abstract"
parameters:
- description: "The error message that occurred during the call, or <code>null</code> if no error.\n occurred. Any other non-null string indicates an error with description provided in <code>errorMessage</code>."
name: "errorMessage"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "<xref uid=\"java.lang.Throwable\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Throwable\"></xref> that happened during the span or <code>null</code> if no exception occurred."
name: "throwable"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html\">Throwable</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract void end(String errorMessage, Throwable throwable, Context context)"
desc: "Completes span on the context.\n\n**Code samples**\n\nCompletes the tracing span with unset status\n\n```java\nContext messageSpan = tracer.start(\"ServiceBus.message\", new StartSpanOptions(SpanKind.PRODUCER), Context.NONE);\n tracer.end(null, null, messageSpan);\n```\n\nCompletes the tracing span with provided error message\n\n```java\nContext span = tracer.start(\"ServiceBus.send\", new StartSpanOptions(SpanKind.CLIENT), Context.NONE);\n tracer.end(\"amqp:not-found\", null, span);\n```\n\nCompletes the tracing span with provided exception\n\n```java\nContext sendSpan = tracer.start(\"ServiceBus.send\", new StartSpanOptions(SpanKind.CLIENT), Context.NONE);\n try (AutoCloseable scope = tracer.makeSpanCurrent(sendSpan)) {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, sendSpan);\n }\n```"
- uid: "com.azure.core.util.tracing.Tracer.extractContext(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.extractContext(String diagnosticId, Context context)"
name: "extractContext(String diagnosticId, Context context)"
nameWithType: "Tracer.extractContext(String diagnosticId, Context context)"
summary: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.extractContext(java.util.function.Function<java.lang.String,java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#extractContext(Function)\"></xref>"
modifiers:
- "default"
parameters:
- description: "Unique identifier for the trace information of the span."
name: "diagnosticId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context extractContext(String diagnosticId, Context context)"
desc: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream.\n\n**Code samples**\n\nExtracts the corresponding span context information from a valid diagnostic id"
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the span context."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.extractContext(java.util.function.Function<java.lang.String,java.lang.String>)"
fullName: "com.azure.core.util.tracing.Tracer.extractContext(Function<String,String> headerGetter)"
name: "extractContext(Function<String,String> headerGetter)"
nameWithType: "Tracer.extractContext(Function<String,String> headerGetter)"
summary: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream."
modifiers:
- "default"
parameters:
- description: "Unique identifier for the trace information of the span and todo."
name: "headerGetter"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html\">Function</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>>"
syntax: "public default Context extractContext(Function<String,String> headerGetter)"
desc: "Extracts the span's context as <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> from upstream.\n\n**Code samples**\n\nExtracts the corresponding span context information from a valid diagnostic id\n\n```java\nContext parentContext = tracer.extractContext(name -> {\n Object value = messageProperties.get(name);\n return value instanceof String ? (String) value : null;\n });\n\n StartSpanOptions remoteParentOptions = new StartSpanOptions(SpanKind.CONSUMER)\n .setRemoteParent(parentContext);\n\n Context spanWithRemoteParent = tracer.start(\"EventHubs.process\", remoteParentOptions, Context.NONE);\n\n try (AutoCloseable scope = tracer.makeSpanCurrent(spanWithRemoteParent)) {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, spanWithRemoteParent);\n }\n```"
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the span context."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.getSharedSpanBuilder(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.getSharedSpanBuilder(String spanName, Context context)"
name: "getSharedSpanBuilder(String spanName, Context context)"
nameWithType: "Tracer.getSharedSpanBuilder(String spanName, Context context)"
summary: "Returns a span builder with the provided name in <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.StartSpanOptions.addLink(com.azure.core.util.tracing.TracingLink)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"StartSpanOptions#addLink(TracingLink)\"></xref> instead"
modifiers:
- "default"
parameters:
- description: "Name to give the span for the created builder."
name: "spanName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context getSharedSpanBuilder(String spanName, Context context)"
desc: "Returns a span builder with the provided name in <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref>.\n\n**Code samples**\n\nReturns a builder with the provided span name."
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the span builder."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.injectContext(java.util.function.BiConsumer<java.lang.String,java.lang.String>,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.injectContext(BiConsumer<String,String> headerSetter, Context context)"
name: "injectContext(BiConsumer<String,String> headerSetter, Context context)"
nameWithType: "Tracer.injectContext(BiConsumer<String,String> headerSetter, Context context)"
summary: "Injects tracing context."
modifiers:
- "default"
parameters:
- description: "callback to set context with."
name: "headerSetter"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/BiConsumer.html\">BiConsumer</a><<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>>"
- description: "trace context instance"
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void injectContext(BiConsumer<String,String> headerSetter, Context context)"
desc: "Injects tracing context.\n\n```java\nContext httpSpan = tracer.start(\"HTTP GET\", new StartSpanOptions(SpanKind.CLIENT), methodSpan);\n tracer.injectContext((headerName, headerValue) -> request.setHeader(headerName, headerValue), httpSpan);\n\n try (AutoCloseable scope = tracer.makeSpanCurrent(httpSpan)) {\n HttpResponse response = getResponse(request);\n httpResponseCode = response.getStatusCode();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(httpResponseCode, throwable, httpSpan);\n }\n```"
- uid: "com.azure.core.util.tracing.Tracer.isEnabled()"
fullName: "com.azure.core.util.tracing.Tracer.isEnabled()"
name: "isEnabled()"
nameWithType: "Tracer.isEnabled()"
summary: "Checks if tracer is enabled."
modifiers:
- "default"
syntax: "public default boolean isEnabled()"
desc: "Checks if tracer is enabled.\n\n```java\nif (!tracer.isEnabled()) {\n doWork();\n } else {\n Context span = tracer.start(\"span\", Context.NONE);\n try {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, span);\n }\n }\n```"
returns:
description: "true if tracer is enabled, false otherwise."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.isRecording(com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.isRecording(Context span)"
name: "isRecording(Context span)"
nameWithType: "Tracer.isRecording(Context span)"
summary: "Checks if span is sampled in."
modifiers:
- "default"
parameters:
- description: "Span to check."
name: "span"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default boolean isRecording(Context span)"
desc: "Checks if span is sampled in."
returns:
description: "true if span is recording, false otherwise."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.makeSpanCurrent(com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.makeSpanCurrent(Context context)"
name: "makeSpanCurrent(Context context)"
nameWithType: "Tracer.makeSpanCurrent(Context context)"
summary: "Makes span current."
modifiers:
- "default"
parameters:
- description: "Context with span.\n\n <!-- src_embed com.azure.core.util.tracing.makeCurrent -->\n <pre>\n Context span = tracer.start("EventHubs.process", new StartSpanOptions(SpanKind.CONSUMER), Context.NONE);\n try (AutoCloseable scope = tracer.makeSpanCurrent(span)) {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, span);\n }\n </pre>\n <!-- end com.azure.core.util.tracing.makeCurrent -->"
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default AutoCloseable makeSpanCurrent(Context context)"
desc: "Makes span current. Implementations may put it on ThreadLocal. Make sure to always use try-with-resource statement with makeSpanCurrent"
returns:
description: "Closeable that should be closed in the same thread with try-with-resource statement."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html\">AutoCloseable</a>"
- uid: "com.azure.core.util.tracing.Tracer.setAttribute(java.lang.String,java.lang.Object,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setAttribute(String key, Object value, Context context)"
name: "setAttribute(String key, Object value, Context context)"
nameWithType: "Tracer.setAttribute(String key, Object value, Context context)"
summary: "Sets an attribute on span."
modifiers:
- "default"
parameters:
- description: "attribute key."
name: "key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "attribute value. Note that underlying tracer implementations limit supported value types.\n OpenTelemetry implementation supports following types:\n <ul>\n <li><xref uid=\"java.lang.String\" data-throw-if-not-resolved=\"false\" data-raw-source=\"String\"></xref></li>\n <li><code>int</code></li>\n <li><code>double</code></li>\n <li><code>boolean</code></li>\n <li><code>long</code></li>\n </ul>"
name: "value"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
- description: "context containing span to which attribute is added."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void setAttribute(String key, Object value, Context context)"
desc: "Sets an attribute on span. Adding duplicate attributes, update, or removal is discouraged, since underlying implementations behavior can vary."
- uid: "com.azure.core.util.tracing.Tracer.setAttribute(java.lang.String,java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setAttribute(String key, String value, Context context)"
name: "setAttribute(String key, String value, Context context)"
nameWithType: "Tracer.setAttribute(String key, String value, Context context)"
summary: "Adds metadata to the current span."
modifiers:
- "abstract"
parameters:
- description: "Name of the metadata."
name: "key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Value of the metadata."
name: "value"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract void setAttribute(String key, String value, Context context)"
desc: "Adds metadata to the current span. If no span information is found in the context, then no metadata is added.\n\n```java\nspan = tracer.start(\"EventHubs.process\", Context.NONE);\n tracer.setAttribute(\"bar\", \"baz\", span);\n```"
- uid: "com.azure.core.util.tracing.Tracer.setAttribute(java.lang.String,long,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setAttribute(String key, long value, Context context)"
name: "setAttribute(String key, long value, Context context)"
nameWithType: "Tracer.setAttribute(String key, long value, Context context)"
summary: "Sets long attribute."
modifiers:
- "default"
parameters:
- description: "attribute name"
name: "key"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "atteribute value"
name: "value"
type: "<xref href=\"long?alt=long&text=long\" data-throw-if-not-resolved=\"False\" />"
- description: "tracing context"
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default void setAttribute(String key, long value, Context context)"
desc: "Sets long attribute.\n\n```java\nContext span = tracer.start(\"EventHubs.process\", Context.NONE);\n tracer.setAttribute(\"foo\", 42, span);\n```"
- uid: "com.azure.core.util.tracing.Tracer.setSpanName(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.setSpanName(String spanName, Context context)"
name: "setSpanName(String spanName, Context context)"
nameWithType: "Tracer.setSpanName(String spanName, Context context)"
summary: "Sets the name for spans that are created."
deprecatedTag: "not needed."
modifiers:
- "default"
parameters:
- description: "Name to give the next span."
name: "spanName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context setSpanName(String spanName, Context context)"
desc: "Sets the name for spans that are created.\n\n**Code samples**\n\nRetrieve the span name of the returned span"
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the name of the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.start(String methodName, Context context)"
name: "start(String methodName, Context context)"
nameWithType: "Tracer.start(String methodName, Context context)"
summary: "Creates a new tracing span."
modifiers:
- "abstract"
parameters:
- description: "Name of the method triggering the span creation."
name: "methodName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public abstract Context start(String methodName, Context context)"
desc: "Creates a new tracing span.\n\nThe `context` will be checked for information about a parent span. If a parent span is found, the new span will be added as a child. Otherwise, the parent span will be created and added to the `context` and any downstream `start()` calls will use the created span as the parent.\n\n**Code samples**\n\nStarts a tracing span with provided method name and explicit parent span\n\n```java\n// start a new tracing span with given name and parent context implicitly propagated\n // in io.opentelemetry.context.Context.current()\n\n Throwable throwable = null;\n Context span = tracer.start(\"keyvault.setsecret\", Context.NONE);\n try {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, span);\n }\n```"
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.Context,com.azure.core.util.tracing.ProcessKind)"
fullName: "com.azure.core.util.tracing.Tracer.start(String spanName, Context context, ProcessKind processKind)"
name: "start(String spanName, Context context, ProcessKind processKind)"
nameWithType: "Tracer.start(String spanName, Context context, ProcessKind processKind)"
summary: "Creates a new tracing span for AMQP calls."
deprecatedTag: "use <xref uid=\"com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.tracing.StartSpanOptions,com.azure.core.util.Context)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Tracer#start(String, StartSpanOptions, Context)\"></xref> instead."
modifiers:
- "default"
parameters:
- description: "Name of the method triggering the span creation."
name: "spanName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- description: "AMQP operation kind."
name: "processKind"
type: "<xref href=\"com.azure.core.util.tracing.ProcessKind?alt=com.azure.core.util.tracing.ProcessKind&text=ProcessKind\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public default Context start(String spanName, Context context, ProcessKind processKind)"
desc: "Creates a new tracing span for AMQP calls.\n\nThe `context` will be checked for information about a parent span. If a parent span is found, the new span will be added as a child. Otherwise, the parent span will be created and added to the `context` and any downstream `start()` calls will use the created span as the parent.\n\nSets additional request attributes on the created span when `processKind` is <xref uid=\"com.azure.core.util.tracing.ProcessKind.SEND\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ProcessKind.SEND\"></xref>.\n\nReturns the diagnostic Id and span context of the returned span when `processKind` is <xref uid=\"com.azure.core.util.tracing.ProcessKind.MESSAGE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ProcessKind.MESSAGE\"></xref>.\n\nCreates a new tracing span with remote parent and returns that scope when the given when `processKind` is <xref uid=\"com.azure.core.util.tracing.ProcessKind.PROCESS\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ProcessKind.PROCESS\"></xref>.\n\n**Code samples**\n\nStarts a tracing span with provided method name and AMQP operation SEND"
hasDeprecatedTag: true
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.util.tracing.Tracer.start(java.lang.String,com.azure.core.util.tracing.StartSpanOptions,com.azure.core.util.Context)"
fullName: "com.azure.core.util.tracing.Tracer.start(String methodName, StartSpanOptions options, Context context)"
name: "start(String methodName, StartSpanOptions options, Context context)"
nameWithType: "Tracer.start(String methodName, StartSpanOptions options, Context context)"
summary: "Creates a new tracing span."
modifiers:
- "default"
parameters:
- description: "Name of the method triggering the span creation."
name: "methodName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "span creation options."
name: "options"
type: "<xref href=\"com.azure.core.util.tracing.StartSpanOptions?alt=com.azure.core.util.tracing.StartSpanOptions&text=StartSpanOptions\" data-throw-if-not-resolved=\"False\" />"
- description: "Additional metadata that is passed through the call stack."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public default Context start(String methodName, StartSpanOptions options, Context context)"
desc: "Creates a new tracing span.\n\nThe `context` will be checked for information about a parent span. If a parent span is found, the new span will be added as a child. Otherwise, the parent span will be created and added to the `context` and any downstream `start()` calls will use the created span as the parent.\n\n**Code samples**\n\nStarts a tracing span with provided method name and explicit parent span\n\n```java\n// start a new CLIENT tracing span with the given start options and explicit parent context\n StartSpanOptions options = new StartSpanOptions(SpanKind.CLIENT)\n .setAttribute(\"key\", \"value\");\n Context spanFromOptions = tracer.start(\"keyvault.setsecret\", options, Context.NONE);\n try {\n doWork();\n } catch (Throwable ex) {\n throwable = ex;\n } finally {\n tracer.end(null, throwable, spanFromOptions);\n }\n```"
returns:
description: "The updated <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> object containing the returned span."
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
type: "interface"
desc: "Contract that all tracers must implement to be pluggable into the SDK."
metadata: {}
package: "com.azure.core.util.tracing"
artifact: com.azure:azure-core:1.49.0