44 Commits

Author SHA1 Message Date
e15da437f0 Shard deletes requests based on time ranges (#6903)
* Refactor the store API to be in terms of DeleteRequest

* backfill remove tests

* backfill GetAll tests

* Make the delete request store deal in groups of requests instead of single ones

* Make cancelation aware of request groups

* remove cancelation deadline

* shard deletes based on a query parameter

* merge request group on gets

* global configuration for max query range

* sort delete requests by start time so batches are grouped to similar chunks

* Fix status when some deletes haven't happened yet

* fix tests

* Review feedback

* review feedback

* make max_interval > deletion interval a validation error

* list partially completed deletes

* list partially completed deletes

* fix flaky test

* clarify naming

* disallow cancelation of partial deletes unless the 'force' flag is passed

* more comment specificity for the delete request hash
2022-08-24 08:45:00 -06:00
983ab80e7c Add delete api validations (#6860)
* break out the middleware

* Add validation to the API

- Time must be in RFC3339 or a 10-digit-unix-seconds timestamp
- Start time must always exist

* lint

* docs

* improve tests

* cleanup

* cleanup

* access runtime config via function on validation
2022-08-10 11:09:02 -06:00
5b432e3d99 Docs: Fix bad links in the API section (#6688)
* Docs: Fix a bad link in the API section

* Fix 2 more of the same bad link
2022-07-15 09:34:01 +01:00
1f676adf06 Add API delete curl examples (#6680)
* Add API delete curl examples

* Update docs/sources/api/_index.md

Co-authored-by: Jennifer Villa <jvilla2013@gmail.com>

* Update docs/sources/api/_index.md

Co-authored-by: Jennifer Villa <jvilla2013@gmail.com>

* Update docs/sources/api/_index.md

Co-authored-by: Jennifer Villa <jvilla2013@gmail.com>

* Update docs/sources/api/_index.md

Co-authored-by: Jennifer Villa <jvilla2013@gmail.com>

Co-authored-by: Jennifer Villa <jvilla2013@gmail.com>
2022-07-14 16:00:20 -05:00
92aa69bb5c Docs: Add multi-tenant query curl examples (#6530)
* Docs: Add multi-tenant query curl examples

* Revise per review suggestions.
2022-06-30 13:20:48 -07:00
27477bf5f5 Docs: improve API docs (#6485)
* Docs: improve API docs

* Implement review suggestions.
2022-06-28 12:44:22 -07:00
c12a1f4f43 feature: Add ingester handler for shutdown and forget tokens (#6179)
* Update grafana/dskit to 07166f9

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>

* Add /ingester/shutdown handler

This handler replaces the deprecated /ingester/flush_shutdown handler
and can be used to gracefully shut down a Loki instance and delete the
file that persists the tokens of the ingester ring.

In production environments you usually want to persist ring tokens so
that during a restart of an ingester instance, or during rollout, the
tokens from that instance are not re-distributed to other instances, but
instead kept so that the same streams end up on the same instance once
it is up and running again. For that, the tokens are written to a file
that can be specified via the `-ingester.tokens-file-path` argument.

In certain cases, however, you want to forget the tokens and
re-distribute them when shutting down an ingester instance. This was
already possible by calling `/ingester/flush_shutdown`, deleting the
tokens file and terminating the process. The new handler
`/ingester/shutdown` combines these manual steps into a
single handler.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>

* Add changelog entry

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
2022-06-14 15:44:01 +02:00
3f4a663dbe Tsdb/index sampling endpoint (#6347)
* index sampling endpoint

* fix bug in withTenantLabelMatcher

* show zero values in stats

* handles new errcase

* fixes comments
2022-06-09 13:53:31 -04:00
0075085e9a docs: describe ordering in http query results (#6024)
* docs: describe ordering in http query results

* improved text

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

* better text

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

* better text

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
2022-05-20 16:10:56 -04:00
f39552c7fa Add docs for updated deletion api (#5763)
* Add docs for updated deletion api

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Fix parameter name

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Clarify that only the delete requests for the current tenant are shown

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Update docs/sources/api/_index.md

Co-authored-by: Christian Simon <simon@swine.de>

* Update docs/sources/operations/storage/logs-deletion.md

Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* Update docs/sources/operations/storage/logs-deletion.md

Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* Update docs/sources/operations/storage/logs-deletion.md

Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>

* Specify all delete endpoints use authentication

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Add description of delete modes

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Apply suggestions from code review

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

Co-authored-by: Christian Simon <simon@swine.de>
Co-authored-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
2022-05-16 12:17:11 +02:00
8838530976 Document /services API endpoint (#6111)
* Documented /services API endpoint

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>

* Grammar

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
2022-05-06 12:24:37 +02:00
0a68bd2d4e docs: update the labels timespan info (#6019)
* docs: update the labels timespan info

* updated docs

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

* updated docs

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
2022-05-04 08:18:31 -07:00
149227b889 Minor fixes in docs/sources/api/_index.md (#5915) 2022-04-28 08:58:46 -07:00
d74fc2c06d Docs: update documentation about "limit" param (#5540) 2022-03-08 13:20:52 +01:00
6f46a8ffeb Docs: Fix links and formatting of HTTP API page (#5498) 2022-03-01 09:35:37 +01:00
c3edeac990 Docs: fix link reference to "Step vs Interval" section. (#5495) 2022-02-28 14:31:34 -08:00
ead9444d78 Document all support API timestamp formats. (#5439)
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
2022-02-28 17:47:48 +01:00
5f07e95fc8 Document query limit parameter default. (#5133) 2022-01-13 10:23:08 -05:00
191a8a6f9d Store metrics queueTime in seconds (#5052)
* Store metrics queueTime in seconds

* Address comments

* Helper function to convert seconds to nanoseconds
2022-01-06 13:46:58 +02:00
82f8f3c1e5 Log time in queue per request (#4949)
* Log time in queue per request

* Add querierID to log message

* Add unescape request url and tenant_ids to log message

* Add query enqueue time to metrics.go

* Remove "querier request dequeued" log from scheduler

* Address comments

* Rename enqueue_time to queue_time
* Store queue time in nanoseconds (int64)
* Use CanonicalMIMEHeaderKey for setting the httpgrpc header
2022-01-04 16:52:15 -05:00
98ecfefd89 Add distributor ring page (#4938)
* Implement new IngestionRateStrat Enum.

- This new IngestionRateStrat is used internally to represent the chosen
  ingestion rate strategy, to avoid using plain strings.

* Add a ring to the distributor.

As of now, the distributor only has a pointer to its lifecycler. Since
the ring HTTP handler isn't implemented for the lifecycler but it is
for the ruler, this extends the distributor by also holding a ring
instance.

* Implement /distributor/ring page.

* Reuse existing global strat const.

* Add distributor ring HTTP page tests.

* Add missing CHANGELOG entry.

* Document missing ring status pages.

* Fork Cortex util/http.go into source code.
2022-01-03 13:22:55 -05:00
35ebe967ea Docs: fix broken links (#4770)
* Docs: fix broken links

* Docs: fix another link name
2021-11-17 10:58:08 -08:00
3fef08ca1a 2.4 release notes, changelog, upgrade guide (#4658)
* update changelog, release notes, and upgrade guide for 2.4

* tweak release notes a little

* make path relative for kafka config

* update upgrade guide

* more docs
fix the cache size not applied to results cache.

* fix prefix name in ring_config
2021-11-05 16:21:29 -04:00
24accf6a5b Docs: correctly represent product name (#4416)
The product name is Grafana Loki.  The first use of the product name on
each web page should be the full product name.  After that, within each
page, it is fine to use just Loki.

This PR also set up some frontmatter with weights where it was missing
on a few files, and correct where "Loki" was not capitalized.
2021-10-06 00:21:47 +02:00
66b1d2c822 Reimplementing change from @jacobsakran (#4310)
I merged their change before the CLA was signed. We reverted that in #4299 and now I'm reopening

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
2021-09-10 12:14:52 +02:00
ede12d8435 Revert "Bug fixed in line 643 (#4298)" (#4299)
This reverts commit 598cad896e63543540d5d188fd58bea4b83aec76.
2021-09-09 18:21:44 +02:00
598cad896e Bug fixed in line 643 (#4298)
The command: curl -G -s "http://localhost:3100/api/prom/query" --data-urlencode '{foo="bar"}' | jq
gives the message: parse error: Invalid numeric literal at line 1, column 6
Instead, the command: curl -G -s  "http://localhost:3100/api/prom/query" --data-urlencode 'query={foo="bar"}' | jq, works
2021-09-09 17:43:54 +02:00
c9cdd44e13 Update _index.md (#4277) 2021-09-08 20:27:26 -04:00
11a0d28b61 Docs: first draft, Loki accepts out-of-order writes (#4237)
* Docs: first draft, Loki accepts out-of-order writes

* Update docs/sources/architecture/_index.md

Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
2021-08-31 10:02:25 -04:00
e22e666ca4 fix: Restore /config endpoint and correct handlerFunc for buildinfo (#4027)
As far as I can tell from reading the "next" documentation, the
/loki/api/v1/status/buildinfo endpoint should return the build
information. The /version endpoint is also listed further down in the
documentation but from the code prior to this change, it looks like it
should perform the same function as buildinfo endpoint so I have
removed it.

I've updated the documentation to reflect my changes.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2021-07-22 08:28:44 -04:00
af452047d3 Return build info under /loki/api/v1/status/buildinfo. (#3972)
* Return build info under `/version`.

Closes #3221

* Update documentation.

* Correct docs.

* Format version handler code.

* Ignore write error.

* Sort imports.

* Use `PrometheusVersion` struct.

* Set Go version.
2021-07-09 10:00:47 -04:00
7eceea082b Docs: Make identification of experimental items consistent and more obvious. (#3911) 2021-07-06 19:59:01 -04:00
0d27c21dd4 Doc updates: (#3823)
- Revise section titles
- Add weight metadata to specify ordering of subsections
- Remove TOC info from content prose, as it is already in the right side navigation panel
- Remove a redundant section about upgrading.
2021-06-09 09:04:10 +02:00
f6dcd3f3a4 Fix document links for api push example (#3690) 2021-05-18 07:44:33 -04:00
2a51fb42bf Distributor: Loki API can receive gzipped JSON (#3291)
* Push API recognize HTTP header "Content-Encoding: gzip" and upload gzipped JSON

* Fix documentation mistake
2021-02-05 10:21:53 -05:00
2afebbc064 Add config endpoint (#3228)
* Add config route

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Add documentation

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
2021-01-26 05:05:37 -05:00
54d1d3bea7 [doc] fix:querier do not handle "/flush" api (#3165) 2021-01-15 11:52:11 -05:00
6dc8bee9b0 ingester/shutdown -> ingester/flush_shutdown (#3146) 2021-01-08 10:25:38 -05:00
ee9c629f51 wal docs (#3026) 2021-01-04 09:55:55 -05:00
4d9865acd4 Adds WAL support (experimental) (#2981)
* marshalable chunks

* wal record types custom serialization

* proto types for wal checkpoints

* byteswith output unaffected by buffer

* wal & record pool ifcs

* wal record can hold entries from multiple series

* entry pool

* ingester uses noopWal

* removes duplicate argument passing in ingester code. adds ingester config validation & derives chunk encoding.

* segment writing

* [WIP] wal recovery from segments

* replay uses sync.Maps & preserves WAL fingerprints

* in memory wal recovery

* wal segment recovery

* ingester metrics struct

* wal replay locks streamsMtx in instances, adds checkpoint codec

* ingester metrics

* checkpointer

* WAL checkpoint writer

* checkpointwriter can write multiple checkpoints

* reorgs checkpointing

* wires up checkpointwriter to wal

* ingester SeriesIter impl

* wires up ingesterRecoverer to consume checkpoints

* generic recovery fn

* generic recovery fn

* recover from both wal types

* cleans up old tmp checkpoints & allows aborting in flight checkpoints

* wires up wal checkpointing

* more granular wal logging

* fixes off by 1 wal truncation & removes double logging

* adds userID to wal records correctly

* wire chunk encoding tests

* more granular wal metrics

* checkpoint encoding test

* ignores debug bins

* segment replay ignores out of orders

* fixes bug between WAL reading []byte validity and proto unmarshalling refs

* conf validations, removes comments

* flush on shutdown config

* POST /ingester/shutdown

* renames flush on shutdown

* wal & checkpoint use same segment size

* writes entries to wal regardless of tailers

* makes wal checkpoing duration default to 5m

* recovery metrics

* encodes headchunks separately for wal purposes

* merge upstream

* linting

* addresses pr feedback

uses entry pool in stream push/tailer

removes unnecessary pool interaction

checkpointbytes comment

fillchunk helper, record resetting in tests via pool

redundant comment

defers wg done in recovery

s/num/count/

checkpoint wal uses a logger

encodeWithTypeHeader now creates its own []byte

removes pool from decodeEntries

wal stop can error

* prevent shared access bug with tailers and entry pool

* removes stream push entry pool optimization
2020-11-27 09:42:58 -05:00
25e13254f0 fixes path in prom rules api docs (#2750) 2020-10-12 09:24:11 -04:00
0d64d2d912 fixes ruler docs & includes ruler configs in cmd/configs + docker img (#2657) 2020-09-22 15:46:30 -04:00
6f8bfe0c79 Ruler docs + single binary inclusion (#2637)
* starts alerting docs

* ruler in single binary

* make docs interactive

* alerting docs

* ruler prom alerts endpoint

* Apply suggestions from code review

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* doc fixes

* capitalize ruler

* removes double spaces

* Update docs/sources/alerting/_index.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ed Welch <ed@oqqer.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Ed Welch <ed@oqqer.com>
2020-09-22 09:34:46 -04:00
5a8bc848db Sync docs to website (#2378)
* update docs location

* add workflow

* update docs content

* update content

* cleanup
2020-07-21 17:53:48 +02:00