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

[Infra UI] Add configuration options and source graphql api #20789

Conversation

weltenwort
Copy link
Member

@weltenwort weltenwort commented Jul 13, 2018

New Configuration

This PR adds new Kibana configuration options under the key xpack.infra. Any settings given in Kibana's configuration file will be overlaid on top of the following defaults (as discussed in #20428):

xpack.infra:
  sources:
    default:
      metricAlias: 'xpack-infra-default-metrics'
      logAlias: 'xpack-infra-default-logs'
      fields:
        message: ['message', '@message']
        hostname: 'beat.hostname'
        pod: 'kubernetes.pod.name'
        container: 'docker.container.name'
        timestamp: '@timestamp'
        tiebreaker: '_doc'
  query:
    partitionSize: 75
    partitionFactor: 1.2

New GraphQL Queries

Based on the configuration introduced above, the following endpoints have been added:

source(id)

extend type Query {
  "Get an infrastructure data source by id"
  source("The id of the source" id: ID!): InfraSource!
}

Example

query {
  source(id: "default") {
    id
    configuration {
      metricAlias
      logAlias
      fields {
        container
        hostname
        message
        pod
        tiebreaker
        timestamp
      }
    }
  }
}

allSources

extend type Query {
  "Get a list of all infrastructure data sources"
  allSources: [InfraSource!]!
}

Example

query {
  allSources {
    id
  }
}

Other Notes

This also distributes most of the types from infra_types.ts into the
adapter_types.ts of the respective adapters. It also moves functions and types specific to the "nodes" domain into the nodes adapter directory to increase local cohesion.

The source defaults are applied inside of the source lib instead of the configuration schema to maintain separation of concerns and because the configuration schema is Kibana-specific.

Follow-up Tasks

  • move map() query type inside of source()
  • use source configuration for log fetching
  • add source().indices field to diagnose matching indices
  • add source().capabilities field to communicate detected data characteristics

@weltenwort weltenwort added WIP Work in progress :Ingest UI Feature:Metrics UI Metrics UI feature labels Jul 13, 2018
@weltenwort weltenwort self-assigned this Jul 13, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@weltenwort weltenwort force-pushed the infra-ui-enhancement-configuration-api branch from fc1f648 to eefb0d7 Compare July 14, 2018 22:39
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@weltenwort weltenwort changed the title [WIP] [Infra UI] Add configuration options and graphql api [WIP] [Infra UI] Add configuration options and source graphql api Jul 16, 2018
This distributes most of the types from `infra_types.ts` into the
`adapter_types.ts` of the respective adapters. It also moves
nodes-specific stuff into the nodes adapter directory in preparation for
the configuration domain.
@weltenwort weltenwort force-pushed the infra-ui-enhancement-configuration-api branch from eefb0d7 to 31d4628 Compare July 17, 2018 10:05
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@weltenwort weltenwort changed the title [WIP] [Infra UI] Add configuration options and source graphql api [Infra UI] Add configuration options and source graphql api Jul 18, 2018
@weltenwort weltenwort added review and removed WIP Work in progress labels Jul 18, 2018
@weltenwort weltenwort requested a review from simianhacker July 18, 2018 10:28
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@weltenwort weltenwort force-pushed the infra-ui-enhancement-configuration-api branch from 5a69cb8 to 46a8c43 Compare July 18, 2018 17:50
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM... I tested it with GraphiQL

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@weltenwort weltenwort merged commit ab71443 into elastic:feature-infra-ui Jul 19, 2018
@simianhacker simianhacker mentioned this pull request Jul 20, 2018
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants