diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py index ef4b1bda2f2..4c24bd27bbe 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/error_attributes.py @@ -23,9 +23,7 @@ """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.error_attributes.ErrorTypeValues`.") # type: ignore class ErrorTypeValues(Enum): OTHER: Final = "_OTHER" """A fallback error value to be used when the instrumentation doesn't define a custom value.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py index afd8ef05486..ee1bbf0b262 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/http_attributes.py @@ -130,9 +130,7 @@ class HttpConnectionStateValues(Enum): """idle state.""" -@deprecated( - reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`" -) +@deprecated(reason="The attribute http.flavor is deprecated - Replaced by `network.protocol.name`") # type: ignore class HttpFlavorValues(Enum): HTTP_1_0: Final = "1.0" """HTTP/1.0.""" @@ -148,9 +146,7 @@ class HttpFlavorValues(Enum): """QUIC protocol.""" -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.http_attributes.HttpRequestMethodValues`.") # type: ignore class HttpRequestMethodValues(Enum): CONNECT: Final = "CONNECT" """CONNECT method.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py index 47642ead07e..ca20c1ed323 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/messaging_attributes.py @@ -10,9 +10,8 @@ # 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. - -from enum import Enum +# limitations under t +from typing from enum import Enum from typing import Final MESSAGING_BATCH_MESSAGE_COUNT: Final = "messaging.batch.message_count" @@ -26,12 +25,6 @@ A unique identifier for the client that consumes or produces a message. """ -MESSAGING_CLIENT_ID: Final = "messaging.client.id" -""" -TEST ME -""" - - MESSAGING_DESTINATION_ANONYMOUS: Final = "messaging.destination.anonymous" """ A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). @@ -319,3 +312,14 @@ class MessagingSystemValues(Enum): """RabbitMQ.""" ROCKETMQ: Final = "rocketmq" """Apache RocketMQ.""" +e Bus.""" + GCP_PUBSUB: Final = "gcp_pubsub" + """Google Cloud Pub/Sub.""" + JMS: Final = "jms" + """Java Message Service.""" + KAFKA: Final = "kafka" + """Apache Kafka.""" + RABBITMQ: Final = "rabbitmq" + """RabbitMQ.""" + ROCKETMQ: Final = "rocketmq" +""Apache RocketMQ.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py index 47cfa641a69..1f48da2799d 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/net_attributes.py @@ -83,9 +83,7 @@ """ -@deprecated( - reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`" -) +@deprecated(reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`") # type: ignore class NetSockFamilyValues(Enum): INET: Final = "inet" """IPv4 address.""" @@ -95,9 +93,7 @@ class NetSockFamilyValues(Enum): """Unix domain socket path.""" -@deprecated( - reason="The attribute net.transport is deprecated - Replaced by `network.transport`" -) +@deprecated(reason="The attribute net.transport is deprecated - Replaced by `network.transport`") # type: ignore class NetTransportValues(Enum): IP_TCP: Final = "ip_tcp" """ip_tcp.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py index 240e878ccfd..7474e391bde 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/network_attributes.py @@ -158,9 +158,7 @@ class NetworkIoDirectionValues(Enum): """receive.""" -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTransportValues`.") # type: ignore class NetworkTransportValues(Enum): TCP: Final = "tcp" """TCP.""" @@ -172,9 +170,7 @@ class NetworkTransportValues(Enum): """Unix domain socket.""" -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.network_attributes.NetworkTypeValues`.") # type: ignore class NetworkTypeValues(Enum): IPV4: Final = "ipv4" """IPv4.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py index b3104328585..5ee8ad13bfa 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/otel_attributes.py @@ -48,9 +48,7 @@ """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.otel_attributes.OtelStatusCodeValues`.") # type: ignore class OtelStatusCodeValues(Enum): OK: Final = "OK" """The operation has been validated by an Application developer or Operator to have completed successfully.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py index 2d717f0f01d..2ba8699a8a0 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/system_attributes.py @@ -201,9 +201,7 @@ class SystemProcessStatusValues(Enum): """defunct.""" -@deprecated( - reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`" -) +@deprecated(reason="The attribute system.processes.status is deprecated - Replaced by `system.process.status`") # type: ignore class SystemProcessesStatusValues(Enum): RUNNING: Final = "running" """running.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py index 9dbff213c3f..8f0eac938ca 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/attributes/telemetry_attributes.py @@ -45,9 +45,7 @@ """ -@deprecated( - reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`." -) +@deprecated(reason="Deprecated in favor of stable :py:const:`opentelemetry.semconv.attributes.telemetry_attributes.TelemetrySdkLanguageValues`.") # type: ignore class TelemetrySdkLanguageValues(Enum): CPP: Final = "cpp" """cpp.""" diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py index 09d99824fd0..946064807da 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/process_metrics.py @@ -13,15 +13,29 @@ # limitations under the License. -from typing import Callable, Final, Sequence +from typing import ( + Callable, + Final, + Generator, + Iterable, + Optional, + Sequence, + Union, +) from opentelemetry.metrics import ( + CallbackOptions, Counter, Meter, ObservableGauge, + Observation, UpDownCounter, ) +CallbackT = Union[ + Callable[[CallbackOptions], Iterable[Observation]], + Generator[Iterable[Observation], CallbackOptions, None], +] PROCESS_CONTEXT_SWITCHES: Final = "process.context_switches" """ Number of times the process has been context switched @@ -65,12 +79,12 @@ def create_process_cpu_time(meter: Meter) -> Counter: def create_process_cpu_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: """Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process""" return meter.create_observable_gauge( name="process.cpu.utilization", - callback=callback, + callbacks=callbacks, description="Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process.", unit="1", ) diff --git a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py index 3cf60e142bb..bba30038bff 100644 --- a/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py +++ b/opentelemetry-semantic-conventions/src/opentelemetry/semconv/_incubating/metrics/system_metrics.py @@ -13,15 +13,29 @@ # limitations under the License. -from typing import Callable, Final, Sequence +from typing import ( + Callable, + Final, + Generator, + Iterable, + Optional, + Sequence, + Union, +) from opentelemetry.metrics import ( + CallbackOptions, Counter, Meter, ObservableGauge, + Observation, UpDownCounter, ) +CallbackT = Union[ + Callable[[CallbackOptions], Iterable[Observation]], + Generator[Iterable[Observation], CallbackOptions, None], +] SYSTEM_CPU_FREQUENCY: Final = "system.cpu.frequency" """ Reports the current frequency of the CPU in Hz @@ -31,12 +45,12 @@ def create_system_cpu_frequency( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: """Reports the current frequency of the CPU in Hz""" return meter.create_observable_gauge( name="system.cpu.frequency", - callback=callback, + callbacks=callbacks, description="Reports the current frequency of the CPU in Hz", unit="{Hz}", ) @@ -102,12 +116,12 @@ def create_system_cpu_time(meter: Meter) -> Counter: def create_system_cpu_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: """Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs""" return meter.create_observable_gauge( name="system.cpu.utilization", - callback=callback, + callbacks=callbacks, description="Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs", unit="1", ) @@ -225,11 +239,11 @@ def create_system_filesystem_usage(meter: Meter) -> UpDownCounter: def create_system_filesystem_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: return meter.create_observable_gauge( name="system.filesystem.utilization", - callback=callback, + callbacks=callbacks, description="", unit="1", ) @@ -302,11 +316,11 @@ def create_system_memory_usage(meter: Meter) -> UpDownCounter: def create_system_memory_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: return meter.create_observable_gauge( name="system.memory.utilization", - callback=callback, + callbacks=callbacks, description="", unit="1", ) @@ -456,11 +470,11 @@ def create_system_paging_usage(meter: Meter) -> UpDownCounter: def create_system_paging_utilization( - meter: Meter, callback: Sequence[Callable] + meter: Meter, callbacks: Optional[Sequence[CallbackT]] ) -> ObservableGauge: return meter.create_observable_gauge( name="system.paging.utilization", - callback=callback, + callbacks=callbacks, description="", unit="1", )