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

Performance issue with observability metrics for unique URLs #1630

Closed
HeshanSudarshana opened this issue Jul 9, 2021 · 3 comments · Fixed by ballerina-platform/module-ballerina-http#636
Assignees
Labels
module/http Team/PCM Protocol connector packages related issues Type/Improvement

Comments

@HeshanSudarshana
Copy link

Description:

Some of the metrics provided in the observability feature consist of tags such as http_url which is a string with the invocation URL. Therefore, when there are query params or path params of high entropy such as timestamp, the unique metric count rises which may lead to a performance issue.

The following metric is an example. (The URL provided is for the request https://localhost:9095/v2/pet/findByStatus?status=available)

http_response_time_seconds_value{http_method="GET", http_url="/v2/pet/findByStatus_status_available", instance="172.17.0.1:9000", job="Ballerina_Metrics", protocol="http", resource="get3f443a64f0bf4231b0bbe0435f4a4e73", service="Swagger_space_Petstore__1_0_5"}
@chamil321
Copy link
Contributor

chamil321 commented Jul 15, 2021

Ballerina 1.2.x branch fix is done via ballerina-platform/ballerina-lang#31706

@chamil321
Copy link
Contributor

As per the discussion [P2] [INTERNAL] (STLSUB-8) - Micro Gateway 3.2.3 goes Out of Memory upon Load... client http.url metric made configurable via ballerina-platform/ballerina-lang#32048

@nadundesilva
Copy link

nadundesilva commented Sep 9, 2021

We will need to do the same change for Ballerina Swan Lake as well.

  • In server side metrics (incoming requests), we can do either of the following
    • change the value added to the templated path (e.g. /employees/[string employeeId]/details) (prefered)
    • change the tag to a tracing only tag
  • In client side metrics (outgoing requests), we can change the tag to a tracing only tag

Note: We can use the following methods to add a tag only to tracing data by using the falling functions

  • In Ballerina Code: observe:addTagToSpan(tagKey, tagValue)
  • In native Java code: observerContext.getSpan().addTag(tagKey, tagValue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/http Team/PCM Protocol connector packages related issues Type/Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants