Skip to content
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

[Logs UI] Support Kibana index pattern references in log source configuration #92650

Closed
Tracked by #88607
weltenwort opened this issue Feb 24, 2021 · 2 comments
Closed
Tracked by #88607
Assignees
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.13.0
Milestone

Comments

@weltenwort
Copy link
Member

weltenwort commented Feb 24, 2021

Summary

In order to support the usage of Kibana index patterns (KIPs) in the Logs UI, the source configuration needs to be able to encode references to them while still allowing for the backwards-compatible legacy configuration. To that end, this enhancement modifies the saved object and related code without exposing the new style of configuration in the UI.

relates to #88607

Acceptance Criteria

  • The SourceConfigurationRuntimeType and related API types can encode both the "legacy" index name pattern as well as a Kibana index pattern (KIP) reference. (see "Notes" below)
  • A migration exists that migrates the infrastructure-ui-source saved object such that the logAlias property is replaced with a logIndices property, which encodes the string previously assigned to logAlias according to the new runtime type.
  • The saved object defaults match the new schema, but default to the legacy index-name reference type.
  • The KIP is referenced in the saved object metadata such that Kibana can handle the dependency accordingly (e.g. in the export functionality).
  • A function exists to resolve a given source configuration with either an index-name or index-pattern reference to a unified type that...
    • provides the final index name patterns and field names required for queries.
    • can be used both in the browser as well as the server.
    • hard-codes the tiebreaker field to _doc for the KIP-based source configuration.
    • uses the KIP's timestamp field instead of the fields.timestamp value.
  • Code that constructs queries uses the new unified type.

Notes

The references could be encoded in something like the following:

interface LogIndexPatternReference {
  type: 'index-pattern';
  indexPattern: string;
}

interface LogIndexNameReference {
  type: 'index-name';
  indexName: string;
}

type LogIndexReference = LogIndexPatternReference | LogIndexNameReference;
@weltenwort weltenwort added Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.13.0 labels Feb 24, 2021
@weltenwort weltenwort added this to the Logs UI 7.13 milestone Feb 24, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@weltenwort
Copy link
Member Author

💭 Should the saved object retain the tiebreaker in fields.tiebreaker or should it move into the LogIndexNameReference data structure when type === 'index-name'?

One argument for that would be that fields.tiebreaker is not read if logIndices !== 'index-name'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.13.0
Projects
None yet
Development

No branches or pull requests

3 participants