Skip to content

Conversation

@seanzatzdev
Copy link
Contributor

adds the get endpoint for all sampling configs; e.g.

GET /_sample/config

returns:

[
  {
    "index": "logs",
    "configuration:
    {
      "rate": "5%",
      "if": "ctx?.network?.name == 'Guest'"
    }
  },
  {
    "index": "my-index",
    "configuration:
    {
      "rate": "25%"
    }
  }
]

@seanzatzdev seanzatzdev requested a review from Copilot October 23, 2025 20:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new GET endpoint /_sample/config to retrieve all sampling configurations across the cluster. The endpoint returns an array of objects containing index names and their associated sampling configurations.

Key changes:

  • Introduced GetAllSampleConfigurationAction with request/response classes supporting cluster-wide configuration retrieval
  • Added transport and REST handlers for the new action
  • Implemented comprehensive test coverage including unit, integration, and YAML REST tests

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
GetAllSampleConfigurationAction.java Defines the action type, request/response classes with serialization and XContent support
TransportGetAllSampleConfigurationAction.java Implements transport layer logic to retrieve all sampling configurations from cluster metadata
RestGetAllSampleConfigurationAction.java REST handler mapping GET /_sample/config to the transport action
ActionModule.java Registers the new action and REST handler
Constants.java Adds the new action privilege string
GetAllSampleConfigurationActionRequestTests.java Unit tests for request serialization and task creation
GetAllSampleConfigurationActionResponseTests.java Unit tests for response serialization with mutation testing
GetAllSampleConfigurationActionIT.java Integration tests covering various scenarios
10_basic.yml YAML REST API tests
indices.get_all_sample_configuration.json REST API specification

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…mpling/GetAllSampleConfigurationAction.java

Co-authored-by: Copilot <[email protected]>
@seanzatzdev seanzatzdev requested a review from masseyke October 23, 2025 20:08
@seanzatzdev seanzatzdev marked this pull request as ready for review October 23, 2025 20:08
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Oct 23, 2025
@seanzatzdev seanzatzdev added >non-issue :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP labels Oct 23, 2025
@elasticsearchmachine elasticsearchmachine added Team:Data Management Meta label for data/management team and removed needs:triage Requires assignment of a team area label labels Oct 23, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@seanzatzdev
Copy link
Contributor Author

seanzatzdev commented Oct 23, 2025

Looks like the yaml rest tests are all getting "connection refused" for some reason, not sure what that's about but seems like it must be a wider problem since all of the yaml tests i didnt touch are getting it

Copy link
Member

@masseyke masseyke 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 to me, with the exception of the unreachable test code I commented on.

@seanzatzdev seanzatzdev enabled auto-merge (squash) October 23, 2025 23:35
@seanzatzdev seanzatzdev disabled auto-merge October 24, 2025 17:55
@seanzatzdev seanzatzdev merged commit 8b7d621 into elastic:main Oct 24, 2025
34 checks passed
@seanzatzdev seanzatzdev deleted the get-all-sample-config branch October 24, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >non-issue Team:Data Management Meta label for data/management team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants