Commit graph

401 commits

Author SHA1 Message Date
Jake Landis
84f4f3ac2b
Docs for monitor_stats privilege (#116533) (#116671)
This commit adds docs for monitor_stats and updates an example snippet to include both remote_indices and remote_cluster.

(cherry picked from commit b7167b73e3)
2024-11-13 02:45:38 +11:00
Johannes Fredén
803de168b8
[DOCS] Remove tech preview from bulk create/update/delete roles (#116601) (#116639)
Mark bulk create/update/delete roles GA in 9.0 and 8.17

(cherry picked from commit bfb30d2e72)
2024-11-12 19:09:40 +11:00
Jake Landis
8adb2c4043
[8.x] Add a monitor_stats privilege and allow that privilege for remote cluster privileges (#114964) (#116517)
* Add a monitor_stats privilege and allow that privilege for remote cluster privileges (#114964)

This commit does the following:
   * Add a new monitor_stats privilege
   * Ensure that monitor_stats can be set in the remote_cluster privileges
   * Give's Kibana the ability to remotely call monitor_stats via RCS 2.0

Since this is the first case where there is more than 1 remote_cluster privilege,
the following framework concern has been added:
    * Ensure that when sending to elder RCS 2.0 clusters that we don't send the new privilege
        previous only supported all or nothing remote_cluster blocks
    * Ensure that we when sending API key role descriptors that contains remote_cluster,
       we don't send the new privileges for RCS 1.0/2.0 if it not new enough
    * Fix and extend the BWC tests for RCS 1.0 and RCS 2.0

(cherry picked from commit af99654dac)

* adjust bwc for 8.x branch
2024-11-09 06:26:14 +11:00
Jake Landis
6b98d77d57
Fix missing remote_cluster docs (#116366) (#116440)
Documentation for the remote_cluster in the role was added
in #111682 and #108840, but a few places were missed.
This commit fill the gaps in the documentation.
2024-11-08 07:10:47 +11:00
Nhat Nguyen
f63cf672fd
Add logsdb telemetry (#115994) (#116101)
This PR adds telemetry for logsdb. However, this change only tracks the 
count of indices using logsdb and those that use synthetic source. 
Additional stats, such as shard, indexing, and search stats, will be
added in a follow-up, as they require reaching out to data nodes.
2024-11-02 03:32:12 +11:00
Luigi Dell'Aquila
b0b9968490
ES|QL: add metrics for functions (#114620) (#115191) 2024-10-21 14:06:56 +02:00
David Kyle
ffcf87ce1d
[ML] Default inference endpoint for the multilingual-e5-small model (#114683) (#114779) 2024-10-15 11:14:49 +11:00
Nik Everett
67ce8bd244
ESQL: Entirely remove META FUNCTIONS (#113967) (#114342)
This removes the undocumented `META FUNCTIONS` command that emits
descriptions for all functions. This shouldn't be used because we never
told anyone about it. I'd have preferred if we'd have explicitly
documented it as no public or if we'd have left it snapshot-only. But
sometimes you make a mistake. I'm hopeful no one is relying on it. It
was never reliable and not public.....
2024-10-10 07:51:18 +11:00
David Turner
3e4957da52
Document that ?wait_for_active_shards=0 is permitted (#114091) (#114273)
Today the docs for the `?wait_for_active_shards` parameter say that it
must be a positive integer, proscribing `0`, yet `0` is a legitimate
value for this parameter. This commit fixes this point and rewords the
docs slightly for clarity.
2024-10-08 17:24:15 +11:00
Mike Pellegrini
5b8f9c12d2
[ML] Default inference endpoint for ELSER (#114164)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-10-08 06:58:10 +11:00
David Kyle
cc3caa228d
[ML] Add deployment threading details and memory usage to telemetry (#113099) (#113516)
Adds deployment threading options and a new memory section reporting
the memory usage for each of the ml features
# Conflicts:
#	server/src/main/java/org/elasticsearch/TransportVersions.java
2024-09-25 22:35:09 +10:00
Mary Gouseti
c1a2d390ef
Update data stream lifecycle telemetry to track global retention (#112451)
Currently, the data stream lifecycle telemetry has the following
structure:

```
{
....
  "data_lifecycle" : {
    "available": true,
    "enabled": true,
    "count": 0,
    "default_rollover_used": true,
    "retention": {
        "minimum_millis": 0,
        "maximum_millis": 0,
        "average_millis": 0.0
    }
  }....
```

In the snippet above you can see that we track:

- The amount of data streams managed by the data stream lifecycle by `count`
- If the default rollover has been overwritten by `default_rollover_used`
- The min, max and average of the `data_retention` configured on a data stream level.

In this PR we propose the following extention:

```
....
  "data_lifecycle" : {
    "available": true,
    "enabled": true,
    "count": 0,
    "default_rollover_used": true,
    "effective_retention": { #https://github.com/elastic/dev/issues/2537
        "retained_data_streams": 5,
        "minimum_millis": 0, # Only if retained data streams > 1
        "maximum_millis": 0,
        "average_millis": 0.0
    },
    "data_retention": {
        "configured_data_streams": 5,
        "minimum_millis": 0, # Only if retained data streams > 1
        "maximum_millis": 0,
        "average_millis": 0.0
    },
    "global_retention": {
      "default": {
         "defined": true/false,
	  "affected_data_streams": 0,
         "millis": 0 
      },
      "max": {
         "defined": true/false,
	  "affected_data_streams": 0,
         "millis": 0 
      }
    }
```

With this extension we are tracking:

- The amount of data streams managed by the data stream lifecycle by `count`
- If the default rollover has been overwritten by `default_rollover_used`
- The min, max and average of the `data_retention` configured on a data stream level and the number of data streams that have it configured. We add the min, max and avg only if there are data streams with data retention configuration to avoid messing with the stats in a dashboard.
- The min, max and average of the `effective_retention` and the number of data streams that are retained. We add the min, max and avg only if there are retained data streams to avoid messing with the stats in a dashboard.
- Global retention stats, if they are defined, if the number of the affected data streams and the actual value.

The above metrics allow us to answer questions like:

- How many data streams are affected by global retention.
- How big is the difference between the longest data retention compared to max global retention.
- How much does the effective retention diverging from the data retention, this will show the impact of the global retention.
2024-09-11 18:31:04 +10:00
Panagiotis Bailis
7563a724f0
Updating retriever documentation to better explain how filters are applied (#112201) 2024-08-26 16:15:31 +03:00
Larisa Motova
9ac0718d90
Add docs for shard level stats in node stats (#111082)
Fixes #111081
2024-08-13 14:59:03 +03:00
Mary Gouseti
9185056efe
Clean up global retention from the cluster state and obsolete transport actions (#111636)
In this PR we remove unused code including relating to the global data retention with APIs implementation:

- The transport action for updating, deleting and retrieving the global retention.
- The `DataStreamGlobalRetention` from the cluster state (this should be bwc safe because we never exposed the APIs to add a data stream lifecycle to the cluster state).
- Make unused privileges monitor and managing global retention a noop.
- Remove cluster state update tasks.

The kept `DataStreamGlobalRetentionResolver` considering it could hold and provide the global retention from the settings when we implement it. We just renamed it to DataStreamGlobalRetentionProvider for now to better match what it does.

The factory retention settings should still work after this change.
2024-08-08 09:52:35 +03:00
Albert Zaharovits
747fa59a2c
DOCS Query Roles (#110473)
These are the docs changes in relation to
https://github.com/elastic/elasticsearch/pull/108733
2024-07-05 19:46:48 +10:00
George Wallace
b6e9860919
Update role-mapping-resources.asciidoc (#110441)
made it clear that some characters need to be escaped properly

Co-authored-by: Jan Doberstein <jan.doberstein@elastic.co>
2024-07-03 13:00:52 -06:00
Johannes Fredén
89cd966b24
Add bulk delete roles API (#110383)
* Add bulk delete roles API
2024-07-03 11:04:53 +02:00
Johannes Fredén
55476041d9
Add BulkPutRoles API (#109339)
* Add BulkPutRoles API
2024-07-02 15:45:39 +02:00
Jedr Blaszyk
3b827f6a8c
Create manage_connector privilege (#110128)
* Create manage_seaech_connector privilege

* `manage_search_connector` -> `manage_connector` and exclude connector secrets patterns from this privilege

* Add `monitor_connector` privilege

* Update Kibana system privilege to monitor_connector for telemetry

* Rename privilege to 'manage_connector_state'

Since privilege names are often namespaced and used with globs, we want to ensure that if there's a future privilege like `manage_connector_secrets`, that it is not implicitly included in this new privileg's <name>*. By extending the privilege name to include "_state", we better namespace this distinct from any "_secrets" namespace.

* Revert "Rename privilege to 'manage_connector_state'"

This reverts commit 70b89eee76.
After further discussion with the security team, this name change is not needed after all
since the secret management privileges aren't currently prefixed with "manage_"

---------

Co-authored-by: Sean Story <sean.j.story@gmail.com>
2024-07-01 12:41:28 -05:00
Nikolaj Volgushev
78c812f845
Fix security index settings docs (#110126)
Docs tweak with a typo fix and a clarification on how the two available
settings interact (essentially
https://github.com/elastic/elasticsearch/issues/27871). I'm also open to
including this info in the more generic settings API but feels like a
simple enough callout to add to the security API.
2024-07-01 18:07:15 +10:00
Mayya Sharipova
405e39660b
Support k parameter for knn query (#110233)
Introduce an optional k param for knn query

If k is not set, knn query has the previous behaviour:
- `num_candidates` docs  is collected from each shard. This `num_candidates` docs
are used for combining with results with other queries and aggregations on each shard.
- docs from all shards are merged to produce the top global `size` results

If k is set, the behaviour instead is following:
- `k` docs is collected from each shard. This `k` docs are used for
combining results with other queries and aggregations on each shard.
- similarly, docs from all shards are merged to produce the top global `size`
results.

Having `k` param makes it more intuitive for users to address their needs.
They also don't need to care and can skip `num_candidates` param for this query
as it is of more internal details to tune how knn search operates.

Closes #108473
2024-06-28 09:59:28 -04:00
Jim Ferenczi
a6470fb86d
Fix cluster level dense vector stats (#107962)
The cluster level dense vector stats returns the total number of dense vector indices globally including the replicas.
This commit fixes the total to only include the value count of the primary indices.
This change aligns with the docs stats which also reports the number of primary documents when used in cluster stats.
The indices stats API still reports granular results for replicas and primaries so the information is not lost.
2024-06-18 17:45:02 +01:00
Kathleen DeRusso
8529bf71f6
Add SparseVectorStats (#108793)
* Add SparseVectorStats

* Update to use mappings in engine

* Update to be unique to primary shards

* Fix doc

* Fix null error in test

* Cleanup

* fix yaml

* remove comment

* add version to yaml

* Revert whitespace changes to stats doc

* fix yml test

* Checkstyle

* Fix NPE in test

* Update docs/changelog/108793.yaml

* Add link to sparse_vector field type in docs

* PR feedback

* Flesh out test a bit more

* PR feedback - alphabetize placement in docs

* Fix doc change
2024-06-17 11:42:14 -04:00
Albert Zaharovits
0e4888bdec
Refactor field name translator of query endpoints for security entities (#109559)
This is a refactoring of the internal logic that's used to translate
query-level into index-level field names for query APIs for
security entities (i.e. users, API Keys, and soon, roles).
The objective here is to have and reuse a single class to handle
all the translations for different security query APIs.
2024-06-13 14:12:19 +03:00
Jake Landis
7504fed0b3
remote_cluster role documentation and expose to built in privs API (#108840)
This commit introduces the documentation for remote_clusters which is used to help
 express the monitor_enrich privilege needed to use the ENRICH keyword across clusters 
when using the API key based CCS security model.

This commit also adds "remote_clusters" to the built in privs API to for easier consumption
 in Kibana.
2024-05-28 13:51:21 -05:00
Mary Gouseti
af45653e00
Expose basic x-pack telemetry for failure store (#108899) 2024-05-23 16:45:11 +03:00
Jake Landis
ff92296217
[docs] Prevent DLS/FLS if replication is assigned (#108839)
This commit adds documentation for the DLS/FLS restriction for RCS 2.0 API keys 
where both access and replication are defined and access has DSL/FLS.
This commit also fixes a few misleading variable names.
related: #108600
2024-05-22 12:05:34 -05:00
Nick Tindall
3ecdd77e97
[DOCS] Align docs to implementation for timeout parameters (#108593)
* [DOCS] Fix documentation for timeout-related parameters

Closes #108224
2024-05-16 13:05:39 +10:00
Slobodan Adamović
77ce60530c
[docs] Document new role description field (#108422)
This commit updates Role API docs to include new description field 
(introduced in #107088) and adds descriptions for all built-in roles.
2024-05-14 10:16:55 +02:00
Nick Tindall
68a8664c21
[DOCS] Fix stored_fields parameter description (#98385) (#108445)
(referenced from get and multi_get API docs)

Closes #98385
2024-05-09 03:17:10 -04:00
Martijn van Groningen
e043bce1af
Add more rollup usage stats (#108245)
This change adds `number_of_rollup_jobs` and `number_of_rollup_indices`
to  `rollup` usage. The former indicates the number of active rollup
jobs running and the latter indicated the number of rollup indices
(which could be the result of previous rollup jobs).
2024-05-07 13:02:54 -04:00
Nikolaj Volgushev
31afff92f8
Invalidate cross cluster API key docs (#108297)
This PR documents privilege requirements for cross-cluster API key
invalidation, which were updated in
https://github.com/elastic/elasticsearch/pull/107411.
2024-05-06 10:02:14 -04:00
Liam Thompson
9a62dba53c
[DOCS] Remove remaining beta flags for RCS (#108201) 2024-05-03 09:12:37 +02:00
florent-leborgne
0c500e5264
Remove Beta label for RCS2.0 from 8.14 (#108030) 2024-05-02 15:43:21 +02:00
David Turner
fc287bde8b
Interpret ?timeout=-1 as infinite ack timeout (#107675)
APIs which perform cluster state updates typically accept the
`?master_timeout=` and `?timeout=` parameters to respectively set the
pending task queue timeout and the acking timeout for the cluster state
update. Both of these parameters accept the value `-1`, but
`?master_timeout=-1` means to wait indefinitely whereas `?timeout=-1`
means the same thing as `?timeout=0`, namely that acking times out
immediately on commit.

There are some situations where it makes sense to wait for as long as
possible for nodes to ack a cluster state update. In practice this wait
is bounded by other mechanisms (e.g. the lag detector will remove the
node from the cluster after a couple of minutes of failing to apply
cluster state updates) but these are not really the concern of clients.

Therefore with this commit we change the meaning of `?timeout=-1` to
mean that the acking timeout is infinite.
2024-04-30 09:54:15 -04:00
Liam Thompson
33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00
David Turner
ccbb5badce
Fix support for infinite ?master_timeout (#107050)
Specifying `?master_timeout=-1` on an API which performs a cluster state
update means that the cluster state update task will never time out
while waiting in the pending tasks queue. However this parameter is also
re-used in a few places where a timeout of `-1` means something else,
typically to timeout immediately. This commit fixes those places so that
`?master_timeout=-1` consistently means to wait forever.
2024-04-10 18:32:38 +01:00
Albert Zaharovits
36bcb6b398
Query API Keys support for both aggs and aggregations keywords (#107054)
The Query API Key Information endpoint supports aggs since #104895.
But some lang clients actually use the `aggregations` keyword in requests,
as the preferred synonym to `aggs`.
This PR adds support for the `aggregations` request keyword as a synonym
for the existing `aggs` term.

Closes #106839
2024-04-03 18:33:14 +03:00
Parker Timmins
e59dd0b60e
Add total size in bytes to doc stats (#106840) 2024-03-29 09:40:37 -05:00
Albert Zaharovits
b4938e1645
Query API Key Information API support for the typed_keys request parameter (#106873)
The typed_keys request parameter is the canonical parameter,
that's also used in the regular index _search enpoint, in order to
return the types of aggregations in the response.
This is required by typed language clients of the _security/_query/api_key
endpoint that are using aggregations.

Closes #106817
2024-03-29 09:24:52 +02:00
Mary Gouseti
2122da31cd
[DSL] Introduce data stream global retention - Part 3 (#105682)
In this PR we introduce the API that will expose the global retention configuration and will allow users to take advantage of it.

These APIs are protected by the dedicated introduced privileges:

`manage_data_stream_global_retention` or higher, which allows all operations on the global retention configuration
`monitor_data_stream_retention` or higher, which allows the retrieval of the global retention configuration.

This PR is the final PR that makes the global retention available for our users.
2024-03-28 10:40:33 +02:00
Albert Zaharovits
3e0a0f6291
Get and Query API Key with profile uid (#106531)
Add new optional request option, `with_profile_uid`,
to the Get and Query API Key Information endpoints,
to return the API keys owner users' profile uid.

Closes #98939
2024-03-28 10:26:22 +02:00
David Kyle
2087b65523
[ML] Create inference_user and inference_admin roles (#106371)
Defines new inference_user and inference_admin roles with the 
related cluster privileges manage_inference and monitor_inference.
inference_user can list the models and preform inference, 
inference_admin can do the same plus create and delete models
2024-03-20 11:15:21 +00:00
Bogdan Pintea
1fbb085bd0
ESQL: Rename SHOW FUNCTIONS to META FUNCTIONS (#106362)
This renames the `show functions` command to `meta functions`.
It also removes its documentation and usage tracking.
2024-03-19 13:02:34 +01:00
Stef Nestor
157ce539aa
(DOC+) Version API page for ES API Base URL (#105845)
* (DOC+) Version API page for ES API Base URL

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2024-03-18 13:02:54 -06:00
Tommaso Teofili
7bff3b3bec
Add modelId and modelText to KnnVectorQueryBuilder (#106068)
* Add modelId and modelText to KnnVectorQueryBuilder

Use QueryVectorBuilder within KnnVectorQueryBuilder to make it
possible to perform knn queries also when a query vector is not
immediately available. Supplying a text_embedding query_vector_builder
with model_text and model_id instead of the query_vector will result
in the generation of a query_vector by calling inference on the
specified model_id with the supplied model_text (during query
rewrite). This is consistent with the way query vectors are built
from model_id / model_text in KnnSearchBuilder (DFS phase).
2024-03-18 16:13:38 +01:00
Panagiotis Bailis
d471ccb5bb
Adding support for hex-encoded byte vectors on knn-search (#105393) 2024-03-13 09:24:51 +02:00
Jack Conradson
68b0acac8f
Add retrievers using the parser-only approach (#105470)
This enhancement adds a new abstraction to the _search API called "retriever." A 
retriever is something that returns top hits. This adds three initial retrievers called
"standard", "knn", and "rrf". The retrievers use a parser-only approach where they
are parsed and then translated into a SearchSourceBuilder to execute the actual
search.
---------

Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
2024-03-12 10:11:55 -07:00
István Zoltán Szabó
2d4a49af53
[DOCS] Fixes get settings and update settings security API docs (#105686)
* [DOCS] Fixes get settings and update settings security API docs.

* [DOCS] Further edits.
2024-02-21 15:06:32 +01:00