Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b615804

Browse files
c24tAlex Botenocelotl
authored
Correlation context docs (open-telemetry#490)
Co-authored-by: Alex Boten <[email protected]> Co-authored-by: Diego Hurtado <[email protected]>
1 parent 4e551ba commit b615804

File tree

5 files changed

+32
-7
lines changed

5 files changed

+32
-7
lines changed

docs/api/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ OpenTelemetry Python API
88

99
configuration
1010
context
11+
correlationcontext
1112
metrics
1213
trace
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
opentelemetry.correlationcontext.propagation package
2+
====================================================
3+
4+
Module contents
5+
---------------
6+
7+
.. automodule:: opentelemetry.correlationcontext.propagation

docs/api/correlationcontext.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
opentelemetry.correlationcontext package
2+
========================================
3+
4+
Subpackages
5+
-----------
6+
7+
.. toctree::
8+
9+
correlationcontext.propagation
10+
11+
Module contents
12+
---------------
13+
14+
.. automodule:: opentelemetry.correlationcontext

opentelemetry-api/src/opentelemetry/correlationcontext/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import abc
1615
import typing
1716

1817
from opentelemetry.context import get_value, set_value
@@ -24,7 +23,7 @@
2423
def get_correlations(
2524
context: typing.Optional[Context] = None,
2625
) -> typing.Dict[str, object]:
27-
""" Returns the name/value pairs in the CorrelationContext
26+
"""Returns the name/value pairs in the CorrelationContext
2827
2928
Args:
3029
context: The Context to use. If not set, uses current Context
@@ -41,7 +40,8 @@ def get_correlations(
4140
def get_correlation(
4241
name: str, context: typing.Optional[Context] = None
4342
) -> typing.Optional[object]:
44-
""" Provides access to the value for a name/value pair in the CorrelationContext
43+
"""Provides access to the value for a name/value pair in the
44+
CorrelationContext
4545
4646
Args:
4747
name: The name of the value to retrieve
@@ -76,6 +76,7 @@ def remove_correlation(
7676
name: str, context: typing.Optional[Context] = None
7777
) -> Context:
7878
"""Removes a value from the CorrelationContext
79+
7980
Args:
8081
name: The name of the value to remove
8182
context: The Context to use. If not set, uses current Context
@@ -91,6 +92,7 @@ def remove_correlation(
9192

9293
def clear_correlations(context: typing.Optional[Context] = None) -> Context:
9394
"""Removes all values from the CorrelationContext
95+
9496
Args:
9597
context: The Context to use. If not set, uses current Context
9698

opentelemetry-api/src/opentelemetry/correlationcontext/propagation/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
#
15-
import re
1615
import typing
1716
import urllib.parse
1817

@@ -36,9 +35,10 @@ def extract(
3635
carrier: httptextformat.HTTPTextFormatT,
3736
context: typing.Optional[Context] = None,
3837
) -> Context:
39-
""" Extract CorrelationContext from the carrier.
38+
"""Extract CorrelationContext from the carrier.
4039
41-
See `opentelemetry.trace.propagation.httptextformat.HTTPTextFormat.extract`
40+
See
41+
`opentelemetry.trace.propagation.httptextformat.HTTPTextFormat.extract`
4242
"""
4343

4444
if context is None:
@@ -79,7 +79,8 @@ def inject(
7979
) -> None:
8080
"""Injects CorrelationContext into the carrier.
8181
82-
See `opentelemetry.trace.propagation.httptextformat.HTTPTextFormat.inject`
82+
See
83+
`opentelemetry.trace.propagation.httptextformat.HTTPTextFormat.inject`
8384
"""
8485
correlations = correlationcontext.get_correlations(context=context)
8586
if not correlations:

0 commit comments

Comments
 (0)