Skip to content

parametric: Adds a feature to track the parity for parametric endpoints#3345

Merged
mabdinur merged 19 commits intomainfrom
munir/parametric-unit-tests
Nov 6, 2024
Merged

parametric: Adds a feature to track the parity for parametric endpoints#3345
mabdinur merged 19 commits intomainfrom
munir/parametric-unit-tests

Conversation

@mabdinur
Copy link
Copy Markdown
Contributor

@mabdinur mabdinur commented Oct 30, 2024

Motivation

Introduces parametric_endpoint_parity feature.

The goal of the parametric_endpoint_parity feature is to:

  • Track which parametric endpoints are implemented in each language
  • Document and assert the expected input and outputs for each parametric endpoint
  • Future proofing: Catch unexpected regressions/modifications in parametric endpoints
  • Track which parametric apps are incomplete and require additional work
  • Require all future parametric endpoints to have one test case in parametric_endpoint_parity.py

Changes

  • Adds unit tests/documentation for supported parametric endpoints
  • Updates the python parametric app to ensure it is fully up to spec. This will be the reference implementation for all endpoints.
  • Marks some parametric endpoints for removal
  • Marks some arguments in parametric endpoints for removal
  • Includes a link to the parametric_endpoint_parity tab in the feature parity dashboard in contributing docs. Before introducing new tests developers should be aware of the health and availability of parametric endpoints.

Next steps

  • Fix all failing tests in test_parametric_endpoints.py
  • Remove:
    • _TestSpan.span_get_name, _TestSpan.span_get_resource, _TestSpan.span_get_meta, _TestSpan.span_get_metric interfaces/endpoints. These operations are not supported in most languages. Tests should be refactored to use the test agent to retrieve span data.
    • _TestOtelSpan.get_attribute, _TestOtelSpan.get_name, _TestOtelSpan.get_links` interfaces and parametric endpoints. These operations are not supported in the opentelemetry-api. Tests should be refactored to use the test agent to retrieve span data.
    • APMLibrary.current_span and APMLibrary.otel_current_span interfaces/endpoints. Retrieving the current active span is not possible in all parametric apps. Many parametric apps are multi-threaded do not store the "current span" as the active span. Spans should always be retrieved by span_id.
    • APMLibrary.http_client_request endpoint. This endpoint only exists in 1 or 2 apps. It does not test a span/tracer api. The make_distinct_call weblog endpoint should be used instead.
    • http_headers, origin, and links arguments from trace/span/start. Most libraries do not support initializing a datadog span with these values. We will provide a alternative mechanisms to apply these values to spans: parametric: Ensure start span endpoints align with the spec #3300

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

@mabdinur mabdinur force-pushed the munir/parametric-unit-tests branch 10 times, most recently from 3ab951d to 2d8ad43 Compare October 31, 2024 19:18
@mabdinur mabdinur changed the title parametric tests: Adds the parametric_endpoint_parity feature parametric tests: Adds a feature to track parity for parametric endpoints Oct 31, 2024
Comment thread utils/parametric/spec/otel_trace.py Outdated
@mabdinur mabdinur force-pushed the munir/parametric-unit-tests branch from a5dbdb2 to 5781aa7 Compare October 31, 2024 20:19
@mabdinur mabdinur marked this pull request as ready for review October 31, 2024 20:19
@mabdinur mabdinur requested review from a team as code owners October 31, 2024 20:19
Comment thread utils/parametric/_library_client.py Outdated
Comment thread utils/parametric/_library_client.py Outdated
Comment thread utils/parametric/_library_client.py Outdated
Comment thread utils/parametric/_library_client.py Outdated
Comment thread utils/parametric/_library_client.py Outdated
Comment thread utils/_features.py Outdated
Comment thread manifests/golang.yml
@mabdinur mabdinur force-pushed the munir/parametric-unit-tests branch from 213b330 to da757e5 Compare November 6, 2024 01:34
Comment thread utils/parametric/_library_client.py Outdated
Comment thread tests/parametric/test_parametric_endpoints.py Outdated
Comment thread tests/parametric/test_parametric_endpoints.py Outdated
@mabdinur mabdinur requested a review from cbeauchesne November 6, 2024 15:05
@mabdinur mabdinur merged commit f30d474 into main Nov 6, 2024
@mabdinur mabdinur deleted the munir/parametric-unit-tests branch November 6, 2024 18:10
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.

6 participants