content
large_stringlengths
3
20.5k
url
large_stringlengths
54
193
branch
large_stringclasses
4 values
source
large_stringclasses
42 values
embeddings
listlengths
384
384
score
float64
-0.21
0.65
up and running" level=info ts=2022-03-23T11:55:45.221254326Z caller=loki.go:355 msg="Loki started" | logfmt | level = "info" [//]: # (Json parser examples) {"timestamp":"2022-04-26T08:53:59.61Z","level":"INFO","class":"org.springframework.boot.SpringApplication","method":"logStartupProfileInfo","file":"SpringApplicatio...
https://github.com/grafana/loki/blob/main//docs/sources/query/analyzer.md
main
loki
[ 0.0008566999458707869, -0.03865325078368187, -0.015378707088530064, -0.025488942861557007, 0.06850334256887436, -0.037170350551605225, -0.04423748329281807, 0.016413986682891846, -0.011384009383618832, 0.010867003351449966, 0.03473769873380661, -0.004830930382013321, 0.015389968641102314, ...
0.000383
# Query Loki When you want to look for certain logs stored in Loki, you specify a set of [labels](https://grafana.com/docs/loki//get-started/labels) that identify them. When Loki receives log entries, it groups them into log streams. When Loki stores log streams they are compressed and stored in \*chunks\* and Loki the...
https://github.com/grafana/loki/blob/main//docs/sources/query/_index.md
main
loki
[ -0.02964942157268524, -0.00993082020431757, -0.06566707789897919, 0.04006924852728844, 0.012187520042061806, -0.03371264040470123, 0.026318924501538277, -0.02204950340092182, 0.06749571114778519, 0.028482526540756226, -0.0402183011174202, -0.02178391069173813, -0.005291984416544437, 0.0469...
0.093904
- formatters #### Filter expressions Filter expressions are used to look for a certain string or range of values within the log line or label. For label filters, the following operators can be used: - `==` or `=` for equality. - `!=` for inequality. - `>` and `>=` for greater than and greater than or equal. - `<` and `...
https://github.com/grafana/loki/blob/main//docs/sources/query/_index.md
main
loki
[ -0.07455873489379883, 0.0696602538228035, 0.009981720708310604, -0.00010993180330842733, -0.006151379551738501, -0.04898048937320709, 0.02474667876958847, -0.013641022145748138, 0.01937146484851837, -0.019917527213692665, 0.01938033476471901, -0.03504724055528641, 0.02643609419465065, 0.04...
0.086438
# LogCLI getting started logcli is a command-line client for Loki that lets you run [LogQL](https://grafana.com/docs/loki//query) queries against your Loki instance. The `query` command will output extra information about the query and its results, such as the API URL, set of common labels, and set of excluded labels. ...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.0393548421561718, 0.029017241671681404, -0.11618676036596298, 0.038005296140909195, 0.000049726942961569875, -0.07563666254281998, 0.017450444400310516, 0.006539028603583574, 0.04315372183918953, 0.02421312965452671, -0.01372560765594244, -0.056979283690452576, 0.031214287504553795, -0....
0.118438
query metadata --[no-]stats Show query statistics -o, --output=default Specify output mode [default, raw, jsonl]. raw suppresses log labels and timestamp. -z, --timezone=Local Specify the timezone to use when formatting output timestamps [Local, UTC] --output-timestamp-format=rfc3339 Specify the format of timestamps in...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.06066753342747688, 0.050309088081121445, -0.15857017040252686, 0.025239652022719383, 0.01706315390765667, -0.0749957263469696, 0.01045060995966196, 0.07047777622938156, -0.0022374026011675596, 0.00718652131035924, 0.0078014046885073185, -0.09996739774942398, -0.011278374120593071, -0.005...
0.100527
--since to modify or provide specific start and end times with --from and --to respectively. Notice that when using --from and --to then ensure to use RFC3339Nano time format, but without timezone at the end. The local timezone will be added automatically or if using --timezone flag. In default output mode the --output...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.033561281859874725, 0.03281404450535774, -0.023329762741923332, -0.022281605750322342, -0.01805885322391987, -0.0320829302072525, -0.018191324546933174, 0.024259645491838455, 0.033421799540519714, 0.022875739261507988, -0.017308305948972702, -0.10259085893630981, 0.010845069773495197, 0....
-0.002676
The "instant-query" command is useful for evaluating a metric query for a single point in time. This is equivalent to the Grafana Explore table view; if you want a metrics query that is used to build a Grafana graph, you should use the "query" command instead. This command does not produce useful output when querying f...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.05329084396362305, 0.004190179519355297, -0.13307517766952515, 0.04296625033020973, -0.11296455562114716, -0.020698415115475655, 0.03656602278351784, 0.023765265941619873, 0.03445150703191757, -0.010282909497618675, 0.00260478095151484, -0.10739007592201233, -0.03728804364800453, 0.0304...
0.075483
set of excluded labels. This extra information can be suppressed with the --quiet flag. By default we look over the last hour of data; use --since to modify or provide specific start and end times with --from and --to respectively. Notice that when using --from and --to then ensure to use RFC3339Nano time format, but w...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.005602030083537102, 0.10033014416694641, -0.03578374162316322, -0.015670351684093475, -0.0017949702451005578, -0.0859612450003624, 0.023540660738945007, -0.014348992146551609, 0.0562720000743866, -0.03678891062736511, 0.006348851136863232, -0.08587048947811127, 0.03960036113858223, 0.045...
0.059512
the file name. While the part is being downloaded, the filename will end in ".part", when it is complete, the file will be renamed to remove this ".part" extension. By default, if a completed part file is found, that part will not be downloaded again. This can be overridden with the --overwrite-completed-parts flag. Pa...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.06567739695310593, 0.044172968715429306, 0.03907648101449013, -0.023783616721630096, 0.08230266720056534, -0.07393090426921844, 0.05482148379087448, -0.022105623036623, 0.055456750094890594, 0.0026381835341453552, 0.0025775411631911993, 0.08867327123880386, -0.01661142148077488, -0.0381...
0.030009
query when getting an error response from Loki. Can also be set using LOKI\_CLIENT\_RETRIES env var. ($LOKI\_CLIENT\_RETRIES) --min-backoff=0 Minimum backoff time between retries. Can also be set using LOKI\_CLIENT\_MIN\_BACKOFF env var. ($LOKI\_CLIENT\_MIN\_BACKOFF) --max-backoff=0 Maximum backoff time between retries...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.03000333532691002, 0.05148158222436905, -0.033381007611751556, 0.010708646848797798, -0.00029540385003201663, -0.024820314720273018, -0.015276632271707058, 0.024684537202119827, -0.0070705837570130825, 0.038742441684007645, -0.03303996101021767, -0.018615517765283585, 0.05752340331673622,...
0.041287
equivalent to the Grafana Explore table view; if you want a metrics query that is used to build a Grafana graph, you should use the "query" command instead. This command does not produce useful output when querying for log lines; you should always use the "query" command when you are running log queries. For more infor...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.046201419085264206, 0.0006787277525290847, -0.09886597096920013, 0.04694375768303871, -0.11965140700340271, -0.05827492102980614, -0.019881661981344223, -0.001986484508961439, -0.008665190078318119, 0.049742527306079865, -0.008456950075924397, -0.11872632056474686, 0.012099293991923332, ...
0.049229
given the provided key during output. --[no-]include-common-labels Include common labels in output for each log line. --labels-length=0 Set a fixed padding to labels --store-config="" Execute the current query using a configured storage from a given Loki configuration file. --[no-]remote-schema Execute the current quer...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.053929612040519714, 0.05148043483495712, -0.09091249108314514, 0.021962393075227737, -0.005063424352556467, 0.024700885638594627, 0.10230322182178497, 0.02696424163877964, 0.011031195521354675, -0.03909889981150627, 0.06205376610159874, -0.1280011385679245, 0.08921357244253159, 0.0149646...
0.085595
[] The name of the label. ``` ### `series` command reference The output of `logcli help series`: ```shell usage: logcli series [] Run series query. The "series" command will take the provided label matcher and return all the log streams found in the time window. It is possible to send an empty label matcher '{}' to ret...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.011934933252632618, 0.039039019495248795, -0.12408038228750229, -0.012512549757957458, 0.01607002504169941, 0.0026932950131595135, 0.03998681530356407, 0.03546878322958946, 0.029368087649345398, -0.08681163936853409, -0.02184572070837021, -0.12174981832504272, 0.004714570473879576, 0.063...
0.126499
for debugging high cardinality series Args: eg '{foo="bar",baz=~".\*blip"}' ``` ### `stats` command reference The output of `logcli help stats`: ```shell usage: logcli stats [] Run a stats query. The "stats" command will take the provided query and return statistics from the index on how much data is contained in the m...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.015193861909210682, -0.018560463562607765, -0.027143463492393494, 0.010862664319574833, -0.004709344822913408, -0.07407507300376892, -0.01807357184588909, 0.012777054682374, 0.0029550641775131226, 0.022590333595871925, -0.07665789127349854, -0.10119800269603729, -0.02857235260307789, 0.0...
0.060147
Use ProxyFromEnvironment to use net/http ProxyFromEnvironment configuration, eg HTTP\_PROXY ($LOKI\_ENV\_PROXY) --since=1h Lookback window. --from=FROM Start looking for logs at this absolute time (inclusive) --to=TO Stop looking for logs at this absolute time (exclusive) Args: eg '{foo="bar",baz=~".\*blip"} |~ ".\*err...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.018544403836131096, 0.009979331865906715, 0.011404706165194511, -0.014131160452961922, -0.017081568017601967, -0.07289311289787292, -0.0175333172082901, 0.011767123825848103, 0.06765671074390411, 0.023177463561296463, -0.04378693923354149, -0.06498227268457413, 0.029471807181835175, 0.0...
0.02586
using LOKI\_HTTP\_PROXY\_URL env var. ($LOKI\_HTTP\_PROXY\_URL) --[no-]compress Request that Loki compress returned data in transit. Can also be set using LOKI\_HTTP\_COMPRESSION env var. ($LOKI\_HTTP\_COMPRESSION) --[no-]envproxy Use ProxyFromEnvironment to use net/http ProxyFromEnvironment configuration, eg HTTP\_PRO...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.03438533842563629, 0.04452866315841675, -0.020077385008335114, 0.063380666077137, 0.007500529754906893, -0.02907288260757923, -0.017270375043153763, -0.005750124342739582, 0.0583263598382473, 0.01421839278191328, -0.036670323461294174, -0.049704622477293015, 0.05086583271622658, 0.02282...
0.023514
LOKI\_CLIENT\_RETRIES env var. ($LOKI\_CLIENT\_RETRIES) --min-backoff=0 Minimum backoff time between retries. Can also be set using LOKI\_CLIENT\_MIN\_BACKOFF env var. ($LOKI\_CLIENT\_MIN\_BACKOFF) --max-backoff=0 Maximum backoff time between retries. Can also be set using LOKI\_CLIENT\_MAX\_BACKOFF env var. ($LOKI\_CL...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.03471268340945244, 0.04534846171736717, -0.027682486921548843, -0.009109923616051674, -0.019780488684773445, -0.027356380596756935, -0.036312174052000046, 0.007772196549922228, -0.004131772555410862, 0.024236628785729408, -0.02930925413966179, 0.01475304365158081, 0.047240063548088074, ...
0.033585
requests for representing tenant ID. Useful for requesting tenant data when bypassing an auth gateway. Can also be set using LOKI\_ORG\_ID env var. ($LOKI\_ORG\_ID) --query-tags="" adds X-Query-Tags http header to API requests. This header value will be part of `metrics.go` statistics. Useful for tracking the query. Ca...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.012654650025069714, 0.07621840387582779, -0.08878375589847565, 0.00016791533562354743, 0.009630313143134117, -0.02107759565114975, 0.03319913521409035, -0.01066549401730299, 0.05426643043756485, 0.02776719070971012, 0.01352396234869957, -0.044454678893089294, 0.004018325824290514, 0.0154...
0.127242
var. ($LOKI\_ORG\_ID) --query-tags="" adds X-Query-Tags http header to API requests. This header value will be part of `metrics.go` statistics. Useful for tracking the query. Can also be set using LOKI\_QUERY\_TAGS env var. ($LOKI\_QUERY\_TAGS) --[no-]nocache adds Cache-Control: no-cache http header to API requests. Ca...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.0007707618060521781, 0.07902731746435165, -0.07272372394800186, 0.017427802085876465, 0.01589268445968628, -0.01836826466023922, 0.06385387480258942, 0.038010869175195694, 0.042568136006593704, 0.034963157027959824, -0.008377071470022202, -0.06053538620471954, 0.0481635220348835, 0.00429...
0.145035
to API requests for representing tenant ID. Useful for requesting tenant data when bypassing an auth gateway. Can also be set using LOKI\_ORG\_ID env var. ($LOKI\_ORG\_ID) --query-tags="" adds X-Query-Tags http header to API requests. This header value will be part of `metrics.go` statistics. Useful for tracking the qu...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.013597765937447548, 0.07354865968227386, -0.09129825234413147, -0.0001602724369149655, -0.0053111189045012, -0.01885312795639038, 0.026339534670114517, -0.012291109189391136, 0.0496627613902092, 0.024463091045618057, 0.009686412289738655, -0.047529689967632294, 0.010059543885290623, 0.01...
0.117661
`metrics.go` statistics. Useful for tracking the query. Can also be set using LOKI\_QUERY\_TAGS env var. ($LOKI\_QUERY\_TAGS) --[no-]nocache adds Cache-Control: no-cache http header to API requests. Can also be set using LOKI\_NO\_CACHE env var. ($LOKI\_NO\_CACHE) --bearer-token="" adds the Authorization header to API ...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ 0.014341719448566437, 0.06971947848796844, -0.08717339485883713, 0.013462681323289871, 0.0071901241317391396, -0.03212904557585716, 0.059695374220609665, 0.022493278607726097, 0.038748182356357574, 0.03713199123740196, -0.011602666229009628, -0.0466594435274601, 0.02807520143687725, 0.0070...
0.136844
env var. ($LOKI\_BEARER\_TOKEN\_FILE) --retries=0 How many times to retry each query when getting an error response from Loki. Can also be set using LOKI\_CLIENT\_RETRIES env var. ($LOKI\_CLIENT\_RETRIES) --min-backoff=0 Minimum backoff time between retries. Can also be set using LOKI\_CLIENT\_MIN\_BACKOFF env var. ($L...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.012389099225401878, 0.024352921172976494, -0.03869285807013512, 0.009542757645249367, -0.01314850989729166, -0.019976459443569183, -0.008033565245568752, 0.022430969402194023, 0.01672874204814434, 0.039663877338171005, -0.015147419646382332, -0.0007465588860213757, 0.049313388764858246, ...
0.05835
control the number of log line results that are returned in each batch. When not set, `--batch` defaults to 1000. Setting a `--limit` value larger than the `--batch` value will cause the requests from logcli to Loki to be batched. When you run a query in Loki, it will return up to a certain number of log lines. By defa...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/getting-started.md
main
loki
[ -0.004432272166013718, 0.023619385436177254, -0.08941304683685303, 0.04226992279291153, -0.06292151659727097, -0.09293846786022186, -0.013156815432012081, 0.0034656061325222254, 0.012297708541154861, 0.0013416697038337588, -0.011176083236932755, -0.013678213581442833, 0.040316008031368256, ...
0.086013
# LogCLI tutorial This [LogCLI](https://grafana.com/docs/loki//query/logcli/) tutorial will walk you through the following concepts: \* Querying logs \* Meta Queries against your Loki instance \* Queries against static log files ## Prerequisites Before you begin, you need to have the following: \* Docker \* Docker-comp...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/logcli-tutorial.md
main
loki
[ -0.04324013367295265, -0.02143426239490509, -0.05543205142021179, -0.01216510497033596, 0.00006120966281741858, -0.12737031280994415, 0.02103782631456852, 0.004204927943646908, -0.020675595849752426, 0.049995873123407364, 0.03172711282968521, -0.11964006721973419, -0.033233948051929474, 0....
0.109897
Maple Ave, Dallas, Texas"}, "receiver": {"name": "Receiver41", "address": "455 Pine Rd, Dallas, Texas"}} 2024-11-26T10:39:50Z {package\_id="PKG34018", package\_size="Large", state="Illinois"} {"timestamp": "2024-11-26T10:39:50.510841Z", "state": "Illinois", "city": "Chicago", "package\_id": "PKG34018", "package\_type":...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/logcli-tutorial.md
main
loki
[ -0.01200158428400755, 0.10243218392133713, 0.06654514372348785, -0.007021727040410042, -0.0009893557289615273, -0.029269276186823845, 0.0169358029961586, -0.03128879517316818, -0.04390011727809906, 0.05288080871105194, -0.005683861207216978, -0.02472004108130932, 0.0028691019397228956, 0.0...
0.0474
World` in the last 24 hours to the `./inventory` directory. The logs will be split into two files, each containing 12 hours of logs. Note that we do not need to specify `--limit` as this is overridden by the `--parallel-duration` flag. ## Meta queries As site managers, it's essential to maintain good data hygiene and e...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/logcli-tutorial.md
main
loki
[ 0.034439243376255035, -0.0237575676292181, -0.014835186302661896, 0.025457654148340225, 0.04653031378984451, -0.10032275319099426, -0.0017636932898312807, 0.033795036375522614, 0.007802432402968407, 0.017460109665989876, -0.03670204058289528, -0.013591076247394085, -0.015505017712712288, 0...
0.128678
for it directly. Package size, on the other hand, has a low cardinality, making it a good candidate for a label. ### Checking query performance Another important aspect of keeping Loki healthy is to monitor the query performance. We can use LogCLI to check the query performance of our logs. {{< admonition type="note" >...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/logcli-tutorial.md
main
loki
[ 0.04147458076477051, 0.03205008804798126, -0.03290780633687973, 0.061239004135131836, 0.03219577670097351, -0.16401441395282745, -0.004133469890803099, 0.048219576478004456, 0.02922964282333851, 0.047517456114292145, -0.01595892384648323, -0.023995844647288322, -0.044985294342041016, 0.057...
0.158831
log file: ```bash logcli query \ --timezone=UTC \ --parallel-duration="12h" \ --parallel-max-workers="4" \ --part-path-prefix="./inventory/inv" \ --since=24h \ --merge-parts \ --output=raw \ '{service\_name="Delivery World"}' > ./inventory/complete.log ``` Next lets run a query against the static log file: ```bash cat ...
https://github.com/grafana/loki/blob/main//docs/sources/query/logcli/logcli-tutorial.md
main
loki
[ -0.0009941363241523504, 0.07776713371276855, -0.03705025091767311, -0.028882717713713646, -0.03410371020436287, -0.06333792209625244, 0.03753908723592758, 0.03127015382051468, 0.020526744425296783, -0.02436227537691593, 0.05432227998971939, -0.048687200993299484, -0.014928407967090607, 0.0...
0.109484
# Log queries All LogQL queries contain a \*\*log stream selector\*\*. ![parts of a query](./query\_components.png) Optionally, the log stream selector can be followed by a \*\*log pipeline\*\*. A log pipeline is a set of stage expressions that are chained together and applied to the selected log streams. Each expressi...
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ 0.014185070991516113, 0.023546569049358368, -0.013039937242865562, 0.03575562685728073, 0.0017227038042619824, -0.04895941540598869, 0.09404531866312027, 0.0033734599128365517, 0.052606433629989624, -0.02071649581193924, -0.05115688592195511, -0.09214875102043152, 0.010163411498069763, 0.0...
0.10581
- `{name =~ "(?s).\*mysql.\*}`: match log label values with newline character - `{name =~ "[\S\s]\*mysql[\S\s]\*}`: match log label values with newline character ## Log pipeline A log pipeline can be appended to a log stream selector to further process and filter log streams. It is composed of a set of expressions. Eac...
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ -0.06565225124359131, 0.03338701277971268, 0.0003888305800501257, 0.006880088709294796, -0.06265762448310852, -0.008186248131096363, 0.10910549014806747, -0.005218707490712404, 0.008809352293610573, -0.0053970227017998695, -0.04291254281997681, -0.045376330614089966, 0.08361929655075073, -...
0.088438
``` {job="mysql"} | json | line\_format "{{.message}}" |= "error" ``` Line filter expressions are the fastest way to filter logs once the log stream selectors have been applied. Line filter expressions have support matching IP addresses. See [Matching IP addresses](../ip/) for details. ### Removing color codes Line fil...
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ -0.038845259696245193, 0.07129383832216263, 0.01945369318127632, 0.016943415626883507, 0.034064117819070816, -0.0487101785838604, 0.09599456191062927, -0.06428885459899902, 0.03141070157289505, -0.012207713909447193, -0.046116963028907776, -0.05419522896409035, 0.10853291302919388, 0.04690...
0.149738
``` To evaluate the logical `and` first, use parenthesis, as in this example: ```logql | duration >= 20ms or (method="GET" and size <= 20KB) ``` > Label filter expressions are the only expression allowed after the unwrap expression. This is mainly to allow filtering errors from the metric extraction. Label filter expre...
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ -0.07709982246160507, 0.08197187632322311, -0.008741340599954128, -0.0017513175262138247, -0.007921251468360424, -0.06013237684965134, 0.025131097063422203, 0.015005072578787804, 0.02810908667743206, -0.042441315948963165, 0.014412428252398968, -0.08387680351734161, -0.0038087088614702225, ...
0.154018
"response": { "status": 401, "size": "228", "latency\_seconds": "6.031" } } ``` The following list of labels: ```kv "first\_server" => "129.0.1.1" "ua" => "curl/7.68.0" ``` If an array or an object returned by an expression, it will be assigned to the label in json format. For example, `| json server\_list="servers", h...
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ -0.05296947434544563, 0.17104274034500122, -0.0479656383395195, 0.017449568957090378, 0.004004334565252066, -0.022178223356604576, 0.054886456578969955, 0.0038344059139490128, 0.034721627831459045, -0.0010692437645047903, 0.010059825144708157, -0.05763503536581993, 0.0026320305187255144, 0...
0.110822
is a field name delimited by the `<` and `>` characters. `` defines the field name `example`. An unnamed capture appears as `<\_>`. The unnamed capture skips matched content. Captures are matched from the line beginning or the previous set of literals, to the line end or the next set of literals. If a capture is not ma...
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ -0.09015984833240509, 0.020845428109169006, 0.05933373048901558, -0.012189379893243313, 0.015837036073207855, -0.059675466269254684, 0.023502930998802185, 0.0436045378446579, 0.08549336344003677, 0.04101194068789482, 0.0362262986600399, -0.036977630108594894, 0.030136659741401672, -0.01326...
0.10326
format. ### Labels format expression The `| label\_format` expression can rename, modify or add labels. It takes as parameter a comma separated list of equality operations, enabling multiple operations at once. When both side are label identifiers, for example `dst=src`, the operation will rename the `src` label into `...
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ -0.08269403874874115, 0.10063806176185608, -0.043808482587337494, 0.04629582166671753, -0.03105830028653145, 0.06050212308764458, 0.06114666163921356, 0.0898156389594078, 0.05099133029580116, -0.0614202655851841, 0.004728768020868301, 0.004457575269043446, -0.02948889136314392, 0.012876776...
0.121785
be ``` {app="some-api-service", level="info"} {"app": "some-api-service", "level": "info", "method": "GET", "path": "/", "host": "grafana.net", "status": "200"} {level="info"} {"app": "other-service", "level": "info", "method": "GET", "path": "/", "host": "grafana.net", "status": "200"} ```
https://github.com/grafana/loki/blob/main//docs/sources/query/log_queries/_index.md
main
loki
[ -0.07354313135147095, 0.08031382411718369, -0.024783452972769737, 0.00026078676455654204, -0.05711572617292404, -0.049955327063798904, 0.015443241223692894, 0.008325992152094841, -0.021293725818395615, 0.021852616220712662, -0.0191302802413702, -0.0594727098941803, 0.0022352542728185654, 0...
0.046201
# Query Loki with Python This page provides Python examples for the most common Loki HTTP API operations: querying logs, pushing log entries, and listing labels. For the full API reference including all parameters and response formats, see the [Loki HTTP API](../loki-http-api/) documentation. ## Prerequisites Install t...
https://github.com/grafana/loki/blob/main//docs/sources/reference/python-client-examples.md
main
loki
[ -0.03609504923224449, -0.01730331778526306, -0.07722029089927673, 0.006374390330165625, -0.05709809064865112, -0.10531535744667053, -0.050110071897506714, 0.012005379423499107, -0.00614624097943306, 0.019091200083494186, -0.000545690709259361, -0.03465604409575462, 0.03832712024450302, 0.0...
0.112944
1e9)), "limit": limit, "direction": "backward", }, headers=headers, auth=auth, verify=verify, ) resp.raise\_for\_status() return resp.json()["data"]["result"] results = query\_range( url="http://localhost:3100", query='{job="varlogs"} |= "error"', start=datetime.now() - timedelta(hours=1), end=datetime.now(), ) for str...
https://github.com/grafana/loki/blob/main//docs/sources/reference/python-client-examples.md
main
loki
[ -0.057840168476104736, 0.11101246625185013, -0.04623723775148392, 0.033944979310035706, -0.008568801917135715, -0.06437625735998154, -0.00474791694432497, 0.07935941964387894, -0.027131929993629456, -0.017526546493172646, -0.02635963447391987, -0.04209768772125244, -0.012363258749246597, 0...
0.091797
the response body for details: ```python import time import requests def query\_with\_retry( url: str, query: str, max\_retries: int = 3, backoff: float = 1.0, headers: dict[str, str] | None = None, auth: tuple[str, str] | None = None, verify: bool | str = True, # False to skip TLS, or path to CA bundle ) -> dict: """Q...
https://github.com/grafana/loki/blob/main//docs/sources/reference/python-client-examples.md
main
loki
[ -0.07407262921333313, 0.05137743428349495, -0.008359597064554691, 0.047498829662799835, -0.05624031648039818, -0.1262906938791275, -0.02791840210556984, -0.021107153967022896, 0.020442664623260498, 0.02009415440261364, 0.014476723037660122, -0.038825321942567825, 0.02712859958410263, -0.01...
0.052348
# Loki HTTP API Loki exposes an HTTP API for pushing, querying, and tailing log data, as well as for viewing and managing cluster information. {{< admonition type="note" >}} Note that authorization is not part of the Loki API. Authorization needs to be done separately, for example, using an open-source load-balancer su...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.003778536571189761, -0.016887711361050606, -0.05642271414399147, 0.05403810366988182, 0.009768822230398655, -0.08423229306936264, 0.0018426632741466165, 0.0373096838593483, 0.014042152091860771, 0.024619830772280693, 0.017750347033143044, -0.033047884702682495, -0.009337668307125568, 0....
0.222
`vector`, an Instant Vector represents the latest value of a calculation for a given labelset. Instant Vectors are only returned when doing a query against a single point in time. - \*\*Stream\*\*: a Stream is a set of all values (logs) for a given label set over the queried time range. Streams are the only type that w...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.08925575017929077, 0.050948772579431534, -0.06305348128080368, -0.027323240414261818, 0.00855276733636856, -0.039276123046875, 0.01091587170958519, 0.0734022930264473, 0.08627811074256897, -0.04793327674269676, 0.0174019206315279, -0.035181332379579544, -0.09386854618787766, 0.060894448...
0.075512
optionally attach [structured metadata](../../get-started/labels/structured-metadata/) to each log line by adding a JSON object to the end of the log line array. The JSON object must be a valid JSON object with string keys and string values. The JSON object should not contain any nested object. The JSON object must be ...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.021786246448755264, 0.0024172915145754814, -0.05638675019145012, 0.008616825565695763, -0.03854304924607277, -0.08423854410648346, -0.017696350812911987, 0.016376087442040443, 0.03227376937866211, 0.017068777233362198, 0.07933086156845093, -0.040686748921871185, -0.029273593798279762, 0...
0.131614
TIME ZONE | | labels | MAP(VARCHAR, VARCHAR) | | value | DOUBLE | See [statistics](#statistics) for information about the statistics returned by Loki. ### Examples This example cURL command ```bash curl -G -s "http://localhost:3100/loki/api/v1/query" \ --data-urlencode 'query=sum(rate({job="varlogs"}[10m])) by (level)'...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ 0.014283421449363232, 0.05164891481399536, -0.04545887932181358, 0.05521903932094574, -0.05105898901820183, -0.021869389340281487, -0.016215229406952858, 0.02380423992872238, 0.03929145634174347, -0.007334223948419094, -0.012888544239103794, -0.0960637554526329, 0.0011633092071861029, -0.0...
0.086327
based on `start` and `end`. Only applies to query types which produce a matrix response. - `interval`: Only return entries at (or greater than) the specified interval, can be a `duration` format or float number of seconds. Only applies to queries which produce a stream response. Not to be confused with `step`, see the ...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.047407977283000946, 0.015337206423282623, -0.05406804755330086, 0.00895021203905344, -0.0663013681769371, -0.04920133575797081, -0.0821683257818222, 0.02682475745677948, 0.06227860227227211, 0.016179058700799942, 0.008074145764112473, 0.00690077617764473, 0.01996111124753952, 0.01608317...
0.13782
} } } ``` ## Query labels ```bash GET /loki/api/v1/labels ``` `/loki/api/v1/labels` retrieves the list of known labels within a given time span. Loki may use a larger time span than the one specified. It accepts the following query parameters in the URL: - `start`: The start time for the query as a nanosecond Unix epoc...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.020030194893479347, 0.032653599977493286, -0.08265639841556549, 0.009202033281326294, -0.009339812211692333, 0.012550540268421173, 0.010581695474684238, 0.0587579607963562, 0.06776213645935059, -0.04446091875433922, 0.010771961882710457, -0.03581949323415756, -0.017931470647454262, 0.03...
0.13626
"job": "default/loki", "controller\_revision\_hash": "loki-stack-757479754d", "statefulset\_kubernetes\_io\_pod\_name": "loki-stack-0", "release": "loki-stack", "namespace": "default", "instance": "loki-stack-0" }, { "chart": "prometheus-9.3.3", "container\_name": "prometheus-server-configmap-reload", "filename": "/var...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ 0.013611750677227974, -0.01819419488310814, 0.020195625722408295, -0.012421810999512672, 0.030725998803973198, -0.07062245160341263, -0.006100436672568321, -0.030887557193636894, 0.0630866140127182, 0.027311410754919052, 0.027401680126786232, -0.060441453009843826, -0.04404102638363838, -0...
0.199616
team alpha, and you don't care which env those are in (other than caring that they're not dev jobs). To achieve this, you could specify `targetLabels=team,job`, resulting in a single metric series (in this case) of `{team="alpha", job="foo}`. The other way to change aggregations is with the `aggregateBy` parameter. The...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.018972577527165413, 0.014100804924964905, -0.09325792640447617, 0.05412977933883667, -0.04139932617545128, 0.009727167896926403, 0.07356639951467514, -0.027300016954541206, 0.08188051730394363, -0.03866095095872879, -0.0545743964612484, -0.06993085891008377, 0.0192934088408947, 0.058978...
0.095509
parameter is optional. ### Examples This example cURL command ```bash curl -s "http://localhost:3100/loki/api/v1/patterns" \ --data-urlencode 'query={app="loki"}' | jq ``` gave this response: ```json { "status": "success", "data": [ { "pattern": "<\_> caller=grpc\_logging.go:66 <\_> level=error method=/cortex.Ingester/...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.025868311524391174, 0.027137432247400284, -0.07499879598617554, -0.01674790307879448, -0.06507305800914764, -0.0812685564160347, -0.001672625308856368, 0.03781932219862938, 0.040587931871414185, -0.00987328216433525, 0.022723453119397163, -0.08658014237880707, -0.04219331219792366, 0.03...
0.122726
(for example, `1h`, `5m`). This parameter is optional and is used when `start` is omitted to compute `start = end - since`. If both `start` and `since` are omitted, `since` defaults to `1h`. - `step=`: Step between sample windows. This parameter is optional. - `line\_limit=`: Maximum number of log lines to scan per sha...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.014214648865163326, 0.05703650414943695, -0.0799051970243454, -0.02042478322982788, -0.08308969438076019, -0.051706064492464066, -0.03354378417134285, 0.03899269178509712, 0.03897938132286072, 0.018207555636763573, -0.02844160795211792, -0.00884181447327137, 0.06348294019699097, -0.0126...
0.043143
```bash GET /services ``` `/services` returns a list of all running services and their current states. Services can have the following states: - \*\*New\*\*: Service is new, not running yet (initial state) - \*\*Starting\*\*: Service is starting; if starting succeeds, service enters \*\*Running\*\* state - \*\*Running\...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.05144142732024193, 0.01693197339773178, -0.064148910343647, -0.05443510785698891, 0.04117219150066376, -0.01639573462307453, 0.02317473106086254, -0.018291449174284935, 0.02569897286593914, 0.04411529004573822, -0.019632019102573395, 0.03184216842055321, 0.016372451558709145, 0.06697984...
0.146858
ruler API endpoints require to configure a backend object storage to store the recording rules and alerts. The ruler API uses the concept of a "namespace" when creating rule groups. This is a stand-in for the name of the rule file in Prometheus. Rule groups must be named uniquely within a namespace. {{< admonition type...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.05260685458779335, 0.05538022145628929, -0.0914735421538353, -0.0019359348807483912, -0.03582683950662613, -0.09639988094568253, -0.025461984798312187, -0.010478612035512924, 0.05191602557897568, 0.010007116943597794, 0.04001791030168533, -0.03193282335996628, 0.017229028046131134, -0.0...
0.123551
end of the time window within which entries will be deleted. If not specified, defaults to the current time. - `max\_interval=`: The maximum time period the delete request can span. If the request is larger than this value, it is split into several requests of <= `max\_interval`. Valid time units are `s`, `m`, and `h`....
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.07118532061576843, 0.05774930119514465, -0.026629533618688583, 0.008964755572378635, -0.015186113305389881, -0.04723488911986351, -0.02353515662252903, -0.05648186802864075, 0.13287679851055145, -0.05194684863090515, -0.0535786896944046, 0.014848260208964348, 0.013391026295721531, -0.02...
0.093654
request to cancel; IDs are found using the `delete` endpoint. - `force=`: When the `force` query parameter is true, partially completed delete requests will be canceled. {{< admonition type="note" >}} some data from the request may still be deleted and the deleted request will be listed as 'processed'. {{< /admonition ...
https://github.com/grafana/loki/blob/main//docs/sources/reference/loki-http-api.md
main
loki
[ -0.07565508782863617, 0.060669589787721634, -0.06465858966112137, 0.02116726152598858, -0.025372300297021866, -0.06344028562307358, 0.013097941875457764, -0.10906486213207245, 0.11639349907636642, 0.04448816552758217, 0.012560113333165646, 0.01538739912211895, 0.04300511255860329, -0.03356...
0.124705
# Consistent hash rings [Consistent hash rings](https://en.wikipedia.org/wiki/Consistent\_hashing) are incorporated into Loki cluster architectures to - aid in the sharding of log lines - implement high availability - ease the horizontal scale up and scale down of clusters. There is less of a performance hit for operat...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/hash-rings.md
main
loki
[ 0.002756163477897644, -0.046876464039087296, -0.053955838084220886, -0.011069085448980331, -0.03427751734852791, -0.08727794885635376, 0.0009836042299866676, 0.010341493412852287, 0.08217967301607132, -0.057381704449653625, -0.0033197379671037197, 0.06312891095876694, 0.059768371284008026, ...
0.154667
by rulers or queriers.
https://github.com/grafana/loki/blob/main//docs/sources/get-started/hash-rings.md
main
loki
[ 0.07497904449701309, 0.08444181829690933, -0.03385937213897705, 0.03423988074064255, -0.11671854555606842, -0.050367336720228195, 0.016198130324482918, -0.03959498554468155, -0.020554466173052788, 0.05797373130917549, 0.054716821759939194, -0.06941308826208115, 0.04783887043595314, -0.0516...
0.088692
# Loki architecture Grafana Loki has a microservices-based architecture and is designed to run as a horizontally scalable, distributed system. The system has multiple components that can run separately and in parallel. The Grafana Loki design compiles the code for all components into a single binary or Docker image. Th...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/architecture.md
main
loki
[ -0.03365149348974228, -0.05885259807109833, -0.06522117555141449, 0.0028130202554166317, -0.04142479598522186, -0.07031667977571487, -0.08910422772169113, 0.0019015194848179817, -0.030022017657756805, 0.059620700776576996, -0.005193152464926243, -0.03129453584551811, 0.012647937051951885, ...
0.113769
| ---------------------------------------------------------------------------- | checksum(from #blocks) | ---------------------------------------------------------------------------- | #structuredMetadata len (uvarint) | #structuredMetadata offset (uvarint) | ------------------------------------------------------------...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/architecture.md
main
loki
[ 0.0045419419184327126, 0.06935504078865051, -0.0792950838804245, -0.06188954412937164, -0.03885791078209877, -0.030671268701553345, 0.021687228232622147, 0.05026501417160034, 0.0008629176300019026, 0.017478493973612785, 0.09458427876234055, -0.07376676797866821, 0.0273582860827446, -0.0648...
0.058855
frontend waits for all sub-queries of a query to be finished and returned by the queriers. 1. The query frontend merges the individual results into a final result and return it to the client. Refer to [Components](../components/) for a more detailed description of the components involved in the read path. ## Multi-tena...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/architecture.md
main
loki
[ -0.007036434020847082, 0.0037633709143847227, -0.06676392257213593, 0.04444408044219017, -0.04092927649617195, -0.08179520070552826, -0.066651850938797, -0.026651199907064438, 0.06183047592639923, -0.005502875428646803, 0.030769741162657738, 0.016250958666205406, 0.0018159225583076477, -0....
0.046574
# Loki overview Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by [Prometheus](https://prometheus.io/). Loki differs from Prometheus by focusing on logs instead of metrics, and collecting logs via push, instead of pull. Loki is designed to be very cost effective and high...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/overview.md
main
loki
[ -0.02066306583583355, -0.005161988083273172, -0.011221546679735184, 0.038251809775829315, 0.09812206029891968, -0.07998273521661758, 0.001708157011307776, 0.04530670866370201, 0.08113031089305878, 0.03637106344103813, -0.02014576829969883, -0.004205677192658186, 0.015616306103765965, 0.084...
0.214381
find LogQL familiar and flexible for generating queries against the logs. The language also facilitates the generation of metrics from log data, a powerful feature that goes well beyond log aggregation. - \*\*Alerting\*\* - Loki includes a component called the [ruler](../../alert/), which can continually evaluate queri...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/overview.md
main
loki
[ -0.05640396103262901, -0.009954186156392097, -0.05671674385666847, 0.0589594729244709, -0.01068483293056488, -0.11588707566261292, 0.03864002600312233, -0.005885281600058079, 0.06743793189525604, 0.02961023338139057, -0.03376217558979988, -0.09715481847524643, 0.022948337718844414, 0.04322...
0.237326
# Loki components {{< youtube id="\_hv4i84Z68s" >}} Loki is a modular system that contains many components that can either be run together (in "single binary" mode with target `all`), in logical groups (in "simple scalable deployment" mode with targets `read`, `write`, `backend`), or individually (in "microservice" mod...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.038874924182891846, -0.0849023163318634, -0.12047542631626129, -0.024575788527727127, -0.014273891225457191, -0.027282247319817543, -0.005497153848409653, -0.02429652400314808, -0.03263779729604721, 0.01409823913127184, 0.06621405482292175, -0.01335971336811781, 0.006824501324445009, -0...
0.150107
level and enables us to scale the distributors up or down and have the per-distributor limit adjust accordingly. For instance, say we have 10 distributors and tenant A has a 10MB rate limit. Each distributor will allow up to 1MB/s before limiting. Now, say another large tenant joins the cluster and we need to spin up 1...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.047188472002744675, -0.050231579691171646, -0.10355260968208313, 0.01909981667995453, -0.023501312360167503, -0.03143196552991867, -0.04901167005300522, 0.03899350389838219, 0.043698061257600784, -0.004358481615781784, 0.05388624593615532, 0.05293353274464607, 0.030729571357369423, -0.0...
0.208186
achieve consistent hashing; all [ingesters](#ingester) register themselves into the hash ring with a set of tokens they own. Each token is a random unsigned 32-bit number. Along with a set of tokens, ingesters register their state into the hash ring. The state `JOINING`, and `ACTIVE` may all receive write requests, whi...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.04898657277226448, -0.015340819023549557, -0.06906099617481232, -0.08844276517629623, -0.02803903818130493, -0.05355047807097435, 0.07928145676851273, -0.0077288225293159485, 0.061577700078487396, -0.0033660002518445253, -0.029007120057940483, 0.022786259651184082, 0.07478774338960648, ...
0.185483
1. A flush occurs. Whenever a chunk is compressed and marked as read-only, a writable chunk takes its place. If an ingester process crashes or exits abruptly, all the data that has not yet been flushed will be lost. Loki is usually configured to replicate multiple replicas (usually 3) of each log to mitigate this risk....
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.10005218535661697, -0.007350085768848658, 0.002403394551947713, 0.02891903929412365, -0.018484177067875862, -0.10086504369974136, -0.037019725888967514, -0.032124195247888565, 0.0964573472738266, 0.08398830890655518, 0.014780034311115742, 0.05775640532374382, -0.01815328188240528, -0.06...
0.144313
This process is used to avoid flushing all chunks when shutting down, which is a slow process. ### Filesystem support While ingesters do support writing to the filesystem through BoltDB, this only works in single-process mode as [queriers](#querier) need access to the same back-end store and BoltDB only allows one proc...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.03716189041733742, -0.051984794437885284, -0.05363995581865311, 0.09232701361179352, -0.051665931940078735, -0.05952523648738861, 0.02375325746834278, 0.022429144009947777, 0.0769108384847641, 0.053880464285612106, -0.06455399096012115, 0.09918554127216339, 0.01921996660530567, -0.10961...
0.214922
in order to verify that nothing else matches. #### Index stats queries The query frontend caches index stats query results similar to the [metric query](#metric-queries) results. This cache is only applicable when using single store TSDB. #### Log volume queries The query frontend caches log volume query results simila...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.040298447012901306, -0.02922135405242443, -0.016062477603554726, 0.06027887761592865, -0.05899229645729065, -0.0724150612950325, 0.022664684802293777, -0.047360606491565704, 0.0708189606666565, 0.06825173646211624, -0.04367217421531677, -0.007389185018837452, 0.026162149384617805, 0.024...
0.135867
the old files. Additionally, the compactor is also responsible for [log retention](https://grafana.com/docs/loki//operations/storage/retention/) and [log deletion](https://grafana.com/docs/loki//operations/storage/logs-deletion/). In a Loki deployment, the compactor service is usually run as a single instance. ## Ruler...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.10988347232341766, 0.014120623469352722, -0.10525111109018326, 0.02473496086895466, -0.004775776993483305, -0.08638455718755722, -0.05653604120016098, -0.014958883635699749, 0.055932383984327316, 0.06808211654424667, 0.037361059337854385, 0.06586898863315582, 0.026721090078353882, 0.027...
0.189705
filter expression. The service is horizontally scalable. When running multiple instances, the client (Index Gateway) shards requests across instances based on the hash of the bloom blocks that are referenced.
https://github.com/grafana/loki/blob/main//docs/sources/get-started/components.md
main
loki
[ -0.016529081389307976, -0.004348633345216513, 0.029595965519547462, -0.02442283369600773, 0.01894322596490383, -0.06264174729585648, 0.009684707038104534, -0.0841922014951706, 0.1166667565703392, -0.027749894186854362, -0.05968037620186806, 0.03872225806117058, 0.011809093877673149, 0.0046...
0.137297
# Loki deployment modes Loki is a distributed system consisting of many microservices. It also has a unique build model where all of those microservices exist within the same binary. You can configure the behavior of the single binary with the `-target` command-line flag to specify which microservices will run on start...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/deployment-modes.md
main
loki
[ 0.06252475082874298, -0.04726209491491318, 0.02379041537642479, -0.011805251240730286, 0.013865899294614792, -0.07464446127414703, -0.03466730937361717, 0.03469608351588249, -0.038985803723335266, 0.011047697626054287, 0.041516635566949844, -0.011212540790438652, 0.003824828192591667, 0.02...
0.156504
stateless and can be run as a Kubernetes Deployment that can be scaled automatically (Note that in the official helm chart it is currently deployed as a stateful set). It contains the following components: \* Query Frontend \* Querier - `-target=backend` - The backend target is stateful, and is controlled by a Kubernet...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/deployment-modes.md
main
loki
[ 0.00471470644697547, -0.005342019721865654, 0.015412697568535805, -0.0025968144182115793, -0.06564506888389587, -0.03332473710179329, -0.0793108344078064, -0.003973012324422598, 0.017627133056521416, 0.06697873771190643, -0.02630758471786976, 0.014483563601970673, 0.0411837212741375, -0.01...
0.195002
# Get started with Grafana Loki {{< youtube id="1uk8LtQqsZQ" >}} Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus. It's designed to be very cost-effective and easy to operate. It doesn't index the contents of the logs, but rather a set of labels for each log ...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/_index.md
main
loki
[ -0.01934046670794487, -0.029929781332612038, -0.0033873221836984158, -0.03326389566063881, -0.011957296170294285, -0.048857878893613815, -0.042822301387786865, -0.0005988696939311922, 0.04477609694004059, 0.05930287763476372, -0.015573922544717789, -0.045548539608716965, -0.02399402670562267...
0.132138
# Modify default OpenTelemetry labels When Grafana Loki first started supporting OpenTelemetry, we selected a set of [default resource attributes to promote to labels](https://grafana.com/docs/loki//get-started/labels/#default-labels-for-opentelemetry). We included some labels such as k8s.pod.name to be consistent with...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/modify-default-labels.md
main
loki
[ -0.09791531413793564, 0.05732256919145584, -0.05474071204662323, 0.044762108474969864, -0.017790520563721657, -0.029891524463891983, 0.00705554336309433, -0.021425409242510796, -0.013261787593364716, -0.04887866601347923, 0.02763131633400917, -0.06223267316818237, 0.0002306746901012957, 0....
0.171444
Helm chart to demote `k8s.pod.name` and `service.instance.id` from index labels to structured metadata. ```yaml # Enable pod log collection for the cluster. Will collect logs from all pods in both the meta and loki namespace. podLogs: enabled: true collector: alloy-singleton #List of attributes to use as index labels i...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/modify-default-labels.md
main
loki
[ 0.0482688844203949, 0.038971997797489166, 0.029921602457761765, 0.023519303649663925, 0.02472265064716339, 0.005219056736677885, -0.00422365078702569, 0.026954669505357742, 0.06459832191467285, 0.05035727843642235, -0.0071400366723537445, -0.10843707621097565, 0.010943346656858921, -0.0227...
0.177341
# Cardinality The cardinality of a data attribute is the number of distinct values that the attribute can have. For example, a boolean column in a database, which can only have a value of either `true` or `false` has a cardinality of 2. High cardinality refers to a column or row in a database that can have many possibl...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/cardinality.md
main
loki
[ 0.08415671437978745, -0.02914145588874817, -0.06885159015655518, -0.026980610564351082, -0.004304875619709492, 0.019201351329684258, 0.06692878156900406, 0.0401461198925972, 0.12139619886875153, -0.02374427206814289, 0.03389164060354233, -0.03043949604034424, 0.06492683291435242, -0.009586...
0.116604
label. [Query acceleration with Blooms](https://grafana.com/docs/loki//operations/bloom-filters/) also utilizes structured metadata. {{< /admonition >}}
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/cardinality.md
main
loki
[ -0.07138589024543762, 0.07661460340023041, -0.06559041142463684, 0.06448370218276978, -0.05213344842195511, -0.004287525080144405, 0.02545848861336708, -0.04764339700341225, -0.008474057540297508, -0.062280744314193726, -0.017692508175969124, -0.03721863031387329, -0.014346362091600895, -0...
0.147923
# What is structured metadata {{< admonition type="warning" >}} Structured metadata was added to chunk format V4 which is used if the schema version is greater or equal to `13`. See [Schema Config](https://grafana.com/docs/loki//configure/storage/#schema-config) for more details about schema versions. {{< /admonition >...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/structured-metadata.md
main
loki
[ -0.02464182674884796, 0.057075176388025284, -0.06540382653474808, -0.03020353987812996, -0.001661404618062079, -0.08496825397014618, -0.0430249348282814, 0.03515784069895744, 0.06027252599596977, 0.026700777933001518, -0.0161240603774786, -0.05453355982899666, -0.030665351077914238, 0.0410...
0.200632
[max\_structured\_metadata\_entries\_count: | default = 128] ``` {{< /admonition >}} ## Querying structured metadata Structured metadata is extracted automatically for each returned log line and added to the labels returned for the query. You can use labels of structured metadata to filter log line using a [label filte...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/structured-metadata.md
main
loki
[ -0.04396415501832962, 0.0409352146089077, -0.04666951671242714, 0.0013905244413763285, -0.07715100795030594, -0.06218920648097992, 0.04198721423745155, -0.04033037647604942, 0.024871326982975006, 0.0114626819267869, -0.03460580110549927, -0.08709397166967392, 0.004594425205141306, 0.029353...
0.068591
# Label best practices Grafana Loki is under active development, and we are constantly working to improve performance. But here are some of the most current best practices for labels that will give you the best experience with Loki. ## Static labels are good Use labels for things like regions, clusters, servers, applic...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/bp-labels.md
main
loki
[ -0.05119956657290459, 0.002834529150277376, -0.08810538798570633, 0.01121174730360508, -0.02811400219798088, -0.010814999230206013, 0.0345173217356205, 0.03676436468958855, 0.0029966840520501137, -0.01862430013716221, -0.010143923573195934, -0.060123883187770844, -0.001021676231175661, 0.0...
0.173114
dynamic labels with Loki: - Ensure the labels have low cardinality, ideally limited to tens of values. - Use labels with long-lived values, such as the initial segment of an HTTP path: `/load`, `/save`, `/update`. - Do not extract ephemeral values like a trace ID or an order ID into a label; the values should be static...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/bp-labels.md
main
loki
[ 0.006510262843221426, 0.014939956367015839, -0.08744241297245026, 0.026116633787751198, -0.038676973432302475, -0.008571673184633255, 0.035917267203330994, 0.054146476089954376, 0.004193759988993406, -0.0678476020693779, -0.022404437884688377, -0.04669753834605217, 0.010511535219848156, 0....
0.108675
# Understand labels Labels are a crucial part of Loki. They allow Loki to organize and group together log messages into log streams. Each log stream must have at least one label to be stored and queried in Loki. In this topic we'll learn about labels and why your choice of labels is important when shipping logs to Loki...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/_index.md
main
loki
[ -0.012450167909264565, -0.0001446708047296852, -0.054861947894096375, 0.017327332869172096, 0.0023922575637698174, -0.05202987790107727, 0.02523740753531456, 0.00935948546975851, 0.05956796556711197, 0.022071529179811478, 0.0064732288010418415, -0.06566236168146133, -0.023111354559659958, ...
0.124867
select resource attributes as labels. Although the default config selects more than 15 Resource Attributes, some are mutually exclusive. {{< /admonition >}} {{< admonition type="tip" >}} For Grafana Cloud Logs, see the [current OpenTelemetry guidance](https://grafana.com/docs/grafana-cloud/send-data/otlp/otlp-format-co...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/_index.md
main
loki
[ -0.024523606523871422, 0.0373120978474617, -0.12000037729740143, 0.022806843742728233, 0.009308339096605778, -0.0337623730301857, 0.020861737430095673, -0.053421664983034134, 0.02413777820765972, 0.0037171838339418173, 0.03569471463561058, -0.08871009200811386, -0.014564042910933495, 0.024...
0.109417
or virtual machines, the hostname should be stored in [structured metadata](https://grafana.com/docs/loki//get-started/labels/structured-metadata/). If your logs had the example labels above, then you might query them in LogQL like this: `{namespace="mynamespace", cluster="cluster123" filename="/var/log/myapp.log"}` Un...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/_index.md
main
loki
[ -0.03671246021986008, 0.012020844034850597, -0.09601248055696487, 0.04468042775988579, -0.011540479958057404, -0.05135352537035942, 0.005735292565077543, -0.0028129357378929853, 0.06529274582862854, 0.002095175674185157, 0.0041078538633883, -0.07978174090385437, 0.03944139555096626, 0.0268...
0.140591
`{environment="production", app="fast\_app"}` Now the "fast\_app" and "slow\_app" will ship logs to different streams, allowing each to maintain their order of ingestion. ## Loki labels examples The way that labels are added to logs is configured in the client that you use to send logs to Loki. The specific configurati...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/_index.md
main
loki
[ -0.05135531350970268, -0.005380370654165745, -0.035868991166353226, 0.021156437695026398, 0.009175640530884266, -0.01688135787844658, 0.0504615418612957, 0.032860059291124344, -0.0010908349649980664, 0.00541413901373744, -0.011923828162252903, -0.07986603677272797, 0.04482424259185791, 0.0...
0.169237
-0500] "GET /1986.js HTTP/1.1" 200 932 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 GTB6" {job="apache",env="dev",action="POST",status\_code="200"} 11.11.11.12 - frank [25/Jan/2000:14:00:02 -0500] "POST /1986.js HTTP/1.1" 200 932 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/labels/_index.md
main
loki
[ -0.05433971807360649, 0.03040310926735401, -0.03193579614162445, 0.012566464021801949, 0.04707050323486328, -0.0922691598534584, -0.04713701456785202, -0.0820646584033966, 0.04305239021778107, -0.05854302644729614, 0.015544547699391842, 0.05040862038731575, -0.02008652500808239, -0.0089931...
0.013756
# Quickstart to run Loki locally If you want to experiment with Loki, you can run Loki locally using the Docker Compose file that ships with Loki. It runs Loki in the [simple scalable deployment](https://grafana.com/docs/loki//get-started/deployment-modes/#simple-scalable) mode and includes a sample application to gene...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/quick-start.md
main
loki
[ -0.05941234529018402, -0.009927481412887573, -0.038531843572854996, 0.02529635652899742, 0.02377542294561863, -0.1047583818435669, -0.0640404000878334, 0.016393352299928665, -0.013828005641698837, 0.037489812821149826, -0.05864192172884941, -0.07469619065523148, -0.03684428706765175, 0.034...
0.12841
Grafana Alloy is running. - You can access the Grafana Alloy UI at [http://localhost:12345](http://localhost:12345). 6. (Optional) You can check all the containers are running by running the following command: ```bash docker ps -a ``` ## View your logs in Grafana After you have collected logs, you will want to view the...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/quick-start.md
main
loki
[ -0.061242472380399704, -0.010056523606181145, -0.06084354594349861, 0.057522255927324295, 0.07214067876338959, -0.08935574442148209, -0.024580636993050575, -0.015084744431078434, -0.020501328632235527, 0.0018636424792930484, -0.0408620722591877, -0.11091521382331848, -0.01377196703106165, ...
0.085225
logfmt parser\*\*, by clicking \*\*Use this query\*\*. 1. On the Explore tab, click \*\*Label browser\*\*, in the dialog select a container and click \*\*Show logs\*\*. For a thorough introduction to LogQL, refer to the [LogQL reference](https://grafana.com/docs/loki//query/). ## Sample queries (code view) Here are som...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/quick-start.md
main
loki
[ -0.024145763367414474, -0.030462129041552544, -0.09291906654834747, 0.07914881408214569, 0.010289523750543594, -0.09008761495351791, 0.043135203421115875, -0.017109237611293793, 0.03306107968091965, 0.0067563895136117935, -0.04035135731101036, -0.0572969950735569, 0.004039067309349775, -0....
0.046064
# Loki Tutorial This quickstart guide will walk you through deploying Loki in single binary mode (also known as [monolithic mode](https://grafana.com/docs/loki//get-started/deployment-modes/#monolithic-mode)) using Docker Compose. Grafana Loki is only one component of the Grafana observability stack for logs. In this t...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/tutorial.md
main
loki
[ -0.06838792562484741, 0.00010687726171454415, -0.029146987944841385, -0.019563471898436546, -0.035282544791698456, -0.10014969855546951, -0.02619856595993042, 0.025094138458371162, -0.017055297270417213, 0.06792566925287247, 0.0033539978321641684, -0.11159475147724152, -0.006954531650990248,...
0.140391
with Grafana Logs Drilldown](https://grafana.com/docs/grafana/latest/explore/simplified-exploration/logs/get-started/). ## Collect logs from a sample application Currently, the Loki stack is collecting logs about itself. To provide a more realistic example, you can deploy a sample application that generates logs. The s...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/tutorial.md
main
loki
[ -0.11686646938323975, -0.04168802872300148, -0.057653095573186874, 0.005916121881455183, -0.012705313041806221, -0.11766340583562851, -0.0008914450299926102, -0.003774109063670039, 0.030163338407874107, 0.0794277936220169, 0.005521439015865326, -0.08048858493566513, 0.003530333749949932, 0...
0.24606
1. From the menu in the dashboard header, select the Loki data source (2). This displays the Loki query editor. In the query editor you use the Loki query language, [LogQL](https://grafana.com/docs/loki//query/), to query your logs. To learn more about the query editor, refer to the [query editor documentation](https:/...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/tutorial.md
main
loki
[ -0.0802958756685257, -0.015532022342085838, -0.08005530387163162, 0.05789019912481308, -0.07498262077569962, -0.06343748420476913, -0.037166912108659744, 0.0007186798029579222, 0.018192574381828308, 0.06826069951057434, -0.03344351425766945, -0.0788610577583313, 0.023579873144626617, -0.00...
0.096194
of `ERROR` and a `line` attribute of `58`. LogQL also supports metrics queries. Metrics are useful for abstracting the raw log data aggregating attributes into numeric values. This allows you to utilize more visualization options in Grafana as well as generate alerts on your logs. For example, you can use a metric quer...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/tutorial.md
main
loki
[ -0.05063437297940254, 0.021312503144145012, -0.049520183354616165, 0.03095274604856968, -0.07097511738538742, -0.08027460426092148, -0.009331723675131798, 0.027939941734075546, 0.027898145839571953, 0.06571254134178162, -0.018361466005444527, -0.12533611059188843, 0.08119352161884308, 0.01...
0.070813
are connected: \* \*\*discovery.docker\*\*: This component queries the metadata of the Docker environment via the Docker socket and discovers new containers, as well as providing metadata about the containers. \* \*\*discovery.relabel\*\*: This component converts a metadata (`\_\_meta\_docker\_container\_name`) label i...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/tutorial.md
main
loki
[ 0.010310729034245014, 0.03562571853399277, -0.006323863286525011, 0.025466708466410637, 0.05973532795906067, -0.0495440699160099, 0.04521910101175308, -0.0337008498609066, 0.060438014566898346, 0.023399652913212776, -0.02558799833059311, -0.07560283690690994, 0.016740839928388596, 0.020528...
0.156705
documentation. ### Grafana Loki Data source The final piece of the puzzle is the Grafana Loki data source. This is used by Grafana to connect to Loki and query the logs. Grafana has multiple ways to define a data source: \* \*\*Direct\*\*: This is where you define the data source in the Grafana UI. \* \*\*Provisioning\...
https://github.com/grafana/loki/blob/main//docs/sources/get-started/quick-start/tutorial.md
main
loki
[ -0.061100322753190994, -0.016098501160740852, -0.029499683529138565, 0.036002740263938904, -0.036276549100875854, -0.08795496821403503, -0.04878855124115944, -0.021799759939312935, -0.004582228604704142, 0.06742823123931885, 0.006542514078319073, -0.10853428393602371, 0.020749663934111595, ...
0.01179
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex char...
https://github.com/dgkanatsios/CKAD-exercises/blob/main//CODE_OF_CONDUCT.md
main
ckad-exercises
[ -0.0039531160145998, 0.06808163970708847, -0.005732879973948002, -0.0030267671681940556, -0.014490759931504726, 0.06686898320913315, 0.003709884826093912, -0.05929004028439522, -0.025362461805343628, 0.011467767879366875, 0.00841405987739563, -0.041727155447006226, -0.015594778582453728, 0...
0.079829
![](https://gaforgithub.azurewebsites.net/api?repo=CKAD-exercises/state∅) # State Persistence (8%) kubernetes.io > Documentation > Tasks > Configure Pods and Containers > [Configure a Pod to Use a Volume for Storage](https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/) kubernetes.io > Doc...
https://github.com/dgkanatsios/CKAD-exercises/blob/main//g.state.md
main
ckad-exercises
[ 0.010954753495752811, -0.005278872326016426, -0.02476830594241619, 0.04719668626785278, -0.021417509764432907, 0.008942069485783577, -0.00583679461851716, -0.017000501975417137, 0.043618351221084595, 0.08693358302116394, -0.0033062929287552834, -0.02907462790608406, 0.07245024293661118, 0....
0.08038
```bash kubectl create -f pvc.yaml ``` Show the PersistentVolumeClaims and PersistentVolumes: ```bash kubectl get pvc # will show as 'Bound' kubectl get pv # will show as 'Bound' as well ``` ### Create a busybox pod with command 'sleep 3600', save it on pod.yaml. Mount the PersistentVolumeClaim to '/etc/foo'. Connect t...
https://github.com/dgkanatsios/CKAD-exercises/blob/main//g.state.md
main
ckad-exercises
[ 0.051295265555381775, -0.007234819699078798, 0.006662418600171804, 0.006438829470425844, -0.01815757527947426, 0.0043291617184877396, -0.040879081934690475, 0.01815040037035942, 0.07708265632390976, 0.02035929635167122, 0.008207486942410469, -0.05156677961349487, -0.016584692522883415, -0....
0.060715
![](https://gaforgithub.azurewebsites.net/api?repo=CKAD-exercises/pod\_design∅) # Pod design (20%) [Labels And Annotations](#labels-and-annotations) [Deployments](#deployments) [Jobs](#jobs) [Cron Jobs](#cron-jobs) ## Labels and Annotations kubernetes.io > Documentation > Concepts > Overview > Working with Kubernetes O...
https://github.com/dgkanatsios/CKAD-exercises/blob/main//c.pod_design.md
main
ckad-exercises
[ -0.0388859324157238, 0.039589717984199524, -0.037317465990781784, -0.006667119450867176, -0.01638748310506344, 0.055635567754507065, 0.06795883178710938, -0.07487019151449203, 0.06366049498319626, 0.004276731517165899, -0.023144403472542763, -0.10481348633766174, 0.012877468951046467, -0.0...
0.128771
`nodeName` forces the Pod to be bound to a specific node (bypassing the scheduler). For more details, see the official docs: [https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename) ```yaml apiVersion: v1 kind:...
https://github.com/dgkanatsios/CKAD-exercises/blob/main//c.pod_design.md
main
ckad-exercises
[ -0.010020067915320396, 0.07600445300340652, 0.0748477429151535, 0.0430811308324337, 0.042090464383363724, -0.02612891234457493, -0.01564953103661537, -0.0776575356721878, 0.09046228975057602, 0.017151374369859695, -0.08418493717908859, -0.04873044416308403, -0.0012199489865452051, -0.03255...
0.123989
confirm that the replicas are OK show ```bash kubectl rollout history deploy nginx kubectl get deploy nginx kubectl get rs # check that a new replica set has been created kubectl get po ``` ### Undo the latest rollout and verify that new pods have the old image (nginx:1.18.0) show ```bash kubectl rollout undo deploy ng...
https://github.com/dgkanatsios/CKAD-exercises/blob/main//c.pod_design.md
main
ckad-exercises
[ -0.004645166452974081, 0.02636193111538887, 0.06635301560163498, -0.053231749683618546, 0.005500571336597204, -0.04850811883807182, -0.0402190126478672, -0.05740709230303764, 0.07837849110364914, 0.02901548147201538, 0.012107589282095432, -0.03381646052002907, -0.012890373356640339, 0.0047...
0.045736
from within a Pod: ``` # run a wget to the Service my-app-svc kubectl run -it --rm --restart=Never busybox --image=gcr.io/google-containers/busybox --command -- wget -qO- my-app-svc version-1 ``` Deploy 1 replica of v2: ``` apiVersion: apps/v1 kind: Deployment metadata: name: my-app-v2 labels: app: my-app spec: replica...
https://github.com/dgkanatsios/CKAD-exercises/blob/main//c.pod_design.md
main
ckad-exercises
[ 0.03452743962407112, 0.014983187429606915, 0.01861584559082985, 0.020779583603143692, 0.044437143951654434, -0.06855029612779617, -0.03320525586605072, -0.07336844503879547, 0.060798726975917816, 0.03783060610294342, 0.006182551383972168, -0.056028060615062714, -0.0994316041469574, -0.0423...
0.026117