open-telemetry / open-telemetry/opentelemetry-python-contrib
botocore (dynamo db) instrumentation doesn't capture 'db.statement'
@avzis is already working on this.
Since Jan 1, 2023.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
According to the specs - db.statement should capture the database statement that is being executed.
Steps to reproduce
Instrument a client using BotocoreInstrumentor().
Send a request to the db.
What is the expected behavior?
Produce a span with a db.statement value containing the database statement.
What is the actual behavior?
Produce a span without generating db.statement.
Example:
Here is an example of the information that is being collected when running one of the instrumentation tests
test class: test_botocore_dynamodb
test name: test_update_item
{
"rpc.system":"aws-api",
"rpc.service":"DynamoDB",
"rpc.method":"UpdateItem",
"aws.region":"us-west-2",
"db.system":"dynamodb",
"db.operation":"UpdateItem",
"net.peer.name":"dynamodb.us-west-2.amazonaws.com",
"aws.dynamodb.table_names":"(""test_table")",
"aws.request_id":"wcTntqQfzhNsJNLB5qsk385hT274tmBUUWAkWZPUarUlaXTkb1Xw",
"retry_attempts":0,
"http.status_code":200,
"aws.dynamodb.consumed_capacity":"(""{\"TableName\": \"test_table\", \"CapacityUnits\": 0.5}"
}
Additional context:
I would also suggest adding an optional flag 'capture_statement' (default - off) that will enable or disable capturing the information in order to provide privacy.
If you can - assign this to me, thanks :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.