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

Implement new HTTP semantic convention opt-in for Falcon #2790

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FilipNikolovski
Copy link
Contributor

Description

This change updates the falcon instrumentor to adhere to the new HTTP semantic conventions, according to the migration plan outlined here:

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Updated the tests to assert that the new span and duration attributes have been added.

@FilipNikolovski FilipNikolovski requested a review from a team August 9, 2024 15:22
Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A big thanks for working on this one. Just some comments

@@ -66,6 +70,7 @@ def setUp(self):
{
"OTEL_PYTHON_FALCON_EXCLUDED_URLS": "ping",
"OTEL_PYTHON_FALCON_TRACED_REQUEST_ATTRS": "query_string",
"OTEL_SEMCONV_STABILITY_OPT_IN": "http/dup",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing the tests for "http" and "default"?

@@ -243,6 +251,11 @@ class _InstrumentedFalconAPI(getattr(falcon, _instrument_app)):
def __init__(self, *args, **kwargs):
otel_opts = kwargs.pop("_otel_opts", {})

_OpenTelemetrySemanticConventionStability._initialize()
Copy link
Member

@emdneto emdneto Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are missing some important points here:

Checklist

  • Add semconv status as migration for falcon in instrumentations README
  • Populate {method} as HTTP when nonstandard method (sanitize_method)
  • set request HTTP method attribute as _OTHER when nonstandard http method and for new semconv also set http.request.method_original with the original nonstandard method.
  • Set schema_url based on the opt-in mode
  • Create histograms based on the opt-in mode (different metric names so no dup attributes)
  • Set metrics attributes based on the opt-in mode
  • Set span attributes based on the opt-in mode
  • Tests for new_semconv, both_semconv and default

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the great feedback, I'll get started on this.

@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `opentelemetry-instrumentation-kafka-python` Instrument temporary fork, kafka-python-ng
inside kafka-python's instrumentation
([#2537](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2537)))
- `opentelemetry-instrumentation-falcon` Implement new HTTP semantic convention opt-in for Falcon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `opentelemetry-instrumentation-falcon` Implement new HTTP semantic convention opt-in for Falcon
- `opentelemetry-instrumentation-falcon` Implement new HTTP semantic convention opt-in for Falcon
([#2790](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2790))

@emdneto emdneto mentioned this pull request Aug 14, 2024
7 tasks
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.

3 participants