Skip to content

add request logging middleware to titiler app#49

Merged
hrodmn merged 8 commits intomainfrom
fix/limit-titiler-connectivity
Mar 24, 2025
Merged

add request logging middleware to titiler app#49
hrodmn merged 8 commits intomainfrom
fix/limit-titiler-connectivity

Conversation

@hrodmn
Copy link
Copy Markdown
Collaborator

@hrodmn hrodmn commented Mar 21, 2025

We want to get some insights into how the titiler app is getting used to help us decide what to do with with respect to access to files over s3, https, etc.

This middleware will dump logs like this into CloudWatch:

[INFO]	2025-03-21T02:16:30.295Z	b0924a91-1064-4e23-9733-977948d304d2	Request: 
{
    "method": "GET",
    "path_template": "/cog/tiles/{tileMatrixSetId}/{z}/{x}/{y}@{scale}x",
    "path": "/cog/tiles/WebMercatorQuad/10/355/506@1x",
    "path_params": {
        "tileMatrixSetId": "WebMercatorQuad",
        "z": "10",
        "x": "355",
        "y": "506",
        "scale": "1"
    },
    "query_params": {
        "url": "https://e84-earth-search-sentinel-data.s3.us-west-2.amazonaws.com/sentinel-2-pre-c1-l2a/21/N/YC/2022/12/S2B_T21NYC_20221205T140704_L2A/B04.tif",
        "colormap_name": "greens",
        "rescale": "0,4000"
    }
}

We should be able to parse that JSON in the CloudWatch console or maybe make a dashboard or something like that.
We can add a dashboard with some widgets that parse the logs and deploy it via CDK!

image

resolves https://github.com/NASA-IMPACT/active-maap-sprint/issues/1134

@hrodmn hrodmn self-assigned this Mar 21, 2025
@hrodmn hrodmn requested a review from jjfrench March 21, 2025 02:33
@hrodmn hrodmn requested a review from vincentsarago March 21, 2025 10:28
Comment thread cdk/handlers/raster_handler.py
Comment thread cdk/PgStacInfra.ts
Copy link
Copy Markdown
Member

@jjfrench jjfrench left a comment

Choose a reason for hiding this comment

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

👍🏼

@hrodmn hrodmn merged commit 8ab87c9 into main Mar 24, 2025
1 check passed
@hrodmn hrodmn deleted the fix/limit-titiler-connectivity branch March 24, 2025 10:59
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.

3 participants