Skip to content

[BUG] 400 Bad request when use special symbols in metrics ( [,=) #746

Open
@anch665

Description

@anch665

We have mongo metrics, they are displayed normally in graphite-web. We don't use Tags. but in carbonapi we get error

Bad Request: Bad Request Target : collectd.TEST.rtmtestnbohl03.27011[cluster=rs11,db=TECH_NBO2] Parsed so far : collectd.TEST.rtmtestnbohl03.mongo.27011[cluster Could not parse : =rs11,db=TECH_NBO2]
message:"Bad Request: Bad Request

Target              : collectd.TEST.rtmtestnbohl03.mongo.27011[cluster=rs11,db=TECH_NBO2]
Parsed so far       : collectd.TEST.rtmtestnbohl03.mongo.27011[cluster
Could not parse     : =rs11,db=TECH_NBO2]

exaple curl request
port 8085 - grapite-web 1.1.10

port 8087 - carbonapi

[asg@rtmsasanalys01 ~]$ curl -v "http://rtmsasanalys01:8085/render?target=collectd.TEST.rtmtestnbohl03.mongo.*.gauge.repl.active_nodes&from=1670968724&until=1670990326&format=json&maxDataPoints=1968&format=json"
* About to connect() to rtmsasanalys01 port 8085 (#0)
*   Trying 10.72.63.49...
* Connected to rtmsasanalys01 (10.72.63.49) port 8085 (#0)
> GET /render?target=collectd.TEST.rtmtestnbohl03.mongo.*.gauge.repl.active_nodes&from=1670968724&until=1670990326&format=json&maxDataPoints=1968&format=json HTTP/1.1
> User-Agent: curl/7.29.0
> Host: rtmsasanalys01:8085
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.20.1
< Date: Wed, 14 Dec 2022 04:20:46 GMT
< Content-Type: application/json
< Content-Length: 70728
< Connection: keep-alive
< Vary: Accept-Encoding
< Expires: Wed, 14 Dec 2022 04:21:46 GMT
< Cache-Control: max-age=60
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET, POST, OPTIONS
< Access-Control-Allow-Headers: origin, authorization, accept
< Access-Control-Allow-Credentials: true
<
[{"datapoints": [[3.0, 1670968740], [3.0, 1670968800], [3.0, 1670968860], [3.0, 1670968920], [3.0, 1670968980], [3.0, 1670969040], [3.0, 1670969100], [3.0, 1670969160], [3.0, 1670969220], [3.0, 1670969280], [3.0, 1670969340],

There is nothing in the log for this request.

[asg@rtmsasanalys01 ~]$ curl -v "http://rtmsasanalys01:8087/render?target=collectd.TEST.rtmtestnbohl03.mongo.*.gauge.repl.active_nodes&from=1670968724&until=1670990326&format=json&maxDataPoints=1968&format=json"
* About to connect() to rtmsasanalys01 port 8087 (#0)
*   Trying 10.72.63.49...
* Connected to rtmsasanalys01 (10.72.63.49) port 8087 (#0)
> GET /render?target=collectd.TEST.rtmtestnbohl03.mongo.*.gauge.repl.active_nodes&from=1670968724&until=1670990326&format=json&maxDataPoints=1968&format=json HTTP/1.1
> User-Agent: curl/7.29.0
> Host: rtmsasanalys01:8087
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Vary: Accept-Encoding
< X-Ctx-Carbonapi-Uuid: 3d0b9de0-8785-4523-8802-ef3f6f78f2cf
< Date: Wed, 14 Dec 2022 04:21:50 GMT
< Content-Length: 2
<
* Connection #0 to host rtmsasanalys01 left intact

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions