Skip to content

Commit 4d6ea98

Browse files
committed
readme
1 parent 7abd029 commit 4d6ea98

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

inferred-spans/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,32 @@ So if you are using an autoconfigured OpenTelemetry SDK, you'll only need to add
4242
| otel.inferred.spans.duration <br/> OTEL_INFERRED_SPANS_DURATION | `5s` | The duration of a profiling session. For sampled transactions which fall within a profiling session (they start after and end before the session), so-called inferred spans will be created. They appear in the trace waterfall view like regular spans. <br/> NOTE: It is not recommended to set much higher durations as it may fill the activation events file and async-profiler's frame buffer. Warnings will be logged if the activation events file is full. If you want to have more profiling coverage, try decreasing `profiling_inferred_spans_interval` |
4343
| otel.inferred.spans.lib.directory <br/> OTEL_INFERRED_SPANS_LIB_DIRECTORY | Defaults to the value of `java.io.tmpdir` | Profiling requires that the [async-profiler](https://github.com/async-profiler/async-profiler) shared library is exported to a temporary location and loaded by the JVM. The partition backing this location must be executable, however in some server-hardened environments, `noexec` may be set on the standard `/tmp` partition, leading to `java.lang.UnsatisfiedLinkError` errors. Set this property to an alternative directory (e.g. `/var/tmp`) to resolve this. |
4444
| otel.inferred.spans.parent.override.handler <br/> OTEL_INFERRED_SPANS_PARENT_OVERRIDE_HANDLER | Defaults to a handler adding span-links to the inferred span | Inferred spans sometimes need to be inserted as the new parent of a normal span, which is not directly possible because that span has already been sent. For this reason, this relationship needs to be represented differently, which normally is done by adding a span-link to the inferred span. This configuration can be used to override that behaviour by providing the fully qualified name of a class implementing `BiConsumer<SpanBuilder, SpanContext>`: The biconsumer will be invoked with the inferred span as first argument and the span for which the inferred one was detected as new parent as second argument |
45+
46+
47+
### Usage with declarative configuration
48+
49+
You can configure the inferred spans processor using declarative YAML configuration with the
50+
OpenTelemetry SDK. For example:
51+
52+
```yaml
53+
file_format: 0.4
54+
tracer_provider:
55+
processors:
56+
- inferred-spans:
57+
enabled: true
58+
sampling_interval: 25ms
59+
included_classes: "org.example.myapp.*"
60+
excluded_classes: "java.*"
61+
min_duration: 10ms
62+
interval: 5s
63+
duration: 5s
64+
lib_directory: "/var/tmp"
65+
parent_override_handler: "com.example.MyParentOverrideHandler"
66+
```
67+
68+
All the same settings as for [autoconfiguration](#autoconfiguration) can be used here,
69+
just with the `otel.inferred.spans.` prefix stripped.
70+
For example, `otel.inferred.spans.sampling.interval` becomes `sampling_interval` in YAML.
4571

4672
### Manual SDK setup
4773

0 commit comments

Comments
 (0)