From 41c12121a1a45943a41bbb5b3fa50de8aa137633 Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 12 Oct 2022 12:26:51 -0700 Subject: [PATCH 1/2] sem --- CHANGELOG.md | 2 ++ .../opentelemetry/semconv/metrics/__init__.py | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 879ec025985..0a1dbf1c585 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2947](https://github.com/open-telemetry/opentelemetry-python/pull/2947)) - `exporter-otlp-proto-http`: add user agent string ([#2959](https://github.com/open-telemetry/opentelemetry-python/pull/2959)) +- Add http-metric instrument names to semantic conventions + ([#2959](https://github.com/open-telemetry/opentelemetry-python/pull/2959)) ## [1.13.0-0.34b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.13.0) - 2022-09-26 diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py new file mode 100644 index 00000000000..e6dc8e1230c --- /dev/null +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -0,0 +1,31 @@ +# Copyright The OpenTelemetry Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# pylint: disable=too-many-lines + +class MetricInstruments: + + HTTP_SERVER_DURATION = "http.server.duration" + + HTTP_SERVER_REQUEST_SIZE = "http.server.request.size" + + HTTP_SERVER_RESPONSE_SIZE = "http.server.response.size" + + HTTP_SERVER_ACTIVE_REQUESTS = "http.server.active_requests" + + HTTP_CLIENT_DURATION = "http.client.duration" + + HTTP_CLIENT_REQUEST_SIZE = "http.client.request.size" + + HTTP_CLIENT_RESPONSE_SIZE = "http.client.response.size" From 4e444e26c5ead448185e9826943bda5d3a976b6a Mon Sep 17 00:00:00 2001 From: Leighton Chen Date: Wed, 12 Oct 2022 15:29:08 -0700 Subject: [PATCH 2/2] lint --- CHANGELOG.md | 2 +- .../src/opentelemetry/semconv/metrics/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1dbf1c585..7cab9302a09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `exporter-otlp-proto-http`: add user agent string ([#2959](https://github.com/open-telemetry/opentelemetry-python/pull/2959)) - Add http-metric instrument names to semantic conventions - ([#2959](https://github.com/open-telemetry/opentelemetry-python/pull/2959)) + ([#2976](https://github.com/open-telemetry/opentelemetry-python/pull/2976)) ## [1.13.0-0.34b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.13.0) - 2022-09-26 diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py index e6dc8e1230c..8ff6720165e 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/metrics/__init__.py @@ -14,8 +14,9 @@ # pylint: disable=too-many-lines + class MetricInstruments: - + HTTP_SERVER_DURATION = "http.server.duration" HTTP_SERVER_REQUEST_SIZE = "http.server.request.size"