Skip to content
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

Update semconv to 1.21.0 #3251

Merged
merged 22 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[codespell]
# skipping auto generated folders
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions
ignore-words-list = ans,ue,ot,hist,ro
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:

# Contrib unit test suite in order to ensure changes in core do not break anything in contrib.
# We only run contrib unit tests on the oldest supported Python version (3.7) as running the same tests
# on all versions is somewhat redundant.
# on all versions is somewhat redundant.
contrib-build:
env:
# We use these variables to convert between tox and GHA version literals
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ target
# Django example

docs/examples/django/db.sqlite3

# Semantic conventions
scripts/semconv/semantic-conventions
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3442](https://github.com/open-telemetry/opentelemetry-python/pull/3442))
- Do not load Resource on sdk import
([#3447](https://github.com/open-telemetry/opentelemetry-python/pull/3447))
- Update semantic conventions to version 1.21.0
([#3251](https://github.com/open-telemetry/opentelemetry-python/pull/3251))

## Version 1.20.0/0.41b0 (2023-09-04)

Expand All @@ -29,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3372](https://github.com/open-telemetry/opentelemetry-python/pull/3372))
- Update the body type in the log
([$3343](https://github.com/open-telemetry/opentelemetry-python/pull/3343))
- Add max_scale option to Exponential Bucket Histogram Aggregation
- Add max_scale option to Exponential Bucket Histogram Aggregation
([#3323](https://github.com/open-telemetry/opentelemetry-python/pull/3323))
- Use BoundedAttributes instead of raw dict to extract attributes from LogRecord
([#3310](https://github.com/open-telemetry/opentelemetry-python/pull/3310))
Expand Down
18 changes: 8 additions & 10 deletions docs/examples/django/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,14 @@ output similar to this one:
"status_code": "OK"
},
"attributes": {
"http.method": "GET",
"http.server_name": "localhost",
"http.scheme": "http",
"host.port": 8000,
"http.host": "localhost:8000",
"http.url": "http://localhost:8000/?param=hello",
"net.peer.ip": "127.0.0.1",
"http.flavor": "1.1",
"http.status_text": "OK",
"http.status_code": 200
"http.request.method": "GET",
"server.address": "localhost",
"url.scheme": "http",
"server.port": 8000,
"url.full": "http://localhost:8000/?param=hello",
"server.socket.address": "127.0.0.1",
"network.protocol.version": "1.1",
"http.response.status_code": 200
},
"events": [],
"links": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ def get_meter(
name: str,
version: str = "",
meter_provider: Optional[MeterProvider] = None,
schema_url: Optional[str] = None,
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
) -> "Meter":
"""Returns a `Meter` for use by the given instrumentation library.

Expand All @@ -729,7 +730,7 @@ def get_meter(
"""
if meter_provider is None:
meter_provider = get_meter_provider()
return meter_provider.get_meter(name, version)
return meter_provider.get_meter(name, version, schema_url)
lzchen marked this conversation as resolved.
Show resolved Hide resolved


def _set_meter_provider(meter_provider: MeterProvider, log: bool) -> None:
Expand Down
14 changes: 7 additions & 7 deletions opentelemetry-sdk/tests/trace/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,12 @@ def test_attributes(self):
with self.tracer.start_as_current_span("root") as root:
root.set_attributes(
{
"http.method": "GET",
"http.url": "https://example.com:779/path/12/?q=d#123",
"http.request.method": "GET",
"url.full": "https://example.com:779/path/12/?q=d#123",
}
)

root.set_attribute("http.status_code", 200)
root.set_attribute("http.response.status_code", 200)
root.set_attribute("http.status_text", "OK")
root.set_attribute("misc.pi", 3.14)

Expand All @@ -661,12 +661,12 @@ def test_attributes(self):
root.set_attribute("list-of-numerics", list_of_numerics)

self.assertEqual(len(root.attributes), 9)
self.assertEqual(root.attributes["http.method"], "GET")
self.assertEqual(root.attributes["http.request.method"], "GET")
self.assertEqual(
root.attributes["http.url"],
root.attributes["url.full"],
"https://example.com:779/path/12/?q=d#123",
)
self.assertEqual(root.attributes["http.status_code"], 200)
self.assertEqual(root.attributes["http.response.status_code"], 200)
self.assertEqual(root.attributes["http.status_text"], "OK")
self.assertEqual(root.attributes["misc.pi"], 3.14)
self.assertEqual(root.attributes["attr-key"], "attr-value2")
Expand Down Expand Up @@ -1007,7 +1007,7 @@ def test_ended_span(self):
self.assertEqual(end_time0, root.end_time)

with self.assertLogs(level=WARNING):
root.set_attribute("http.method", "GET")
root.set_attribute("http.request.method", "GET")
self.assertEqual(len(root.attributes), 0)

with self.assertLogs(level=WARNING):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,47 @@
class MetricInstruments:

HTTP_SERVER_DURATION = "http.server.duration"
"""
lzchen marked this conversation as resolved.
Show resolved Hide resolved
Deprecated. Use `http.server.request.duration` metric.
"""

HTTP_SERVER_REQUEST_SIZE = "http.server.request.size"
"""
Deprecated. Use `http.server.request.body.size` metric.
"""

HTTP_SERVER_RESPONSE_SIZE = "http.server.response.size"

HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests"
"""
Deprecated. Use `http.server.response.body.size` metric.
"""

HTTP_CLIENT_DURATION = "http.client.duration"
"""
Deprecated. Use `http.client.request.duration` metric.
"""

HTTP_CLIENT_REQUEST_SIZE = "http.client.request.size"
"""
Deprecated. Use `http.client.response.body.size` metric.
"""

HTTP_CLIENT_RESPONSE_SIZE = "http.client.response.size"
"""
Deprecated. Use `http.client.response.body.size` metric.
"""

HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration"

HTTP_SERVER_REQUEST_BODY_SIZE = "http.server.request.body.size"

HTTP_SERVER_RESPONSE_BODY_SIZE = "http.server.response.body.size"

HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests"

HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration"

HTTP_CLIENT_REQUEST_BODY_SIZE = "http.client.request.body.size"

HTTP_CLIENT_RESPONSE_BODY_SIZE = "http.client.response.body.size"

DB_CLIENT_CONNECTIONS_USAGE = "db.client.connections.usage"
Loading
Loading