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

[WIP] add metric to count responses per endpoint #3175

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomklino
Copy link

@tomklino tomklino commented Jan 8, 2025

Description

Add a metric to track the number of responses per endpoint per status code

Fixes # (issue) - no open issue about it that I'm aware of

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

This change has been tested locally. This change DOES NOT YET have automated tests written for it.

  • Run a multithread wsgi server and an opentelemetry debug collector (or mock), send requests to multiple different endpoints, check that the reported values in the collector match the number of requests sent per endpoint, with the expected status codes

Specific example for a test:

  • Run a test server that listens for endpoints /api/foo and /api/bar.
  • The test server should respond with a status code 200, unless a different one specified in a request header "TEST_STATUS_CODE".
  • Send the following requests to the server:
    • /api/foo with a TEST_STATUS_CODE set to 200
    • /api/foo with a TEST_STATUS_CODE set to 500
    • /api/bar with a TEST_STATUS_CODE set to 200
    • /api/bar with a TEST_STATUS_CODE set to 500
  • Wait for the metrics report to the collector
  • Verify that the collector got 1 in the values for each of the metrics

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Copy link

linux-foundation-easycla bot commented Jan 8, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant