Skip to content

Commit f450321

Browse files
committed
Rename to file configuration
1 parent 82115c4 commit f450321

23 files changed

+256
-131
lines changed

_configuration/README.rst

Lines changed: 0 additions & 44 deletions
This file was deleted.
File renamed without changes.

_file_configuration/README.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
OpenTelemetry Python File Configuration Prototype
2+
=================================================
3+
4+
This component is EXPERIMENTAL and subject to any kind of change at any moment.
5+
6+
This prototype first needs the ``src/opentelemetry/file_configuration/_interna/path_function.py``
7+
to be generated with the ``opentelemetry.file_configuration.render_schema`` function.
8+
9+
Once this file is generated, implement the functions defined there.
10+
11+
To create any provider object first create a ``Resource`` object:
12+
13+
.. code-block:: python
14+
15+
from opentelemetry.file_configuration._internal.path_function import set_resource
16+
from opentelemetry.file_configuration import (
17+
resolve_schema,
18+
process_schema,
19+
create_object,
20+
validate_file_configuration,
21+
)
22+
from pathlib import Path
23+
24+
data_path = Path(__file__).parent.joinpath("data")
25+
26+
file_configuration = validate_file_configuration(
27+
data_path.joinpath("kitchen-sink.yaml")
28+
)
29+
30+
processed_schema = process_schema(
31+
resolve_schema(
32+
data_path.joinpath("opentelemetry_file_configuration.json")
33+
)
34+
)
35+
36+
set_resource(
37+
create_object(file_configuration, processed_schema, "resource")
38+
)
39+
40+
tracer_provider = create_object(
41+
file_configuration, processed_schema, "tracer_provider"
42+
)
43+
44+
To run the tests, just run ``nox`` from the directory where ``noxfile.py`` is.

_configuration/noxfile.py renamed to _file_configuration/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def test(session):
1212
if session.posargs:
1313
session.run("pytest", *session.posargs)
1414
else:
15-
session.run("pytest", "tests/test_configuration.py")
15+
session.run("pytest", "tests/test_file_configuration.py")

_configuration/pyproject.toml renamed to _file_configuration/pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "opentelemetry-configuration"
6+
name = "opentelemetry-file-configuration"
77
dynamic = ["version"]
8-
description = "OpenTelemetry Python Configuration"
8+
description = "OpenTelemetry Python File Configuration"
99
readme = "README.rst"
1010
license = "Apache-2.0"
1111
requires-python = ">=3.7"
@@ -39,10 +39,13 @@ dependencies = [
3939
]
4040

4141
[project.urls]
42-
Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-configuration"
42+
Homepage = "https://github.com/open-telemetry/opentelemetry-python/tree/main/opentelemetry-file-configuration"
43+
44+
[project.entry-points.opentelemetry_id_generator]
45+
sometimes_monday_on_sampler = "opentelemetry.sdk.trace.id_generator:RandomIdGenerator"
4346

4447
[tool.hatch.version]
45-
path = "src/opentelemetry/configuration/version.py"
48+
path = "src/opentelemetry/file_configuration/version.py"
4649

4750
[tool.hatch.build.targets.sdist]
4851
include = [
File renamed without changes.

_configuration/src/opentelemetry/configuration/__init__.py renamed to _file_configuration/src/opentelemetry/file_configuration/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@
1313
# limitations under the License.
1414

1515
"""
16-
The OpenTelemetry Configuration package is an implementation of the
17-
OpenTelemetry Configuration Specification
16+
The OpenTelemetry File Configuration package is an implementation of the
17+
OpenTelemetry File Configuration Specification
1818
"""
1919

2020

21-
from opentelemetry.configuration._internal import (
21+
from opentelemetry.file_configuration._internal import (
2222
create_object,
23-
load_configuration,
23+
load_file_configuration,
2424
process_schema,
2525
render_schema,
2626
resolve_schema,
2727
substitute_environment_variables,
28-
validate_configuration,
28+
validate_file_configuration,
2929
)
3030

3131
__all__ = [
3232
"resolve_schema",
33-
"validate_configuration",
33+
"validate_file_configuration",
3434
"process_schema",
3535
"render_schema",
3636
"create_object",
37-
"load_configuration",
37+
"load_file_configuration",
3838
"substitute_environment_variables",
3939
]

0 commit comments

Comments
 (0)