Skip to content

Commit

Permalink
Add record.requestId and record.awsRequestId
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi committed Apr 3, 2024
1 parent ae6d7e3 commit aed49fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def record_factory(*args, **kwargs):
record.otelSpanID = "0"
record.otelTraceID = "0"
record.otelTraceSampled = False
record.awsRequestId = getattr(record, "aws_request_id", None)
record.requestId = getattr(record, "requestId", None)

nonlocal service_name
if service_name is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

DEFAULT_LOGGING_FORMAT = "%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [requestId=%(requestId)s] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s trace_sampled=%(otelTraceSampled)s] - %(message)s"
DEFAULT_LOGGING_FORMAT = "%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [awsRequestId=%(awsRequestId)s] [requestId=%(requestId)s] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s trace_sampled=%(otelTraceSampled)s] - %(message)s"


_MODULE_DOC = """
Expand Down

0 comments on commit aed49fd

Please sign in to comment.