Documentation ¶
Index ¶
- Constants
- func ProcessIndexStatsRequest(ctx *fasthttp.RequestCtx, myid uint64)
- func ProcessLokiApiIngestRequest(ctx *fasthttp.RequestCtx, myid uint64)
- func ProcessLokiLabelRequest(ctx *fasthttp.RequestCtx, myid uint64)
- func ProcessLokiLabelValuesRequest(ctx *fasthttp.RequestCtx, myid uint64)
- func ProcessLokiLogsPromtailIngestRequest(ctx *fasthttp.RequestCtx, myid uint64)
- func ProcessLokiSeriesRequest(ctx *fasthttp.RequestCtx, myid uint64)
- func ProcessQueryRequest(ctx *fasthttp.RequestCtx, myid uint64)
- type Cache
- type CacheEnteries
- type Chunk
- type Data
- type Ingester
- type LokiLogData
- type LokiLogStream
- type LokiMetricsResponse
- type LokiQueryResponse
- type MetricStats
- type MetricValue
- type MetricsData
- type MetricsIngester
- type MetricsQuerier
- type MetricsSummary
- type Stats
- type Store
- type StreamValue
- type SubStore
- type Summary
- type VectorValue
Constants ¶
View Source
const ( ContentJson = "application/json; charset=utf-8" LOKIINDEX_STAR = "*" LOKIINDEX = "loki-index" TimeStamp = "timestamp" Index = "_index" DefaultLimit = 100 MsToNanoConversion = 1_000_000 DAY_IN_MS = 86_400_000 HOUR_IN_MS = 3_600_000 )
Variables ¶
This section is empty.
Functions ¶
func ProcessIndexStatsRequest ¶
func ProcessIndexStatsRequest(ctx *fasthttp.RequestCtx, myid uint64)
func ProcessLokiApiIngestRequest ¶
func ProcessLokiApiIngestRequest(ctx *fasthttp.RequestCtx, myid uint64)
LokiLogStream represents log entry in format acceptable for Loki HTTP API: https://grafana.com/docs/loki/latest/reference/loki-http-api/#ingest-logs Acceptable json example:
{ "streams": [ { "stream": { "label": "value" }, "values": [ [ "<unix epoch in nanoseconds>", "<log line>"], [ "<unix epoch in nanoseconds>", "<log line>", {"trace_id": "0242ac120002", "user_id": "superUser123"}] ] } ] }
func ProcessLokiLabelRequest ¶
func ProcessLokiLabelRequest(ctx *fasthttp.RequestCtx, myid uint64)
func ProcessLokiLabelValuesRequest ¶
func ProcessLokiLabelValuesRequest(ctx *fasthttp.RequestCtx, myid uint64)
func ProcessLokiLogsPromtailIngestRequest ¶
func ProcessLokiLogsPromtailIngestRequest(ctx *fasthttp.RequestCtx, myid uint64)
Format of loki logs generated by promtail:
{ "streams": [ { "labels": "{filename=\"test.log\",job=\"test\"}", "entries": [ { "timestamp": "2021-03-31T18:00:00.000Z", "line": "test log line" } ] } ] }
func ProcessLokiSeriesRequest ¶
func ProcessLokiSeriesRequest(ctx *fasthttp.RequestCtx, myid uint64)
func ProcessQueryRequest ¶
func ProcessQueryRequest(ctx *fasthttp.RequestCtx, myid uint64)
Types ¶
type Cache ¶
type Cache struct { Chunk CacheEnteries `json:"chunk"` Index CacheEnteries `json:"index"` Result CacheEnteries `json:"result"` }
type CacheEnteries ¶
type CacheEnteries struct { EntriesFound int `json:"entriesFound"` EntriesRequested int `json:"entriesRequested"` EntriesStored int `json:"entriesStored"` BytesReceived int `json:"bytesReceived"` BytesSent int `json:"bytesSent"` Requests int `json:"requests"` DownloadTime int `json:"downloadTime"` }
type Data ¶
type Data struct { ResultType string `json:"resultType"` Result []StreamValue `json:"result"` Stats Stats `json:"stats"` }
type Ingester ¶
type Ingester struct { CompressedBytes int `json:"compressedBytes"` DecompressedBytes int `json:"decompressedBytes"` DecompressedLines int `json:"decompressedLines"` HeadChunkBytes int `json:"headChunkBytes"` HeadChunkLines int `json:"headChunkLines"` TotalBatches int `json:"totalBatches"` TotalChunksMatched int `json:"totalChunksMatched"` TotalDuplicates int `json:"totalDuplicates"` TotalLinesSent int `json:"totalLinesSent"` TotalReached int `json:"totalReached"` }
type LokiLogData ¶
type LokiLogData struct {
Streams []LokiLogStream `json:"streams"`
}
type LokiLogStream ¶
type LokiMetricsResponse ¶
type LokiMetricsResponse struct { Status string `json:"status"` Data MetricsData `json:"data"` }
type LokiQueryResponse ¶
type MetricStats ¶
type MetricStats struct { Summary MetricsSummary `json:"summary"` Querier MetricsQuerier `json:"querier"` Ingester MetricsIngester `json:"ingester"` Cache Cache `json:"cache"` }
type MetricValue ¶
type MetricValue struct { Stream map[string]interface{} `json:"metric"` Values []interface{} `json:"value"` }
type MetricsData ¶
type MetricsData struct { ResultType string `json:"resultType"` MetricResult []MetricValue `json:"result,omitempty"` Stats MetricStats `json:"stats"` }
type MetricsIngester ¶
type MetricsQuerier ¶
type MetricsQuerier struct {
Store SubStore `json:"store"`
}
type MetricsSummary ¶
type MetricsSummary struct { BytesProcessedPerSecond int `json:"bytesProcessedPerSecond"` LinesProcessedPerSecond int `json:"linesProcessedPerSecond"` TotalBytesProcessed int `json:"totalBytesProcessed"` TotalLinesProcessed int `json:"totalLinesProcessed"` ExecTime float64 `json:"execTime"` QueueTime float64 `json:"queueTime"` Subqueries int `json:"subqueries"` TotalEntriesReturned int `json:"totalEntriesReturned"` Splits int `json:"splits"` Shards int `json:"shards"` }
type Store ¶
type Store struct { CompressedBytes int `json:"compressedBytes"` DecompressedBytes int `json:"decompressedBytes"` DecompressedLines int `json:"decompressedLines"` ChunksDownloadTime float64 `json:"chunksDownloadTime"` TotalChunksRef int `json:"totalChunksRef"` TotalChunksDownloaded int `json:"totalChunksDownloaded"` TotalDuplicates int `json:"totalDuplicates"` }
type StreamValue ¶
type Summary ¶
type Summary struct { BytesProcessedPerSecond int `json:"bytesProcessedPerSecond"` ExecTime float64 `json:"execTime"` LinesProcessedPerSecond int `json:"linesProcessedPerSecond"` QueueTime float64 `json:"queueTime"` TotalBytesProcessed int `json:"totalBytesProcessed"` TotalLinesProcessed int `json:"totalLinesProcessed"` }
type VectorValue ¶
type VectorValue struct { Metric map[string]interface{} `json:"metric"` Values [][]interface{} `json:"values"` }
Click to show internal directories.
Click to hide internal directories.