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

[Profiling] Add status API #96272

Merged
merged 3 commits into from May 26, 2023

Conversation

danielmitterdorfer
Copy link
Member

With this commit we add a new REST API to the profiling plugin that allows to retrieve its current status.

With this commit we add a new REST API to the profiling plugin that
allows to retrieve its current status.
@elasticsearchmachine
Copy link
Collaborator

Hi @danielmitterdorfer, I've created a changelog YAML for you.

@danielmitterdorfer
Copy link
Member Author

The API can be called as follows: GET /_profiling/status and will return three boolean flags:

{
  "enabled" : true,
  "active" : false,
  "resources_created" : false
}
  • enabled indicates whether the plugin is enabled at all
  • active indicates whether index management is active
  • resources_created indicates whether all resources (index templates) have been created successfully

Copy link
Contributor

@jbcrail jbcrail left a comment

Choose a reason for hiding this comment

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

No specific feedback about the code, which looks good.

My only comment so far is about the response and how a client would use it. For instance, given that resources_created states whether all templates, indices, etc have been created, I can imagine that we may eventually want a way to capture additional resource states, such as "creation in-progress" or "creation failed".

Relatedly, is there an existing way for us to surface errors in the bootstrapping process to users via Kibana?

@danielmitterdorfer
Copy link
Member Author

Thanks for the feedback. Due to the way this is handled in the underlying infrastructure it's not possible to surface errors (or show progress). However, I'd also argue that cases where it's not possible to create index templates are rather rare and that would warrant a support case.

@rockdaboot
Copy link
Contributor

Just in case of future extensions and also for readability of the answer, I prefer more verbose keywords.
"enabled" (what is enabled ?) -> "profiling_enabled"
"active" (what is active ?) -> "index_mgmt_active"
"resources_created" (which resources ?) -> "index_templates_created"

Another option is to extend the JSON schema like (example, maybe over the top :))

{
  "profiling": {
    "enabled": true
  },
  "index_management": {
    "active": true
  },
  "resources": {
    "index_templates": {
      "created": true
    }
  }
}

@danielmitterdorfer
Copy link
Member Author

danielmitterdorfer commented May 25, 2023

@rockdaboot and I had a chat offline and came up with this response structure:

{
  "profiling": {
    "enabled": true
  },
  "resource_management": {
    "enabled": true
  },
  "resources": {
    "created": true
  }
}

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/profiling (Team:Universal Profiling)

Copy link
Contributor

@rockdaboot rockdaboot left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jbcrail jbcrail left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@danielmitterdorfer danielmitterdorfer merged commit 08c0a9c into elastic:main May 26, 2023
12 checks passed
@danielmitterdorfer danielmitterdorfer deleted the profiling-status branch September 8, 2023 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :UniversalProfiling/Application Elastic Universal Profiling REST APIs and infrastructure v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants