Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query label values and names are now fetched from the store. #521

Merged
merged 4 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 2 additions & 59 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The Loki server has the following API endpoints (_Note:_ Authentication is out o

Responses looks like this:

```
```json
{
"streams": [
{
Expand All @@ -59,11 +59,14 @@ The Loki server has the following API endpoints (_Note:_ Authentication is out o

- `GET /api/prom/label`

For retrieving the names of the labels one can query on.
For doing label name queries, accepts the following parameters in the query-string:

- `start`: the start time for the query, as a nanosecond Unix epoch (nanoseconds since 1970). Default is always 6 hour ago.
- `end`: the end time for the query, as a nanosecond Unix epoch (nanoseconds since 1970). Default is current time.

Responses looks like this:

```
```json
{
"values": [
"instance",
Expand All @@ -74,11 +77,15 @@ The Loki server has the following API endpoints (_Note:_ Authentication is out o
```

- `GET /api/prom/label/<name>/values`
For retrieving the label values one can query on.

For doing label values queries, accepts the following parameters in the query-string:

- `start`: the start time for the query, as a nanosecond Unix epoch (nanoseconds since 1970). Default is always 6 hour ago.
- `end`: the end time for the query, as a nanosecond Unix epoch (nanoseconds since 1970). Default is current time.

Responses looks like this:

```
```json
{
"values": [
"default",
Expand Down
159 changes: 147 additions & 12 deletions pkg/logproto/logproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/logproto/logproto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ message QueryResponse {
message LabelRequest {
string name = 1;
bool values = 2; // True to fetch label values, false for fetch labels names.
google.protobuf.Timestamp start = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true];
google.protobuf.Timestamp end = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true];
}

message LabelResponse {
Expand Down
Loading