-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) |