loki

package
v0.0.0-...-58336f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: AGPL-3.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ContentJson        = "application/json; charset=utf-8"
	LOKIINDEX          = "loki-index"
	TimeStamp          = "timestamp"
	Index              = "_index"
	DefaultLimit       = 100
	MsToNanoConversion = 1_000_000
)

Variables

This section is empty.

Functions

func ProcessIndexStatsRequest

func ProcessIndexStatsRequest(ctx *fasthttp.RequestCtx, myid uint64)

func ProcessLokiLabelRequest

func ProcessLokiLabelRequest(ctx *fasthttp.RequestCtx)

func ProcessLokiLabelValuesRequest

func ProcessLokiLabelValuesRequest(ctx *fasthttp.RequestCtx, myid uint64)

func ProcessLokiLogsIngestRequest

func ProcessLokiLogsIngestRequest(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 Chunk

type Chunk struct {
	HeadChunkBytes    int `json:"headChunkBytes"`
	HeadChunkLines    int `json:"headChunkLines"`
	DecompressedBytes int `json:"decompressedBytes"`
	DecompressedLines int `json:"decompressedLines"`
	CompressedBytes   int `json:"compressedBytes"`
	TotalDuplicates   int `json:"totalDuplicates"`
}

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 LokiMetricsResponse

type LokiMetricsResponse struct {
	Status string      `json:"status"`
	Data   MetricsData `json:"data"`
}

type LokiQueryResponse

type LokiQueryResponse struct {
	Status string `json:"status"`
	Data   Data   `json:"data"`
}

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 MetricsIngester struct {
	TotalReached       int      `json:"totalReached"`
	TotalChunksMatched int      `json:"totalChunksMatched"`
	TotalBatches       int      `json:"totalBatches"`
	TotalLinesSent     int      `json:"totalLinesSent"`
	Store              SubStore `json:"store"`
}

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 Stats

type Stats struct {
	Ingester Ingester `json:"ingester"`
	Store    Store    `json:"store"`
	Summary  Summary  `json:"summary"`
}

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 StreamValue struct {
	Stream map[string]interface{} `json:"stream"`
	Values [][]string             `json:"values"`
}

type SubStore

type SubStore struct {
	TotalChunksRef        int     `json:"totalChunksRef"`
	TotalChunksDownloaded int     `json:"totalChunksDownloaded"`
	ChunksDownloadTime    float64 `json:"chunksDownloadTime"`
	Chunk                 Chunk   `json:"chunk"`
}

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL