Commit graph

54 commits

Author SHA1 Message Date
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
Mary Gouseti
af45653e00
Expose basic x-pack telemetry for failure store (#108899) 2024-05-23 16:45:11 +03: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
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
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
Andrei Stefan
6bba0efa78
ESQL: New telemetry for commands (#102937)
* Add enrich,mv_expand,show,row,from,drop,keep,rename commands to telemetry
2023-12-06 02:24:00 +02:00
Jan Kuipers
a67d5b8986
Inference telemetry (#102877)
* Empty infenrece usage wiring.

* Add fake data

* Fix NPE for secretSettings == null

* Real inference model stats

* New transport version

* Code polish

* Lint fixes

* Update docs/changelog/102877.yaml

* Update 102877.yaml

* Add inference to yamlRestTest

* Declare inference usage action as non-operator

* TransportInferenceUsageActionTests

* Lint fixes

* Replace map by ToXContentObject/Writeable

* Polish code

* AbstractWireSerializingTestCase<InferenceFeatureSetUsage.ModelStats>

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-12-04 14:27:54 +01:00
Jan Kuipers
2e95b992b2
Add stats by model to the machine learning usage stats. (#101915)
* Add inference counts by NLP model to the machine learning usage stats.

* Update docs/changelog/101915.yaml

* Add inference_counts_by_model to yamlRestTest.

* Strip leading dot from internal model IDs.

* Add last access and task type to the stats by model.

* Change stats_by_model for map to list

* Simplify code.

* Fix style
2023-11-13 08:50:15 +01:00
Daniel Mitterdorfer
dfaec0dbf0
Enable Universal Profiling as Enterprise feature (#100333)
With this commit we ensure that Universal Profiling can only be used
with an Enterprise license.
2023-10-09 07:58:04 +02:00
James Rodewig
daddca75d1
[DOCS] Fix Usage API snippet test (#99497) 2023-09-12 15:53:55 -04:00
James Rodewig
255c9a7f95
[DOCS] Move x-pack docs to docs/reference dir (#99209)
**Problem:**
For historical reasons, source files for the Elasticsearch Guide's security, watcher, and Logstash API docs are housed in the `x-pack/docs` directory. This can confuse new contributors who expect Elasticsearch Guide docs to be located in `docs/reference`. 

**Solution:**
- Move the security, watcher, and Logstash API doc source files to the `docs/reference` directory
- Update doc snippet tests to use security

Rel: https://github.com/elastic/platform-docs-team/issues/208
2023-09-12 14:53:41 -04:00
ChrisHegarty
2e4440ff1c Remove space in dissect feature list 2023-08-14 14:54:37 +01:00
ChrisHegarty
7cb310b9d0 Merge upstream 2023-08-14 09:55:02 +01:00
Yang Wang
d0f64941f0
Remove RCS 2.0 feature flag for beta release (#98307)
This PR removes the RCS 2.0 feature flag so that it is ready for beta
release.
2023-08-14 08:33:37 +10:00
elasticsearchmachine
9d1e4bcc2a Merge pull request ESQL-1546 from elastic/main
🤖 ESQL: Merge upstream
2023-08-07 13:27:50 -04:00
Kathleen DeRusso
4367c3f31c
Add query rulesets counts to enterprise search telemetry (#98071) 2023-08-07 10:38:12 -04:00
elasticsearchmachine
2834c015cb Merge pull request ESQL-1219 from elastic/main
🤖 ESQL: Merge upstream
2023-06-01 13:16:52 -04:00
Mary Gouseti
8bcdaa9d62
Test fix: Update to the latest form the data_lifecycle telemetry section (#96484) 2023-06-01 15:33:26 +03:00
elasticsearchmachine
06004e2e9d Merge pull request ESQL-1207 from elastic/main
🤖 ESQL: Merge upstream
2023-05-30 13:18:56 -04:00
Keith Massey
17ff9f0fb1
Adding data_lifecycle to the _xpack/usage API (#96177)
This adds a `data_lifecycle` section to the _xpack/usage API, giving basic information about data lifecycles in the cluster. The data looks something like:
```
    "data_lifecycle": {
        "available": true,
        "enabled": true,
        "lifecycle": {
            "count": 1,
            "default_rollover_used": true,
            "retention": {
                "minimum_millis": 360000,
                "maximum_millis": 360000,
                "average_millis": 360000.0
            }
        }
    }
```
2023-05-30 13:48:03 +03:00
elasticsearchmachine
0ebbf0f60e Merge pull request ESQL-1188 from elastic/main
🤖 ESQL: Merge upstream
2023-05-26 13:18:02 -04:00
Sloane Perrault
9649ee0536
add analytics_collections to ent search usage test (#96385) 2023-05-26 12:10:54 -04:00
Andrei Stefan
9d4571a39e Docs fix 2023-05-25 02:17:02 +03:00
Jim Ferenczi
154176b607
Fix _xpack/usage for enterprise_search in docs tests (#95845)
The previous fix (#95565) didn't work since the section was misplaced.
Note that this test runs only on snapshot build so I tested manually and the failure is now related to remote_clusters section missing.

Closes #95603
2023-05-05 10:11:13 +01:00
Albert Zaharovits
b90060538a
Fix _xpack_usage for enterprise_search (#95565)
Fixes #95564
2023-04-26 19:23:36 +03:00
Mary Gouseti
2192a982ac
Expose Health Api telemetry via xpack (#91708)
Every node (post `8.7`) collects stats from every health-api request it receives. We extend the `_xpack/usage` endpoint to expose these stats. When a node receives the request it will fan out to collect data from all other nodes, merge them and expose them. If the cluster is not fully upgraded, it will signal it with the `available` flag set to`false`.
2023-01-04 14:34:29 +01:00
Yannick Welsch
74b5bfdb73
Feature usage actions for archive (#83931)
Relates #81210
2022-02-16 08:31:41 +01:00
Benjamin Trent
5627dc66e1
[ML] deprecate estimated_heap_memory_usage_bytes and replace with model_size_bytes (#80554)
This deprecates estimated_heap_memory_usage_bytes on model put and replaces it with model_size_bytes.

On GET, only model_size_bytes is returned unless v7 rest-api compatibility is requested.

For the ml/info API, only model_size_bytes is returned

A forward-port of: #80545
2021-11-10 10:23:25 -05:00
James Rodewig
f56a0f4b66
[DOCS] Remove testenv annotations from doc snippet tests (#80023)
Removes `testenv` annotations and related code. These annotations originally let you skip x-pack snippet tests in the docs. However, that's no longer possible.

Relates to #79309, #31619
2021-11-05 18:38:50 -04:00
Benjamin Trent
4557d5f797
[ML] adding new model types and deployments to xpack usage (#80282)
This adds new model types + deployment information to xpack/usage under ml.inference

closes: #80200
2021-11-04 11:26:37 -04:00
Mayya Sharipova
23781bb555
Remove xpack actions for vector field (#75017)
We have already decided not to have xpack usage for field mappers
(see #53076). As mappings stats of all fields is already tracked
in cluster stats.
Moreover xpack usage for vector field is a quite expensive operation
(see #74974).

This removes xpack actions for vector field.
2021-07-13 09:52:50 -04:00
Lyudmila Fokina
3b0b7941ae
Warn users if security is implicitly disabled (#70114)
* Warn users if security is implicitly disabled

Elasticsearch has security features implicitly disabled by default for
Basic and Trial licenses, unless explicitly set in the configuration
file.
This may be good for onboarding, but it also lead to unintended insecure
 clusters.
 This change introduces clear warnings when security features are
 implicitly disabled.
 - a warning header in each REST response if security is implicitly
 disabled;
 - a log message during cluster boot.
2021-04-13 18:33:41 +02:00
Yannick Welsch
9910c7a359
Extend searchable snapshots feature usage stats (#70441)
Extends the feature usage stats, distinguishing between full_copy and shared_cache style searchable snapshot indices.
2021-03-16 18:02:34 +01:00
Luca Cavanna
ffe61fb097
Move runtime fields stats to server (#69487)
Runtime fields usage is currently reported as part of the xpack feature usage API. Now that runtime fields are part of server, their corresponding stats can be moved to be part of the ordinary mapping stats exposed by the cluster stats API.
2021-03-08 12:38:20 +01:00
Dimitris Athanasiou
bbf81a2603
[ML] Expand usage stats for data frame analytics and trained models (#69477)
This adds additional statistics into the usage API for data frame analytics
and trained models.

For data frame analytics the added stats are:

  - count of jobs by analysis type
  - stats for peak_usage_bytes

For trained models the added stats are:
  - counts of: total, prepackaged, other (not created by data frame analytics)
  - counts by analysis type based on the inference config
  - stats for estimated heap usage
  - stats for estimated number of operations
2021-02-24 15:45:26 +02:00
Adam Locke
a39eef6309
[DOCS] Fixing Painless tests (#68157)
* Fixing Painless tests.

* Update runtime field context to fix test cases.

* Remove watcher logging from usage API and replace test.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-02-09 11:24:14 -05:00
Lee Hinman
3f9f007545
Add the frozen tier node role and ILM phase (#68605)
This commit adds the `data_frozen` node role as part of the formalization of data tiers. It also
adds the `"frozen"` phase to ILM, currently allowing the same actions as the existing cold phase.

The frozen phase is intended to be used for data even less frequently searched than the cold phase,
and will eventually be loosely tied to data using partial searchable snapshots (as oppposed to full
searchable snapshots in the cold phase).

Relates to #60848
2021-02-05 14:38:13 -07:00
Igor Motov
9e3384ebc9
Add multi_terms aggs (#67597)
Adds a multi_terms aggregation support. The multi terms aggregation works
very similarly to the terms aggregation but supports multiple terms. The goal
of this PR is to add the basic functionality so it is not optimized at the
moment. It will be done in follow up PRs.

Closes #65623
2021-02-03 13:13:33 -05:00
Christoph Büscher
b85d52adbd Skip reference/rest-api/usage/line_39 docs test 2021-01-28 13:00:26 +01:00
Adam Locke
c91a808732
[DOCS] Update Painless examples to use seat data (#68029)
* Adds datetime as a date, which is necessary in setup.

* Updating field context example.

* Fixing sample data, updating context example, and updating runtime example.

* Updating field context and changing runtime field to use seats data.

* Update filter context to use the seats data.

* Updating min-should-match context to use seats data.

* Replacing last mentions of TEST[skip].

* Update usage with watcher response for build error.

* Updating usage API again for watcher.

* Third time's a charm for fixing test cases.

* Adding specific test replacement for watcher logging total.

* Change actors to keyword based on review feedback.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-01-27 16:42:22 -05:00
James Rodewig
03334b9801
[DOCS] Add security privileges to API docs (#67939) 2021-01-27 09:06:06 -05:00
Luca Cavanna
20d6fbcd55
Add xpack info and usage endpoints for runtime fields (#65600)
Relates to #59332
2020-12-08 10:15:08 +01:00
Christos Soulios
66b5e4ec89
Implement aggregations on aggregate metric fields (#56745)
In the process of developing a new implementation for the Elasticsearch Rollups functionality we came up with the concept of the aggregate metric field type.

The aggregate_metric_double field type can store the results of aggregations (currently min, max, sum, value_count and avg are supported - more to come).

This field allows us to run (min, max, sum, value_count, avg) aggregations on the container field and the field will return the correct metric depending on the aggregation that is computed.
2020-11-10 19:31:59 +02:00
Lee Hinman
5fca68a155
Add telemetry for data tiers (#63031)
This commit adds telemetry for our data tier formalization. This telemetry helps determine the
topology of the cluster with regard to the content, hot, warm, & cold tiers/roles.

An example of the telemetry looks like:

```
GET /_xpack/usage?human
{
  ...
  "data_tiers" : {
    "available" : true,
    "enabled" : true,
    "data_warm" : {
      ...
    },
    "data_cold" : {
      ...
    },
    "data_content" : {
      "node_count" : 1,
      "index_count" : 6,
      "total_shard_count" : 6,
      "primary_shard_count" : 6,
      "doc_count" : 71,
      "total_size" : "59.6kb",
      "total_size_bytes" : 61110,
      "primary_size" : "59.6kb",
      "primary_size_bytes" : 61110,
      "primary_shard_size_avg" : "9.9kb",
      "primary_shard_size_avg_bytes" : 10185,
      "primary_shard_size_median" : "8kb",
      "primary_shard_size_median_bytes" : 8254,
      "primary_shard_size_mad" : "7.2kb",
      "primary_shard_size_mad_bytes" : 7391
    },
    "data_hot" : {
       ...
    }
  }
}
```

The fields are as follows:

- node_count :: number of nodes with this tier/role
- index_count :: number of indices on this tier
- total_shard_count :: total number of shards for all nodes in this tier
- primary_shard_count :: number of primary shards for all nodes in this tier
- doc_count :: number of documents for all nodes in this tier
- total_size_bytes :: total number of bytes for all shards for all nodes in this tier
- primary_size_bytes :: number of bytes for all primary shards on all nodes in this tier
- primary_shard_size_avg_bytes :: average shard size for primary shard in this tier
- primary_shard_size_median_bytes :: median shard size for primary shard in this tier
- primary_shard_size_mad_bytes :: [median absolute deviation](https://en.wikipedia.org/wiki/Median_absolute_deviation) of shard size for primary shard in this tier

Relates to #60848
2020-10-01 08:35:10 -06:00
Igor Motov
f107dba741
Add rate aggregation (#61369)
Adds a new rate aggregation that can calculate a document rate for buckets
of a date_histogram.

Closes #60674
2020-08-25 11:32:20 -04:00
Lee Hinman
d543c27223
Add telemetery for data streams (#59433)
This commit adds data stream info to the `/_xpack` and `/_xpack/usage` APIs. Currently the usage is
pretty minimal, returning only the number of data streams and the number of indices currently
abstracted by a data stream:

```
  ...
  "data_streams" : {
    "available" : true,
    "enabled" : true,
    "data_streams" : 3,
    "indices_count" : 17
  }
  ...
```
2020-07-13 12:12:22 -06:00
Yannick Welsch
6e77e70ba2
Add basic searchable snapshots usage information (#58828)
Adds super basic usage information for searchable snapshots, to be extended later.
2020-07-07 10:41:42 +02:00
Lisa Cawley
8b9293b3bf
[DOCS] Replace docdir attribute with es-repo-dir (#57489) 2020-06-01 15:55:05 -07:00
Tal Levy
79367e43da
Add Normalize Pipeline Aggregation (#56399)
This aggregation will perform normalizations of metrics
for a given series of data in the form of bucket values.

The aggregations supports the following normalizations

- rescale 0-1
- rescale 0-100
- percentage of sum
- mean normalization
- z-score normalization
- softmax normalization

To specify which normalization is to be used, it can be specified
in the normalize agg's `normalizer` field.

For example:

```
{
  "normalize": {
    "buckets_path": <>,
    "normalizer": "percent"
  }
}
```

Closes #51005.
2020-05-14 13:32:42 -07:00