Git Product home page Git Product logo

Comments (5)

tomsun28 avatar tomsun28 commented on August 15, 2024 1

如下可以支持 successCodes 为 200, 503 时返回正确响应,但是现在没有支持返回的指标有状态码和errorMsg

  - name: health
    priority: 6
    fields:
      - field: status
        type: 1
    protocol: http
    http:
      host: ^_^host^_^
      port: ^_^port^_^
      url: ^_^base_path^_^/health
      method: GET
      ssl: ^_^ssl^_^
      authorization:
        type: Basic Auth
        basicAuthUsername: ^_^username^_^
        basicAuthPassword: ^_^password^_^
      successCodes: [200, 503]
      parseType: default

from hertzbeat.

Ceilzcx avatar Ceilzcx commented on August 15, 2024

应该是可以的,你可以加一下

from hertzbeat.

pwallk avatar pwallk commented on August 15, 2024

Use JsonPath: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-http-example-hertzbeat

from hertzbeat.

Kylin-Guo avatar Kylin-Guo commented on August 15, 2024

应该是可以的,你可以加一下

我尝试直接在HTTP API 的 yml 文件的 field 字段中添加 statusCode 和 errorMsg,然而并不能获取到信息,是哪里有遗漏吗?
image

from hertzbeat.

Kylin-Guo avatar Kylin-Guo commented on August 15, 2024

Use JsonPath: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-http-example-hertzbeat

但 JsonPath 解析方式要求接口返回的内容必须为 Json 格式,但在某些时间并不能保证
例如某个接口经由 Nginx 进行代理,正常响应的情况下接口的确会返回 Json 格式,但当接口异常, Nginx 回报 HTTP 502 or 504 的时候,格式会变成 HTML,这个时候使用 JsonPath 解析应该会出现异常

from hertzbeat.

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.