We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[opentelemetry-instrumentation-redis] Stop sending db.name argument or rename it to redis[0-15]
Hi! I've been recently playing with OpenTelemetry for Python (Flask) application and noticed that for Redis **db.name** argument is send to OpenTelemetry collector which seems to be a number of database (integer). This seems to be incorrect as in Redis there is no db name concept (databases are numbered from 0 to 15). Technically, it shouldn't be any problem with that but it may break some OpenTelemetry backends which expects a real DB name not a number. I have done some additional debugging and found that for node.js and .NET **db.name** argument is not send to collector. Shouldn't we have some consistency here?

**Describe your environment** 

$ python --version
Python 3.8.13
$ 
$ pip list | grep 'opentelemetry\|redis'
opentelemetry-api                        1.13.0
opentelemetry-distro                     0.34b0
opentelemetry-exporter-otlp              1.13.0
opentelemetry-exporter-otlp-proto-grpc   1.13.0
opentelemetry-exporter-otlp-proto-http   1.13.0
opentelemetry-instrumentation            0.34b0
opentelemetry-instrumentation-aws-lambda 0.34b0
opentelemetry-instrumentation-dbapi      0.34b0
opentelemetry-instrumentation-flask      0.34b0
opentelemetry-instrumentation-grpc       0.34b0
opentelemetry-instrumentation-jinja2     0.34b0
opentelemetry-instrumentation-logging    0.34b0
opentelemetry-instrumentation-redis      0.34b0
opentelemetry-instrumentation-requests   0.34b0
opentelemetry-instrumentation-sqlite3    0.34b0
opentelemetry-instrumentation-urllib     0.34b0
opentelemetry-instrumentation-urllib3    0.34b0
opentelemetry-instrumentation-wsgi       0.34b0
opentelemetry-propagator-aws-xray        1.0.1
opentelemetry-proto                      1.13.0
opentelemetry-sdk                        1.13.0
opentelemetry-semantic-conventions       0.34b0
opentelemetry-util-http                  0.34b0
redis                                    4.3.4

**Steps to reproduce**
Any Python app with connection to Redis will show this behavior.

**What is the expected behavior?**
Stop sending db.name argument or rename it to redis[0-15]

**What is the actual behavior?**
The db.name argument is send as a number of Redis database.

**Additional context**

Please see below some logs from OpenTelemetry collector for python and node.js to see a difference.

===> PYTHON EXAMPLE

ScopeSpans #0
ScopeSpans SchemaURL: 
InstrumentationScope opentelemetry.instrumentation.redis 0.34b0
Span #0
    Trace ID       : 4bc10b43ab0a0d3042f38ebbb32baef1
    Parent ID      : 79e2aed933827894
    ID             : 22f4fba607e73a33
    Name           : HMSET
    Kind           : SPAN_KIND_CLIENT
    Start time     : 2022-10-21 09:40:50.606962566 +0000 UTC
    End time       : 2022-10-21 09:40:50.609568624 +0000 UTC
    Status code    : STATUS_CODE_UNSET
    Status message : 
Attributes:
     -> db.statement: STRING(HMSET person1-hash name jane age 20)
     -> db.system: STRING(redis)
     -> db.name: INT(0)
     -> db.redis.database_index: INT(0)
     -> net.peer.name: STRING(redis-svc)
     -> net.peer.port: STRING(6379)
     -> net.transport: STRING(ip_tcp)
     -> db.redis.args_length: INT(6)


===> NODEJS EXAMPLE

ScopeSpans #0
ScopeSpans SchemaURL: 
InstrumentationScope @opentelemetry/instrumentation-redis-4 0.33.0
Span #0
    Trace ID       : 21a071f4d1d7c860ecb758398d304f60
    Parent ID      : 1bbf5328c079ceda
    ID             : 13dc47b2521f7f82
    Name           : redis-GET
    Kind           : SPAN_KIND_CLIENT
    Start time     : 2022-10-21 09:47:16.9553723 +0000 UTC
    End time       : 2022-10-21 09:47:16.957585 +0000 UTC
    Status code    : STATUS_CODE_UNSET
    Status message : 
Attributes:
     -> db.system: STRING(redis)
     -> net.peer.name: STRING(redis-svc)
     -> net.peer.port: INT(6379)
     -> db.statement: STRING(GET)
ResourceSpans #4
Resource SchemaURL: 
Resource labels:
     -> service.name: STRING(nodejs-redis)
     -> telemetry.sdk.language: STRING(nodejs)
     -> telemetry.sdk.name: STRING(opentelemetry)
     -> telemetry.sdk.version: STRING(0.24.0)
     
I am happy to contribute to it by reviewing the code fix and testing the behavior.

@svrnm @sanketmehta28
    

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py`
Content:
```
1 # Copyright The OpenTelemetry Authors
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15 """
16 Some utils used by the redis integration
17 """
18 from opentelemetry.semconv.trace import (
19     DbSystemValues,
20     NetTransportValues,
21     SpanAttributes,
22 )
23 
24 
25 def _extract_conn_attributes(conn_kwargs):
26     """Transform redis conn info into dict"""
27     attributes = {
28         SpanAttributes.DB_SYSTEM: DbSystemValues.REDIS.value,
29     }
30     db = conn_kwargs.get("db", 0)
31     attributes[SpanAttributes.DB_NAME] = db
32     attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX] = db
33     try:
34         attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(
35             "host", "localhost"
36         )
37         attributes[SpanAttributes.NET_PEER_PORT] = conn_kwargs.get(
38             "port", 6379
39         )
40         attributes[
41             SpanAttributes.NET_TRANSPORT
42         ] = NetTransportValues.IP_TCP.value
43     except KeyError:
44         attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get("path", "")
45         attributes[
46             SpanAttributes.NET_TRANSPORT
47         ] = NetTransportValues.UNIX.value
48 
49     return attributes
50 
51 
52 def _format_command_args(args):
53     """Format command arguments and trim them as needed"""
54     value_max_len = 100
55     value_too_long_mark = "..."
56     cmd_max_len = 1000
57     length = 0
58     out = []
59     for arg in args:
60         cmd = str(arg)
61 
62         if len(cmd) > value_max_len:
63             cmd = cmd[:value_max_len] + value_too_long_mark
64 
65         if length + len(cmd) > cmd_max_len:
66             prefix = cmd[: cmd_max_len - length]
67             out.append(f"{prefix}{value_too_long_mark}")
68             break
69 
70         out.append(cmd)
71         length += len(cmd)
72 
73     return " ".join(out)
74
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py
--- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py
+++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py
@@ -28,7 +28,6 @@
         SpanAttributes.DB_SYSTEM: DbSystemValues.REDIS.value,
     }
     db = conn_kwargs.get("db", 0)
-    attributes[SpanAttributes.DB_NAME] = db
     attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX] = db
     try:
         attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(

{"golden_diff": "diff --git a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py\n--- a/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py\n+++ b/instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py\n@@ -28,7 +28,6 @@\n         SpanAttributes.DB_SYSTEM: DbSystemValues.REDIS.value,\n     }\n     db = conn_kwargs.get(\"db\", 0)\n-    attributes[SpanAttributes.DB_NAME] = db\n     attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX] = db\n     try:\n         attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(\n", "issue": "[opentelemetry-instrumentation-redis] Stop sending db.name argument or rename it to redis[0-15]\nHi! I've been recently playing with OpenTelemetry for Python (Flask) application and noticed that for Redis **db.name** argument is send to OpenTelemetry collector which seems to be a number of database (integer). This seems to be incorrect as in Redis there is no db name concept (databases are numbered from 0 to 15). Technically, it shouldn't be any problem with that but it may break some OpenTelemetry backends which expects a real DB name not a number. I have done some additional debugging and found that for node.js and .NET **db.name** argument is not send to collector. Shouldn't we have some consistency here?\r\n\r\n**Describe your environment** \r\n\r\n$ python --version\r\nPython 3.8.13\r\n$ \r\n$ pip list | grep 'opentelemetry\\|redis'\r\nopentelemetry-api                        1.13.0\r\nopentelemetry-distro                     0.34b0\r\nopentelemetry-exporter-otlp              1.13.0\r\nopentelemetry-exporter-otlp-proto-grpc   1.13.0\r\nopentelemetry-exporter-otlp-proto-http   1.13.0\r\nopentelemetry-instrumentation            0.34b0\r\nopentelemetry-instrumentation-aws-lambda 0.34b0\r\nopentelemetry-instrumentation-dbapi      0.34b0\r\nopentelemetry-instrumentation-flask      0.34b0\r\nopentelemetry-instrumentation-grpc       0.34b0\r\nopentelemetry-instrumentation-jinja2     0.34b0\r\nopentelemetry-instrumentation-logging    0.34b0\r\nopentelemetry-instrumentation-redis      0.34b0\r\nopentelemetry-instrumentation-requests   0.34b0\r\nopentelemetry-instrumentation-sqlite3    0.34b0\r\nopentelemetry-instrumentation-urllib     0.34b0\r\nopentelemetry-instrumentation-urllib3    0.34b0\r\nopentelemetry-instrumentation-wsgi       0.34b0\r\nopentelemetry-propagator-aws-xray        1.0.1\r\nopentelemetry-proto                      1.13.0\r\nopentelemetry-sdk                        1.13.0\r\nopentelemetry-semantic-conventions       0.34b0\r\nopentelemetry-util-http                  0.34b0\r\nredis                                    4.3.4\r\n\r\n**Steps to reproduce**\r\nAny Python app with connection to Redis will show this behavior.\r\n\r\n**What is the expected behavior?**\r\nStop sending db.name argument or rename it to redis[0-15]\r\n\r\n**What is the actual behavior?**\r\nThe db.name argument is send as a number of Redis database.\r\n\r\n**Additional context**\r\n\r\nPlease see below some logs from OpenTelemetry collector for python and node.js to see a difference.\r\n\r\n===> PYTHON EXAMPLE\r\n\r\nScopeSpans #0\r\nScopeSpans SchemaURL: \r\nInstrumentationScope opentelemetry.instrumentation.redis 0.34b0\r\nSpan #0\r\n    Trace ID       : 4bc10b43ab0a0d3042f38ebbb32baef1\r\n    Parent ID      : 79e2aed933827894\r\n    ID             : 22f4fba607e73a33\r\n    Name           : HMSET\r\n    Kind           : SPAN_KIND_CLIENT\r\n    Start time     : 2022-10-21 09:40:50.606962566 +0000 UTC\r\n    End time       : 2022-10-21 09:40:50.609568624 +0000 UTC\r\n    Status code    : STATUS_CODE_UNSET\r\n    Status message : \r\nAttributes:\r\n     -> db.statement: STRING(HMSET person1-hash name jane age 20)\r\n     -> db.system: STRING(redis)\r\n     -> db.name: INT(0)\r\n     -> db.redis.database_index: INT(0)\r\n     -> net.peer.name: STRING(redis-svc)\r\n     -> net.peer.port: STRING(6379)\r\n     -> net.transport: STRING(ip_tcp)\r\n     -> db.redis.args_length: INT(6)\r\n\r\n\r\n===> NODEJS EXAMPLE\r\n\r\nScopeSpans #0\r\nScopeSpans SchemaURL: \r\nInstrumentationScope @opentelemetry/instrumentation-redis-4 0.33.0\r\nSpan #0\r\n    Trace ID       : 21a071f4d1d7c860ecb758398d304f60\r\n    Parent ID      : 1bbf5328c079ceda\r\n    ID             : 13dc47b2521f7f82\r\n    Name           : redis-GET\r\n    Kind           : SPAN_KIND_CLIENT\r\n    Start time     : 2022-10-21 09:47:16.9553723 +0000 UTC\r\n    End time       : 2022-10-21 09:47:16.957585 +0000 UTC\r\n    Status code    : STATUS_CODE_UNSET\r\n    Status message : \r\nAttributes:\r\n     -> db.system: STRING(redis)\r\n     -> net.peer.name: STRING(redis-svc)\r\n     -> net.peer.port: INT(6379)\r\n     -> db.statement: STRING(GET)\r\nResourceSpans #4\r\nResource SchemaURL: \r\nResource labels:\r\n     -> service.name: STRING(nodejs-redis)\r\n     -> telemetry.sdk.language: STRING(nodejs)\r\n     -> telemetry.sdk.name: STRING(opentelemetry)\r\n     -> telemetry.sdk.version: STRING(0.24.0)\r\n     \r\nI am happy to contribute to it by reviewing the code fix and testing the behavior.\r\n\r\n@svrnm @sanketmehta28\r\n    \n", "before_files": [{"content": "# Copyright The OpenTelemetry Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\"\"\"\nSome utils used by the redis integration\n\"\"\"\nfrom opentelemetry.semconv.trace import (\n    DbSystemValues,\n    NetTransportValues,\n    SpanAttributes,\n)\n\n\ndef _extract_conn_attributes(conn_kwargs):\n    \"\"\"Transform redis conn info into dict\"\"\"\n    attributes = {\n        SpanAttributes.DB_SYSTEM: DbSystemValues.REDIS.value,\n    }\n    db = conn_kwargs.get(\"db\", 0)\n    attributes[SpanAttributes.DB_NAME] = db\n    attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX] = db\n    try:\n        attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(\n            \"host\", \"localhost\"\n        )\n        attributes[SpanAttributes.NET_PEER_PORT] = conn_kwargs.get(\n            \"port\", 6379\n        )\n        attributes[\n            SpanAttributes.NET_TRANSPORT\n        ] = NetTransportValues.IP_TCP.value\n    except KeyError:\n        attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(\"path\", \"\")\n        attributes[\n            SpanAttributes.NET_TRANSPORT\n        ] = NetTransportValues.UNIX.value\n\n    return attributes\n\n\ndef _format_command_args(args):\n    \"\"\"Format command arguments and trim them as needed\"\"\"\n    value_max_len = 100\n    value_too_long_mark = \"...\"\n    cmd_max_len = 1000\n    length = 0\n    out = []\n    for arg in args:\n        cmd = str(arg)\n\n        if len(cmd) > value_max_len:\n            cmd = cmd[:value_max_len] + value_too_long_mark\n\n        if length + len(cmd) > cmd_max_len:\n            prefix = cmd[: cmd_max_len - length]\n            out.append(f\"{prefix}{value_too_long_mark}\")\n            break\n\n        out.append(cmd)\n        length += len(cmd)\n\n    return \" \".join(out)\n", "path": "instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py"}], "after_files": [{"content": "# Copyright The OpenTelemetry Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\"\"\"\nSome utils used by the redis integration\n\"\"\"\nfrom opentelemetry.semconv.trace import (\n    DbSystemValues,\n    NetTransportValues,\n    SpanAttributes,\n)\n\n\ndef _extract_conn_attributes(conn_kwargs):\n    \"\"\"Transform redis conn info into dict\"\"\"\n    attributes = {\n        SpanAttributes.DB_SYSTEM: DbSystemValues.REDIS.value,\n    }\n    db = conn_kwargs.get(\"db\", 0)\n    attributes[SpanAttributes.DB_REDIS_DATABASE_INDEX] = db\n    try:\n        attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(\n            \"host\", \"localhost\"\n        )\n        attributes[SpanAttributes.NET_PEER_PORT] = conn_kwargs.get(\n            \"port\", 6379\n        )\n        attributes[\n            SpanAttributes.NET_TRANSPORT\n        ] = NetTransportValues.IP_TCP.value\n    except KeyError:\n        attributes[SpanAttributes.NET_PEER_NAME] = conn_kwargs.get(\"path\", \"\")\n        attributes[\n            SpanAttributes.NET_TRANSPORT\n        ] = NetTransportValues.UNIX.value\n\n    return attributes\n\n\ndef _format_command_args(args):\n    \"\"\"Format command arguments and trim them as needed\"\"\"\n    value_max_len = 100\n    value_too_long_mark = \"...\"\n    cmd_max_len = 1000\n    length = 0\n    out = []\n    for arg in args:\n        cmd = str(arg)\n\n        if len(cmd) > value_max_len:\n            cmd = cmd[:value_max_len] + value_too_long_mark\n\n        if length + len(cmd) > cmd_max_len:\n            prefix = cmd[: cmd_max_len - length]\n            out.append(f\"{prefix}{value_too_long_mark}\")\n            break\n\n        out.append(cmd)\n        length += len(cmd)\n\n    return \" \".join(out)\n", "path": "instrumentation/opentelemetry-instrumentation-redis/src/opentelemetry/instrumentation/redis/util.py"}]}