Git Product home page Git Product logo

Comments (4)

nmdanny avatar nmdanny commented on May 23, 2024 1

You're right, 404 is not appropriate - I meant to use 400 - Bad Request

The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing).

From my understanding, 403 is usually used in the context of security/RBAC - which isn't the case here, since this is a business logic restriction. Seeing 403 in logs would usually imply some auth issue which would be misleading.

from prometheus.

bboreham avatar bboreham commented on May 23, 2024

Why 404? I think 403 is more appropriate:

403 Forbidden
The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.

from prometheus.

cykl avatar cykl commented on May 23, 2024

Thanks.

I just handled an incident triggered by this behavior. The Prometheus server returned 500: too old sample one time to an agent configured to remote write its data. Agent then endlessly retried the same call again and again block all samples until I killed / cleaned it.

Returning 400 seems like the right to do.

from prometheus.

bboreham avatar bboreham commented on May 23, 2024

Looks like ErrOutOfOrderExemplar and a few others would have the same problem.

from prometheus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.