Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not assume 'content-encoding' header is set. #727

Merged

Conversation

danielballan
Copy link
Member

We are seeing a whole lot of

File "/opt/venv/lib/python3.11/site-packages/tiled/server/app.py", line 879, in capture_metrics_prometheus
    metrics.capture_request_metrics(request, response)
  File "/opt/venv/lib/python3.11/site-packages/tiled/server/metrics.py", line 128, in capture_request_metrics
    encoding = response.headers["content-encoding"]
               ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/starlette/datastructures.py", line 565, in __getitem__
    raise KeyError(key)
KeyError: 'content-encoding'

in the production logs.

Copy link
Contributor

@padraic-shafer padraic-shafer left a comment

Choose a reason for hiding this comment

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

Now handles missing "content-encoding"

@danielballan danielballan merged commit 4227818 into bluesky:main Apr 24, 2024
9 checks passed
@danielballan danielballan deleted the conditional-encoding-metrics branch April 24, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants