Skip to content

Commit

Permalink
Add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Dec 6, 2023
1 parent 87b9cc6 commit 90c167e
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions prototypes/python/README.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
OpenTelemetry Python SDK
============================================================================
OpenTelemetry Python Configuration Prototype
============================================

|pypi|
This prototype first needs the ``src/opentelemetry/configuration/_interna/path_function.py``
to be generated with the ``opentelemetry.configuration.render_schema`` function.

.. |pypi| image:: https://badge.fury.io/py/opentelemetry-sdk.svg
:target: https://pypi.org/project/opentelemetry-sdk/
Once this file is generated, implement the functions defined there.

Installation
------------
To create any provider object first create a ``Resource`` object:

::
.. code-block:: python
pip install opentelemetry-sdk
from opentelemetry.configuration._internal.path_function import set_resource
from opentelemetry.configuration import (
resolve_schema,
process_schema,
create_object,
validate_configuration,
)
from pathlib import Path
References
----------
data_path = Path(__file__).parent.joinpath("data")
* `OpenTelemetry Project <https://opentelemetry.io/>`_
configuration = validate_configuration(
data_path.joinpath("kitchen-sink.yaml")
)
processed_schema = process_schema(
resolve_schema(
data_path.joinpath("opentelemetry_configuration.json")
)
)
set_resource(
create_object(configuration, processed_schema, "resource")
)
tracer_provider = create_object(
configuration, processed_schema, "tracer_provider"
)

0 comments on commit 90c167e

Please sign in to comment.