diff --git a/content/en/docs/languages/python/propagation.md b/content/en/docs/languages/python/propagation.md index b75a037fb9b5..82f77b9e1953 100644 --- a/content/en/docs/languages/python/propagation.md +++ b/content/en/docs/languages/python/propagation.md @@ -2,6 +2,7 @@ title: Propagation description: Context propagation for the Python SDK weight: 65 +cSpell:ignore: sqlcommenter --- Propagation is the mechanism that moves data between services and processes. @@ -110,6 +111,23 @@ if __name__ == '__main__': From there, when you have a deserialized active context, you can create spans that are part of the same trace from the other service. +### sqlcommenter + +Some Python instrumentations support sqlcommenter, which enriches database query +statements with contextual information. Queries made with sqlcommenter enabled +will have configurable key-value pairs appended to them. For example: + +```sql +"select * from auth_users; /*traceparent=00-01234567-abcd-01*/" +``` + +This supports context propagation between database client and server when +database log records are enabled. For more information, see: + +- [OpenTelemetry Python sqlcommenter example](https://opentelemetry-python.readthedocs.io/en/stable/examples/sqlcommenter/README.html) +- [Semantic Conventions - Database Spans](/docs/specs/semconv/database/database-spans/#sql-commenter) +- [sqlcommenter](https://google.github.io/sqlcommenter/) + ## Next steps To learn more about propagation, see