Skip to content

Commit

Permalink
more clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Jun 10, 2024
1 parent c868525 commit 5b3de7d
Show file tree
Hide file tree
Showing 23 changed files with 270 additions and 286 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

from enum import Enum

from deprecated import deprecated

DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level"
"""
The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
Expand Down Expand Up @@ -214,16 +212,6 @@
Deprecated: No replacement at this time.
"""

POOL_NAME = "pool.name"
"""
Deprecated: Replaced by `db.client.connections.pool.name`.
"""

STATE = "state"
"""
Deprecated: Replaced by `db.client.connections.state`.
"""


class DbCassandraConsistencyLevelValues(Enum):
ALL = "all"
Expand Down Expand Up @@ -402,13 +390,3 @@ class DbSystemValues(Enum):
"""Cloud Spanner."""
TRINO = "trino"
"""Trino."""


@deprecated(
reason="The attribute state is deprecated - Replaced by `db.client.connections.state`"
)
class StateValues(Enum):
IDLE = "idle"
"""idle."""
USED = "used"
"""used."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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.


from enum import Enum

from deprecated import deprecated

MESSAGE_COMPRESSED_SIZE = "message.compressed_size"
"""
Deprecated: Replaced by `rpc.message.compressed_size`.
"""

MESSAGE_ID = "message.id"
"""
Deprecated: Replaced by `rpc.message.id`.
"""

MESSAGE_TYPE = "message.type"
"""
Deprecated: Replaced by `rpc.message.type`.
"""

MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size"
"""
Deprecated: Replaced by `rpc.message.uncompressed_size`.
"""


@deprecated(
reason="The attribute message.type is deprecated - Replaced by `rpc.message.type`"
)
class MessageTypeValues(Enum):
SENT = "SENT"
"""sent."""
RECEIVED = "RECEIVED"
"""received."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# 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.


from enum import Enum

from deprecated import deprecated

NET_HOST_IP = "net.host.ip"
"""
Deprecated: Replaced by `network.local.address`.
"""

NET_HOST_NAME = "net.host.name"
"""
Deprecated: Replaced by `server.address`.
"""

NET_HOST_PORT = "net.host.port"
"""
Deprecated: Replaced by `server.port`.
"""

NET_PEER_IP = "net.peer.ip"
"""
Deprecated: Replaced by `network.peer.address`.
"""

NET_PEER_NAME = "net.peer.name"
"""
Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans.
"""

NET_PEER_PORT = "net.peer.port"
"""
Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans.
"""

NET_PROTOCOL_NAME = "net.protocol.name"
"""
Deprecated: Replaced by `network.protocol.name`.
"""

NET_PROTOCOL_VERSION = "net.protocol.version"
"""
Deprecated: Replaced by `network.protocol.version`.
"""

NET_SOCK_FAMILY = "net.sock.family"
"""
Deprecated: Split to `network.transport` and `network.type`.
"""

NET_SOCK_HOST_ADDR = "net.sock.host.addr"
"""
Deprecated: Replaced by `network.local.address`.
"""

NET_SOCK_HOST_PORT = "net.sock.host.port"
"""
Deprecated: Replaced by `network.local.port`.
"""

NET_SOCK_PEER_ADDR = "net.sock.peer.addr"
"""
Deprecated: Replaced by `network.peer.address`.
"""

NET_SOCK_PEER_NAME = "net.sock.peer.name"
"""
Deprecated: Removed.
"""

NET_SOCK_PEER_PORT = "net.sock.peer.port"
"""
Deprecated: Replaced by `network.peer.port`.
"""

NET_TRANSPORT = "net.transport"
"""
Deprecated: Replaced by `network.transport`.
"""


@deprecated(
reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`"
)
class NetSockFamilyValues(Enum):
INET = "inet"
"""IPv4 address."""
INET6 = "inet6"
"""IPv6 address."""
UNIX = "unix"
"""Unix domain socket path."""


@deprecated(
reason="The attribute net.transport is deprecated - Replaced by `network.transport`"
)
class NetTransportValues(Enum):
IP_TCP = "ip_tcp"
"""ip_tcp."""
IP_UDP = "ip_udp"
"""ip_udp."""
PIPE = "pipe"
"""Named or anonymous pipe."""
INPROC = "inproc"
"""In-process communication."""
OTHER = "other"
"""Something else (non IP-based)."""
Original file line number Diff line number Diff line change
Expand Up @@ -17,81 +17,6 @@

from deprecated import deprecated

NET_HOST_IP = "net.host.ip"
"""
Deprecated: Replaced by `network.local.address`.
"""

NET_HOST_NAME = "net.host.name"
"""
Deprecated: Replaced by `server.address`.
"""

NET_HOST_PORT = "net.host.port"
"""
Deprecated: Replaced by `server.port`.
"""

NET_PEER_IP = "net.peer.ip"
"""
Deprecated: Replaced by `network.peer.address`.
"""

NET_PEER_NAME = "net.peer.name"
"""
Deprecated: Replaced by `server.address` on client spans and `client.address` on server spans.
"""

NET_PEER_PORT = "net.peer.port"
"""
Deprecated: Replaced by `server.port` on client spans and `client.port` on server spans.
"""

NET_PROTOCOL_NAME = "net.protocol.name"
"""
Deprecated: Replaced by `network.protocol.name`.
"""

NET_PROTOCOL_VERSION = "net.protocol.version"
"""
Deprecated: Replaced by `network.protocol.version`.
"""

NET_SOCK_FAMILY = "net.sock.family"
"""
Deprecated: Split to `network.transport` and `network.type`.
"""

NET_SOCK_HOST_ADDR = "net.sock.host.addr"
"""
Deprecated: Replaced by `network.local.address`.
"""

NET_SOCK_HOST_PORT = "net.sock.host.port"
"""
Deprecated: Replaced by `network.local.port`.
"""

NET_SOCK_PEER_ADDR = "net.sock.peer.addr"
"""
Deprecated: Replaced by `network.peer.address`.
"""

NET_SOCK_PEER_NAME = "net.sock.peer.name"
"""
Deprecated: Removed.
"""

NET_SOCK_PEER_PORT = "net.sock.peer.port"
"""
Deprecated: Replaced by `network.peer.port`.
"""

NET_TRANSPORT = "net.transport"
"""
Deprecated: Replaced by `network.transport`.
"""

NETWORK_CARRIER_ICC = "network.carrier.icc"
"""
The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.
Expand Down Expand Up @@ -168,34 +93,6 @@
"""


@deprecated(
reason="The attribute net.sock.family is deprecated - Split to `network.transport` and `network.type`"
)
class NetSockFamilyValues(Enum):
INET = "inet"
"""IPv4 address."""
INET6 = "inet6"
"""IPv6 address."""
UNIX = "unix"
"""Unix domain socket path."""


@deprecated(
reason="The attribute net.transport is deprecated - Replaced by `network.transport`"
)
class NetTransportValues(Enum):
IP_TCP = "ip_tcp"
"""ip_tcp."""
IP_UDP = "ip_udp"
"""ip_udp."""
PIPE = "pipe"
"""Named or anonymous pipe."""
INPROC = "inproc"
"""In-process communication."""
OTHER = "other"
"""Something else (non IP-based)."""


class NetworkConnectionSubtypeValues(Enum):
GPRS = "gprs"
"""GPRS."""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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.


from enum import Enum

from deprecated import deprecated

STATE = "state"
"""
Deprecated: Replaced by `db.client.connections.state`.
"""


@deprecated(
reason="The attribute state is deprecated - Replaced by `db.client.connections.state`"
)
class StateValues(Enum):
IDLE = "idle"
"""idle."""
USED = "used"
"""used."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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.


POOL_NAME = "pool.name"
"""
Deprecated: Replaced by `db.client.connections.pool.name`.
"""
Loading

0 comments on commit 5b3de7d

Please sign in to comment.