Skip to content

BZ-1810: fix: return 204 instead of 404 when prompt not found#39

Merged
murdore merged 1 commit into
mainfrom
BZ-2440-langfuse-return-204-instead-of-404-when-prompt-not-found
Apr 22, 2026
Merged

BZ-1810: fix: return 204 instead of 404 when prompt not found#39
murdore merged 1 commit into
mainfrom
BZ-2440-langfuse-return-204-instead-of-404-when-prompt-not-found

Conversation

@rab1prasad
Copy link
Copy Markdown
Collaborator

@rab1prasad rab1prasad commented Apr 20, 2026

Public prompt lookups generate high ALB 4xx volume from benign client
behavior (unknown prompt names, invalid/rotated API keys), which pages
on the shared CloudWatch 4xx alarm. Narrowing the alarm at the infra
layer is not feasible short-term, so we suppress the noise at the
application layer.

The GET /api/public/v2/prompts/:name endpoint threw
LangfuseNotFoundError (HTTP 404) when the prompt did not exist,
which produced 4xx alert noise on ALB for benign client lookups.
Return 204 No Content instead so clients can handle the absence
without triggering infra alerts.

GET /api/public/v2/prompts/ now responds 200 with
{ accessDenied: true, message, prompt: null } on UnauthorizedError
or ForbiddenError to quiet ALB 4xx alerts. Other errors still rethrow.

dev proof
Screenshot 2026-04-21 at 3 08 17 AM

Screenshot 2026-04-21 at 1 19 04 PM

@rab1prasad rab1prasad force-pushed the BZ-2440-langfuse-return-204-instead-of-404-when-prompt-not-found branch from 9c18e3d to 5ac3f60 Compare April 21, 2026 07:52
…1 for /prompt

- The GET /api/public/v2/prompts/:name endpoint threw
  LangfuseNotFoundError (HTTP 404) when the prompt did not exist,
  which produced 4xx alert noise on ALB for benign client lookups.
  Return 204 No Content instead so clients can handle the absence
  without triggering infra alerts.
- GET /api/public/v2/prompts/<name> now responds 200 with
  { accessDenied: true, message, prompt: null } on UnauthorizedError
  or ForbiddenError to quiet ALB 4xx alerts. Other errors still rethrow.
@rab1prasad rab1prasad force-pushed the BZ-2440-langfuse-return-204-instead-of-404-when-prompt-not-found branch from 5ac3f60 to b02082d Compare April 21, 2026 08:01
@murdore murdore merged commit e16b863 into main Apr 22, 2026
18 of 35 checks passed
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.

4 participants