-
Notifications
You must be signed in to change notification settings - Fork 956
Add simple scope configuration to Tracer, Meter, Logger #3877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
ea68754
48b7f89
f0cf8a8
dd9e894
a4c527b
177e5bd
56f37b7
b9188c9
b262f64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ linkTitle: SDK | |
|
|
||
| # Tracing SDK | ||
|
|
||
| **Status**: [Stable](../document-status.md) | ||
| **Status**: [Stable](../document-status.md), except where otherwise specified | ||
|
|
||
| <details> | ||
| <summary>Table of Contents</summary> | ||
|
|
@@ -14,8 +14,11 @@ linkTitle: SDK | |
| - [Tracer Provider](#tracer-provider) | ||
| * [Tracer Creation](#tracer-creation) | ||
| * [Configuration](#configuration) | ||
| + [TracerConfigurator](#tracerconfigurator) | ||
jack-berg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * [Shutdown](#shutdown) | ||
| * [ForceFlush](#forceflush) | ||
| - [Tracer](#tracer) | ||
| * [TracerConfig](#tracerconfig) | ||
| - [Additional Span Interfaces](#additional-span-interfaces) | ||
| - [Sampling](#sampling) | ||
| * [Recording Sampled reaction table](#recording-sampled-reaction-table) | ||
|
|
@@ -68,12 +71,18 @@ The input provided by the user MUST be used to create | |
| an [`InstrumentationScope`](../glossary.md#instrumentation-scope) instance which | ||
| is stored on the created `Tracer`. | ||
|
|
||
| **Status**: [Experimental](../document-status.md) - The `TracerProvider` MUST | ||
| compute the relevant [TracerConfig](#tracerconfig) using the | ||
| configured [TracerConfigurator](#tracerconfigurator), and adjust | ||
| the `Tracer`'s behavior to conform to the `TracerConfig`. | ||
|
|
||
| ### Configuration | ||
|
|
||
| Configuration (i.e., [SpanProcessors](#span-processor), [IdGenerator](#id-generators), | ||
| [SpanLimits](#span-limits) and [`Sampler`](#sampling)) MUST be owned by the | ||
| the `TracerProvider`. The configuration MAY be applied at the time of `TracerProvider` | ||
| creation if appropriate. | ||
| Configuration ( | ||
| i.e., [SpanProcessors](#span-processor), [IdGenerator](#id-generators), [SpanLimits](#span-limits), [`Sampler`](#sampling), | ||
| and (**experimental**) [TracerConfigurator](#tracerconfigurator)) MUST be | ||
| owned by the `TracerProvider`. The configuration MAY be applied at the time | ||
| of `TracerProvider` creation if appropriate. | ||
|
|
||
| The TracerProvider MAY provide methods to update the configuration. If | ||
| configuration is updated (e.g., adding a `SpanProcessor`), | ||
|
|
@@ -84,6 +93,37 @@ Note: Implementation-wise, this could mean that `Tracer` instances have a | |
| reference to their `TracerProvider` and access configuration only via this | ||
| reference. | ||
|
|
||
| #### TracerConfigurator | ||
|
|
||
| **Status**: [Experimental](../document-status.md) | ||
|
|
||
| A `TracerConfigurator` is a function which computes | ||
| the [TracerConfig](#tracerconfig) for a [Tracer](#tracer). | ||
|
|
||
| The function MUST accept the following parameter: | ||
|
|
||
| * `tracer_scope`: | ||
| The [`InstrumentationScope`](../glossary.md#instrumentation-scope) of | ||
| the `Tracer`. | ||
|
|
||
| The function MUST return the relevant `TracerConfig`, or some signal indicating | ||
| that the [default TracerConfig](#tracerconfig) should be used. This signal MAY | ||
| be nil, null, empty, or an instance of the default `TracerConfig` depending on | ||
| what is idiomatic in the language. | ||
|
|
||
| This function is called when a `Tracer` is first created, and for each | ||
| outstanding `Tracer` when a `TracerProvider`'s `TracerConfigurator` is | ||
| updated (if updating is supported). Therefore, it is important that it returns | ||
| quickly. | ||
|
|
||
| `TracerConfigurator` is modeled as a function to maximize flexibility. | ||
| However, implementations MAY provide shorthand or helper functions to | ||
| accommodate common use cases: | ||
|
|
||
| * Select one or more Tracers by name, with exact match or pattern matching. | ||
| * Disable one or more specific Tracers. | ||
| * Disable all Tracers, and selectively enable one or more specific Tracers. | ||
|
|
||
| ### Shutdown | ||
|
|
||
| This method provides a way for provider to do any cleanup required. | ||
|
|
@@ -116,6 +156,29 @@ make the flush timeout configurable. | |
|
|
||
| `ForceFlush` MUST invoke `ForceFlush` on all registered `SpanProcessors`. | ||
|
|
||
| ## Tracer | ||
|
|
||
| **Status**: [Experimental](../document-status.md) - `Tracer` MUST behave | ||
| according to the [TracerConfig](#tracerconfig) computing | ||
jack-berg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| during [Tracer creation](#tracer-creation). If the `TracerProvider` supports | ||
| updating the [TracerConfigurator](#tracerconfigurator), then upon update | ||
| the `Tracer` MUST be updated to behave according to the new `TracerConfig`. | ||
jack-berg marked this conversation as resolved.
Show resolved
Hide resolved
pyohannes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### TracerConfig | ||
|
|
||
| **Status**: [Experimental](../document-status.md) | ||
|
|
||
| A `TracerConfig` defines various configurable aspects of a `Tracer`'s behavior. | ||
| It consists of the following parameters: | ||
|
|
||
| * `disabled`: A boolean indication of whether the Tracer is enabled. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jack-berg Is this a conscious choice to have this as When SDKs/Distros try to expose this as a configuration, 'enabled' seems natural and straightforward. Saying is enabled or not (enable=true seems natural as opposed to saying disabled=false, would say it is true for enabled=false vs disabled=true)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @lenin-jaganathan! can you add your comment to #4344? |
||
|
|
||
| If not explicitly set, the `disabled` parameter SHOULD default to `false` ( | ||
lmolkova marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| i.e. `Tracer`s are enabled by default). | ||
|
|
||
| If a `Tracer` is disabled, it MUST behave equivalently | ||
| to [No-op Tracer](./api.md#behavior-of-the-api-in-the-absence-of-an-installed-sdk). | ||
|
|
||
| ## Additional Span Interfaces | ||
|
|
||
| The [API-level definition for Span's interface](api.md#span-operations) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.