prometheus/web/api/v1
newtonne 88675710f9 Add support for utf8 names on /v1/label/:name/values endpoint
Previously, the api was evaluating this regex to determine if the label
name was valid or not:

14bac55a99/model/labels.go (L94)

However, I believe that the `IsValid()` function is what ought to be
used in the brave new utf8 era.

**Before**

```
$ curl localhost:9090/api/v1/label/host.name/values
{"status":"error","errorType":"bad_data","error":"invalid label name: \"host.name\""}
```

**After**

```
$ curl localhost:9090/api/v1/label/host.name/values
{"status":"success","data":["localhost"]}
```

It's very likely that I'm missing something here or you were already
planning to do this at some point but I just encountered this issue and
figured I'd give it a go.

Signed-off-by: Owen Williams <owen.williams@grafana.com>
2024-11-25 11:48:45 -05:00
..
api.go Add support for utf8 names on /v1/label/:name/values endpoint 2024-11-25 11:48:45 -05:00
api_test.go Add support for utf8 names on /v1/label/:name/values endpoint 2024-11-25 11:48:45 -05:00
codec.go Implement fully-featured content negotiation for API requests, and allow overriding the default API codec. 2023-03-09 12:02:45 +11:00
codec_test.go Implement fully-featured content negotiation for API requests, and allow overriding the default API codec. 2023-03-09 12:02:45 +11:00
errors_test.go chore!: adopt log/slog, remove go-kit/log 2024-10-07 15:58:50 -04:00
json_codec.go bugfix: add missing comma in vector/matrix array (#14047) 2024-05-03 14:07:49 -03:00
json_codec_test.go bugfix: add missing comma in vector/matrix array (#14047) 2024-05-03 14:07:49 -03:00
translate_ast.go Signed-off-by: Julius Volz <julius.volz@gmail.com> 2024-09-06 21:47:35 +02:00