Skip to content

Conversation

seanzatzdev
Copy link
Contributor

@seanzatzdev seanzatzdev commented Oct 21, 2025

Add GET endpoint for sampling config:
e.g.
Get Configuration
The GET /index-name/_sample/config API will get a specific configuration. For example:

GET /logs/_sample/config

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

@seanzatzdev seanzatzdev requested a review from Copilot October 21, 2025 21:29
Copy link
Contributor

@Copilot 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 GET endpoint to retrieve sampling configuration for a specific index. The implementation follows the existing patterns established by the PUT and DELETE operations for sampling configurations.

Key Changes

  • Introduces GetSampleConfigurationAction with request/response classes for retrieving sampling config
  • Implements REST and transport layer handlers for the new GET endpoint at /{index}/_sample/config
  • Adds comprehensive test coverage including unit tests, integration tests, and REST API spec tests

Reviewed Changes

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

Show a summary per file
File Description
Constants.java Adds the new action permission string for the GET operation
GetSampleConfigurationActionResponseTests.java Unit tests for response serialization and mutation
GetSampleConfigurationActionRequestTests.java Unit tests for request validation and behavior
TransportGetSampleConfigurationAction.java Core transport action that retrieves config from cluster metadata
RestGetSampleConfigurationAction.java REST handler for the GET endpoint
GetSampleConfigurationAction.java Action definition with Request/Response classes
ActionModule.java Registers the new action and REST handler
GetSampleConfigurationActionIT.java Integration tests for various GET scenarios
10_basic.yml REST API specification tests
indices.get_sample_configuration.json REST API endpoint specification

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

@seanzatzdev seanzatzdev marked this pull request as ready for review October 21, 2025 21:39
@seanzatzdev seanzatzdev added the :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP label Oct 21, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Oct 21, 2025
@seanzatzdev seanzatzdev added >non-issue and removed Team:Data Management Meta label for data/management team labels Oct 21, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@seanzatzdev seanzatzdev requested a review from masseyke October 21, 2025 21:40
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Oct 21, 2025
@seanzatzdev seanzatzdev changed the title add get call for configs add get call for sampling configs Oct 21, 2025
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.

2 participants