Skip to content

Better logging and tracing for stream errors#38013

Merged
lmolkova merged 8 commits intoAzure:mainfrom
lmolkova:stream-errors-better-obs
Jan 11, 2024
Merged

Better logging and tracing for stream errors#38013
lmolkova merged 8 commits intoAzure:mainfrom
lmolkova:stream-errors-better-obs

Conversation

@lmolkova
Copy link

Fixes #37978 and #37975

Issues came up in storage stress tests where lack of context makes it difficult or impossible to reconstruct what the Storage SDK was doing when stream reading error happens (e.g. how many bytes were actually downloaded in which try)

Description

  1. Adds context (x-ms-client-request-id and traceparent) to stream reading helpers error logs that previously had no context
  2. Ends HTTP client span when underlying stream is closed

After:

image image

image

@azure-sdk
Copy link
Collaborator

azure-sdk commented Dec 11, 2023

API change check

API changes are not detected in this pull request.

@lmolkova lmolkova enabled auto-merge (squash) January 5, 2024 21:58
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmolkova lmolkova force-pushed the stream-errors-better-obs branch from 74a0083 to 8fd1e0f Compare January 10, 2024 23:53
@lmolkova
Copy link
Author

is this related to https://github.com/open-telemetry/semantic-conventions/blob/main/docs/http/http-spans.md#http-client-span-duration?

yes, but the reason for this change is to fix something we hit in the stress tests - telemetry shows that everything is fine when connection resets in the middle of the response stream

@lmolkova lmolkova merged commit 2319dc9 into Azure:main Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core azure-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Logging: errors during stream reading should have context

4 participants