apache / apache/hertzbeat

[Question] <title>监控API接口 在获取到token之后将token 作为参数传递到第二个请求中

Open
#2,566 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
7.4k
Forks
1.3k
Avg merge
1d 20h
Merged PRs (30d)
32

Description

### Question

metrics:
- name: auth
priority: 0
fields:
- field: access_token
type: 1
- field: refresh_token
type: 1
protocol: http
http:
host: ^_^host^_^
port: ^_^port^_^
url: ^_^uri^_^
timeout: 6000
method: POST
payload: ^_^payload^_^
headers:
content-type: application/x-www-form-urlencoded
parseType: jsonPath
parseScript: '$'

- name: actuator
priority: 1
fields:
- field: status
type: 1
protocol: http
http:
host: ^_^host^_^
port: ^_^port^_^
url: ^_^uri^_^
timeout: ^_^timeout^_^
method: GET
ssl: ^_^ssl^_^
authorization:
type: Bearer Token
bearerTokenToken: ^_^access_token^_^
parseType: jsonPath
parseScript: '$'

以上是我的模板配置。当我把token 写死时是可以获取到第二个接口的返回信息,但是换成参数就提示401

Contributor guide

Open the contributing guide

Research direction

Start with the supplied metrics template, focusing on the auth metric's access_token field and the actuator metric's bearerTokenToken reference. Trace how the token is passed from the first HTTP request into the second request, and verify the actuator request no longer returns 401 when the token is configured by reference.

Written by the indexing model from the issue text.

Assessment

Domain
api, authentication, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.