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

[BUG] The RestAction names should be templated otherwise the set of operations explodes #10791

Open
reta opened this issue Oct 20, 2023 · 5 comments
Labels
bug Something isn't working v2.12.0 Issues and PRs related to version 2.12.0 v3.0.0 Issues and PRs related to version 3.0.0

Comments

@reta
Copy link
Collaborator

reta commented Oct 20, 2023

Describe the bug
Right now the RestAction spans are created out exact request URI which:

  • includes query parameters
  • includes exact path parameters (even if the RestAction is the same)

Here are couples of examples:

Screenshot from 2023-10-20 11-58-53

image

image

image

To Reproduce

For example:

curl http://localhost:9200/*/_search
curl http://localhost:9200/*/_search?track_total_hits=false
curl http://localhost:9200/test51/_search?track_total_hits=false

This calls will generate 3 unique operation names but is has to be only one: GET /{indices}/_search with other details of the invocation becoming the tags.

Expected behavior
The operation names for RestAction has to be templated, otherwise the set of operations explodes and troubleshooting becomes unmanageable (like the simple example below has > 2k unique operation calls that should match to only ~20 APIs):

image

Plugins
OpenTelemetry

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • Any

Additional context
Add any other context about the problem here.

CC @Gaganjuneja this is yet another one

@reta reta added bug Something isn't working untriaged and removed untriaged labels Oct 20, 2023
@reta reta added v3.0.0 Issues and PRs related to version 3.0.0 v2.12.0 Issues and PRs related to version 2.12.0 and removed untriaged labels Oct 20, 2023
@reta
Copy link
Collaborator Author

reta commented Oct 20, 2023

@Gaganjuneja please let me know if you need help

@kiranprakash154
Copy link
Contributor

Hi, are we on track for this to be released in 2.12 ?

@Gaganjuneja
Copy link
Contributor

Yes, Thanks!

@Gaganjuneja
Copy link
Contributor

@atharvasharma61 Can you please take this up?

@atharvasharma61
Copy link
Contributor

atharvasharma61 commented Jan 22, 2024

@reta While I was trying to implement it, I came across certain sections where I need some clarity.

For an instance, in the given query -
curl http://localhost:9200/*/_search?track_total_hits=false

String rawPath = "/*/_search"
String rawQuery = "track_total_hits=false" 

basically anything that is followed by '?' is a query param.

I can add the rawPath in the spanName but there are two ways to add params in the tags -

  1. Add a new key as rest.query_params and its value being the complete rawQuery string which might contain multiple params in the same string as they appear in the URI i.e. track_total_hits=false
    rest.query_params : track_total_hits=false
  2. Alternatively, we can add all the params as individual key-value pairs in the corresponding tag section
    track_total_hits : false

Another thing to call out, /*/_search and /test51/_search will be considered different operations in this case.

atharvasharma61 pushed a commit to atharvasharma61/OpenSearch that referenced this issue Jan 24, 2024
…as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>
atharvasharma61 pushed a commit to atharvasharma61/OpenSearch that referenced this issue Jan 25, 2024
…as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>
sachinpkale pushed a commit that referenced this issue Feb 7, 2024
* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
atharvasharma61 added a commit to atharvasharma61/OpenSearch that referenced this issue Feb 7, 2024
…search-project#12005)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
(cherry picked from commit c0fca74)
atharvasharma61 added a commit to atharvasharma61/OpenSearch that referenced this issue Feb 7, 2024
…search-project#12005)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
(cherry picked from commit c0fca74)
atharvasharma61 added a commit to atharvasharma61/OpenSearch that referenced this issue Feb 7, 2024
…search-project#12005)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
(cherry picked from commit c0fca74)
atharvasharma61 added a commit to atharvasharma61/OpenSearch that referenced this issue Feb 7, 2024
…search-project#12005)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
(cherry picked from commit c0fca74)
sachinpkale pushed a commit that referenced this issue Feb 7, 2024
…) (#12221)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
(cherry picked from commit c0fca74)
sachinpkale pushed a commit that referenced this issue Feb 7, 2024
…) (#12222)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
(cherry picked from commit c0fca74)
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this issue Mar 1, 2024
…search-project#12005)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this issue Mar 18, 2024
…search-project#12005)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this issue Apr 25, 2024
…search-project#12005)

* bug fix to have RestActions rawPath as operation names, query params as tags and avoid using exact URI (opensearch-project#10791)

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added UTs

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added parameterized tests

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* improvised parameterized tests using annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* removed unused annotations

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Added details in CHANGELOG.md

Signed-off-by: Atharva Sharma <athrv@amazon.com>

* Addressed spotlessJavaCheck failures

Signed-off-by: Atharva Sharma <athrv@amazon.com>

---------

Signed-off-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Co-authored-by: Atharva Sharma <athrv@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.12.0 Issues and PRs related to version 2.12.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

No branches or pull requests

4 participants