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][POC] The POC for creating entity-centric indices using entity definitions #183205
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
id: z.string().regex(/^[\w-]+$/), | ||
name: z.string(), | ||
description: z.optional(z.string()), | ||
type: assetTypeSchema, |
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.
this implies that only definitions using known types are alllowed?
we should discuss this again with chris d to ensure it's extensible wrt user-defined entity definitions.
...ns/observability_solution/asset_manager/server/lib/oam/create_and_install_ingest_pipeline.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_solution/asset_manager/server/lib/oam/delete_index.ts
Outdated
Show resolved
Hide resolved
.../plugins/observability_solution/asset_manager/server/lib/oam/transform/generate_transform.ts
Outdated
Show resolved
Hide resolved
.../plugins/observability_solution/asset_manager/server/lib/oam/transform/generate_transform.ts
Outdated
Show resolved
Hide resolved
...ugins/observability_solution/asset_manager/server/lib/oam/transform/generate_transform_id.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_solution/asset_manager/server/routes/oam/create.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_solution/asset_manager/server/routes/oam/create.ts
Outdated
Show resolved
Hide resolved
- making indexPattern plural - removing categories and assst.category - fixing typos - adding clean up when creation fails - changing path from `/api/oam` to `/api/oam/definition` - removing unused `preview_transform.ts` - updating fixtures and tests - changing OAMNotFound to OAMDefinitionNotFound
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.
awesome chris - thanks
...servability_solution/asset_manager/server/lib/entities/create_and_install_ingest_pipeline.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_solution/asset_manager/server/templates/assets_template.ts
Show resolved
Hide resolved
Pinging @elastic/obs-knowledge-team (Team:obs-knowledge) |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Canvas Sharable Runtime
History
To update your PR or re-run it, just comment with: |
@@ -0,0 +1,3 @@ | |||
# @kbn/entities-schema | |||
|
|||
The entities schema for the asset model for Observability |
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.
we can leave this 'asset' here just for historical interest 🪦
...acc, | ||
[`entity.identity.${field}`]: { terms: { field } }, | ||
[`entity.identity.${id.field}`]: { | ||
terms: { field: id.field, missing_bucket: id.optional }, |
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.
well, that was simple!
Summary
This is a "proof of concept" for generating entity-centric indices for the OAM. This exposes an API (
/api/entities
) for creating "asset definitions" (EntityDefinition
) that manages a transform and ingest pipeline to produce documents into an index which could be used to create a search experience or lookups for different services.Features
identityFields
along with anidentityTemplate
for formatting theasset.id
identityFields
using{ "field": "path-to-field", "optional": true }
definition instead of astring
.metrics
with equations which are compatible with the SLO productmetadata
fields which will include multiple values.metadata
fields can be re-mapped to a new destination path using{ "source": "path-to-source-field", "limit": 1000, "destination": "path-to-destination-in-output" }
definition instead of astring
staticFields
which can also use template variables.entities-observability.summary-v1.{defintion.id}
)Notes
definition.timestampField
and break the indices into monthly indexes (configurable in the settings).firstSeenTimestamp
, this is a difficult due to scaling issue. Essentially, we would need to find theminimum
timestamp for each entity which could be extremely costly on a large datasets..entities-observability.summary-v1.*
index pattern to create summaries of summaries... it can be very "meta".API
POST /api/entities/definition
- Creates a new asset definition and starts the indexing. See examples below.DELETE /api/entities/definition/{id}
- Deletes the asset definition along with cleaning up the transform, ingest pipeline, and deletes the destination index.POST /api/entities/definition/{id}/_reset
- Resets the transform, ingest pipeline, and destination index. This is useful for upgrading asset definitions to new features.Example Definitions and Output
Here is a definition for creating services for each of the custom log sources in the
fake_stack
dataset fromx-pack/packages/data-forge
.Which produces:
Here is an example of a definition for APM Services:
Which produces:
Getting Started
The easiest way to get started is to use the
kbn-data-forge
config below. Save this YAML to~/Desktop/fake_stack.yaml
then runnode x-pack/scripts/data_forge.js --config ~/Desktop/fake_stack.yaml
. Then create a definition using the first example above.