-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[eem] _search endpoint / initial entity manager UI #199609
[eem] _search endpoint / initial entity manager UI #199609
Conversation
sourceCommand(source), | ||
...filterCommands(source), | ||
statsCommand(source), | ||
`SORT entity.last_seen_timestamp DESC`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a source doesn't have a timestamp field, this will error out (i think). we should handle that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timestamp field set on a source is mandatory in this PR so the query will not run if it's not defined
function mergeEntities(entity1: Entity, entity2: Entity): Entity { | ||
const merged: Entity = { | ||
...entity1, | ||
'entity.last_seen_timestamp': new Date( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, i think we have to handle the case of missing last_seen_timestamp
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
cc @klacabane |
Starting backport for target branches: 8.x |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
## Summary - create `_search` endpoint to discover entities with esql queries. It currently reads sources of the provided `type` from `kibana_entity_definitions` index. Run this query to insert a definition: ``` POST kibana_entity_definitions/_doc { "entity_type": "service", "index_patterns": ["remote_cluster:logs-*"], "metadata_fields": [], "identity_fields": ["service.name"], "filters": [], "timestamp_field": "@timestamp" } ``` By default `_search` will look at data in the last 5m. The lookup period can be overriden by providing `start`/`end` parameters in ISO format. It also accepts a `limit` to specify the number of entities returned which defaults to 10 ``` POST kbn:/internal/entities/v2/_search { "type": "service", "start": "2024-11-19T20:40:00.000Z", "end": "2024-11-19T20:50:00.000Z", "limit": 20 } ``` - create `_search/preview` endpoint to preview output of entity sources without persisting them - create UI to preview results of an entity definition at `/app/entity_manager`. The application is living in its own plugin at `observability_solution/entity_manager_app` ![Screenshot 2024-11-11 at 11 37 18](https://github.com/user-attachments/assets/f284342d-21a3-4ba1-be94-38cff311266c) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Milton Hultgren <[email protected]>
Friendly reminder: Looks like this PR hasn’t been backported yet. |
## Summary - create `_search` endpoint to discover entities with esql queries. It currently reads sources of the provided `type` from `kibana_entity_definitions` index. Run this query to insert a definition: ``` POST kibana_entity_definitions/_doc { "entity_type": "service", "index_patterns": ["remote_cluster:logs-*"], "metadata_fields": [], "identity_fields": ["service.name"], "filters": [], "timestamp_field": "@timestamp" } ``` By default `_search` will look at data in the last 5m. The lookup period can be overriden by providing `start`/`end` parameters in ISO format. It also accepts a `limit` to specify the number of entities returned which defaults to 10 ``` POST kbn:/internal/entities/v2/_search { "type": "service", "start": "2024-11-19T20:40:00.000Z", "end": "2024-11-19T20:50:00.000Z", "limit": 20 } ``` - create `_search/preview` endpoint to preview output of entity sources without persisting them - create UI to preview results of an entity definition at `/app/entity_manager`. The application is living in its own plugin at `observability_solution/entity_manager_app` ![Screenshot 2024-11-11 at 11 37 18](https://github.com/user-attachments/assets/f284342d-21a3-4ba1-be94-38cff311266c) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Milton Hultgren <[email protected]> (cherry picked from commit 0b3f4fb) # Conflicts: # .github/CODEOWNERS
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…202050) # Backport This will backport the following commits from `main` to `8.x`: - [[eem] _search endpoint / initial entity manager UI (#199609)](#199609) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kevin Lacabane","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-22T15:12:04Z","message":"[eem] _search endpoint / initial entity manager UI (#199609)\n\n## Summary\r\n\r\n- create `_search` endpoint to discover entities with esql queries. It\r\ncurrently reads sources of the provided `type` from\r\n`kibana_entity_definitions` index. Run this query to insert a\r\ndefinition:\r\n```\r\nPOST kibana_entity_definitions/_doc\r\n{\r\n \"entity_type\": \"service\",\r\n \"index_patterns\": [\"remote_cluster:logs-*\"],\r\n \"metadata_fields\": [],\r\n \"identity_fields\": [\"service.name\"],\r\n \"filters\": [],\r\n \"timestamp_field\": \"@timestamp\"\r\n}\r\n```\r\n\r\nBy default `_search` will look at data in the last 5m. The lookup period\r\ncan be overriden by providing `start`/`end` parameters in ISO format. It\r\nalso accepts a `limit` to specify the number of entities returned which\r\ndefaults to 10\r\n\r\n```\r\nPOST kbn:/internal/entities/v2/_search\r\n{\r\n \"type\": \"service\",\r\n \"start\": \"2024-11-19T20:40:00.000Z\",\r\n \"end\": \"2024-11-19T20:50:00.000Z\",\r\n \"limit\": 20\r\n}\r\n```\r\n\r\n- create `_search/preview` endpoint to preview output of entity sources\r\nwithout persisting them\r\n \r\n- create UI to preview results of an entity definition at\r\n`/app/entity_manager`. The application is living in its own plugin at\r\n`observability_solution/entity_manager_app`\r\n![Screenshot 2024-11-11 at 11 37\r\n18](https://github.com/user-attachments/assets/f284342d-21a3-4ba1-be94-38cff311266c)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Milton Hultgren <[email protected]>","sha":"0b3f4fbd3cd60663289fc13f8f01e3f4c9131479","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-entities"],"number":199609,"url":"https://github.com/elastic/kibana/pull/199609","mergeCommit":{"message":"[eem] _search endpoint / initial entity manager UI (#199609)\n\n## Summary\r\n\r\n- create `_search` endpoint to discover entities with esql queries. It\r\ncurrently reads sources of the provided `type` from\r\n`kibana_entity_definitions` index. Run this query to insert a\r\ndefinition:\r\n```\r\nPOST kibana_entity_definitions/_doc\r\n{\r\n \"entity_type\": \"service\",\r\n \"index_patterns\": [\"remote_cluster:logs-*\"],\r\n \"metadata_fields\": [],\r\n \"identity_fields\": [\"service.name\"],\r\n \"filters\": [],\r\n \"timestamp_field\": \"@timestamp\"\r\n}\r\n```\r\n\r\nBy default `_search` will look at data in the last 5m. The lookup period\r\ncan be overriden by providing `start`/`end` parameters in ISO format. It\r\nalso accepts a `limit` to specify the number of entities returned which\r\ndefaults to 10\r\n\r\n```\r\nPOST kbn:/internal/entities/v2/_search\r\n{\r\n \"type\": \"service\",\r\n \"start\": \"2024-11-19T20:40:00.000Z\",\r\n \"end\": \"2024-11-19T20:50:00.000Z\",\r\n \"limit\": 20\r\n}\r\n```\r\n\r\n- create `_search/preview` endpoint to preview output of entity sources\r\nwithout persisting them\r\n \r\n- create UI to preview results of an entity definition at\r\n`/app/entity_manager`. The application is living in its own plugin at\r\n`observability_solution/entity_manager_app`\r\n![Screenshot 2024-11-11 at 11 37\r\n18](https://github.com/user-attachments/assets/f284342d-21a3-4ba1-be94-38cff311266c)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Milton Hultgren <[email protected]>","sha":"0b3f4fbd3cd60663289fc13f8f01e3f4c9131479"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199609","number":199609,"mergeCommit":{"message":"[eem] _search endpoint / initial entity manager UI (#199609)\n\n## Summary\r\n\r\n- create `_search` endpoint to discover entities with esql queries. It\r\ncurrently reads sources of the provided `type` from\r\n`kibana_entity_definitions` index. Run this query to insert a\r\ndefinition:\r\n```\r\nPOST kibana_entity_definitions/_doc\r\n{\r\n \"entity_type\": \"service\",\r\n \"index_patterns\": [\"remote_cluster:logs-*\"],\r\n \"metadata_fields\": [],\r\n \"identity_fields\": [\"service.name\"],\r\n \"filters\": [],\r\n \"timestamp_field\": \"@timestamp\"\r\n}\r\n```\r\n\r\nBy default `_search` will look at data in the last 5m. The lookup period\r\ncan be overriden by providing `start`/`end` parameters in ISO format. It\r\nalso accepts a `limit` to specify the number of entities returned which\r\ndefaults to 10\r\n\r\n```\r\nPOST kbn:/internal/entities/v2/_search\r\n{\r\n \"type\": \"service\",\r\n \"start\": \"2024-11-19T20:40:00.000Z\",\r\n \"end\": \"2024-11-19T20:50:00.000Z\",\r\n \"limit\": 20\r\n}\r\n```\r\n\r\n- create `_search/preview` endpoint to preview output of entity sources\r\nwithout persisting them\r\n \r\n- create UI to preview results of an entity definition at\r\n`/app/entity_manager`. The application is living in its own plugin at\r\n`observability_solution/entity_manager_app`\r\n![Screenshot 2024-11-11 at 11 37\r\n18](https://github.com/user-attachments/assets/f284342d-21a3-4ba1-be94-38cff311266c)\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>\r\nCo-authored-by: Milton Hultgren <[email protected]>","sha":"0b3f4fbd3cd60663289fc13f8f01e3f4c9131479"}}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <[email protected]>
## Summary - create `_search` endpoint to discover entities with esql queries. It currently reads sources of the provided `type` from `kibana_entity_definitions` index. Run this query to insert a definition: ``` POST kibana_entity_definitions/_doc { "entity_type": "service", "index_patterns": ["remote_cluster:logs-*"], "metadata_fields": [], "identity_fields": ["service.name"], "filters": [], "timestamp_field": "@timestamp" } ``` By default `_search` will look at data in the last 5m. The lookup period can be overriden by providing `start`/`end` parameters in ISO format. It also accepts a `limit` to specify the number of entities returned which defaults to 10 ``` POST kbn:/internal/entities/v2/_search { "type": "service", "start": "2024-11-19T20:40:00.000Z", "end": "2024-11-19T20:50:00.000Z", "limit": 20 } ``` - create `_search/preview` endpoint to preview output of entity sources without persisting them - create UI to preview results of an entity definition at `/app/entity_manager`. The application is living in its own plugin at `observability_solution/entity_manager_app` ![Screenshot 2024-11-11 at 11 37 18](https://github.com/user-attachments/assets/f284342d-21a3-4ba1-be94-38cff311266c) --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Milton Hultgren <[email protected]>
Summary
_search
endpoint to discover entities with esql queries. It currently reads sources of the providedtype
fromkibana_entity_definitions
index. Run this query to insert a definition:By default
_search
will look at data in the last 5m. The lookup period can be overriden by providingstart
/end
parameters in ISO format. It also accepts alimit
to specify the number of entities returned which defaults to 10create
_search/preview
endpoint to preview output of entity sources without persisting themcreate UI to preview results of an entity definition at
/app/entity_manager
. The application is living in its own plugin atobservability_solution/entity_manager_app