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

api support for scalars #1704

Merged
merged 2 commits into from
Feb 14, 2020

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Feb 14, 2020

What

  • logcli prints scalars
  • loghttp types defer to prometheus model types for json marshaling

loki response for instant query 1+1:

{
  "status": "success",
  "data": {
    "resultType": "scalar",
    "result": [
      1581712272.018,
      "2"
    ],
    "stats": {
      "summary": {
        "bytesProcessedPerSeconds": 0,
        "linesProcessedPerSeconds": 0,
        "totalBytesProcessed": 0,
        "totalLinesProcessed": 0,
        "execTime": 2.7652e-05
      },
      "store": {
        "totalChunksRef": 0,
        "totalChunksDownloaded": 0,
        "chunksDownloadTime": 0,
        "headChunkBytes": 0,
        "headChunkLines": 0,
        "decompressedBytes": 0,
        "decompressedLines": 0,
        "compressedBytes": 0,
        "totalDuplicates": 0
      },
      "ingester": {
        "totalReached": 0,
        "totalChunksMatched": 0,
        "totalBatches": 0,
        "totalLinesSent": 0,
        "headChunkBytes": 0,
        "headChunkLines": 0,
        "decompressedBytes": 0,
        "decompressedLines": 0,
        "compressedBytes": 0,
        "totalDuplicates": 0
      }
    }
  }
}

Prometheus response for the same

{
  "status": "success",
  "data": {
    "resultType": "scalar",
    "result": [
      1581711059,
      "2"
    ]
  }
}

Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@owen-d owen-d merged commit db6fd7e into grafana:master Feb 14, 2020
@owen-d owen-d deleted the feature/enable-scalar-api-response branch February 14, 2020 20:42
@codecov-io
Copy link

Codecov Report

Merging #1704 into master will decrease coverage by 0.19%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1704     +/-   ##
=========================================
- Coverage   63.42%   63.23%   -0.2%     
=========================================
  Files         121      121             
  Lines        9003     9027     +24     
=========================================
- Hits         5710     5708      -2     
- Misses       2875     2899     +24     
- Partials      418      420      +2
Impacted Files Coverage Δ
pkg/loghttp/query.go 41.66% <0%> (-3.34%) ⬇️
pkg/logql/marshal/query.go 72.61% <0%> (-8.72%) ⬇️
pkg/logcli/query/query.go 0% <0%> (ø) ⬆️
pkg/ingester/transfer.go 65% <0%> (-1.43%) ⬇️
pkg/promtail/targets/tailer.go 75.86% <0%> (ø) ⬆️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants