You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #2624 I added the http.target attribute to duration metrics. In #2714 by @lzchen it was accidentally removed when not opted in to the new semconv. This can be seen by adding print(point.attributes["http.target"]) here:
Adding SpanAttributes.HTTP_TARGET to _server_duration_attrs_old fixes this particular case but breaks others, e.g. http.target starts appearing in starlette metrics with high cardinality values (i.e. the actual path, not the template).
I strongly suggest that these tests assert the actual concrete values of the metrics data as much as possible. Right now they're very lenient and tied to the implementation which allowed this regression to pass through.
The text was updated successfully, but these errors were encountered:
Apologies for the oversight. The instrumentations today support multiple "old" conventions (e.g. most instrumentations support v1.11 but others support v1.20 and others have a mixture of different attributes). In order to better consolidate the old semconvs and encourage migration to new semconv, we have decided to discourage adding any contributions for "old" semconv. This and this were made exceptions and the regression only occurred for django because we just happened to be working on the same change at similar times :). Hopefully with this new guidance these semantic conventions mixups won't happen again.
I've put up a PR to fix the regression. I do realize the solution is a bit hacky but since this SHOULD be a one-off we don't really want to change _server_duration_attrs_old as you have outlined above.
In #2624 I added the
http.target
attribute to duration metrics. In #2714 by @lzchen it was accidentally removed when not opted in to the new semconv. This can be seen by addingprint(point.attributes["http.target"])
here:opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-django/tests/test_middleware.py
Lines 737 to 742 in 5a48824
Adding
SpanAttributes.HTTP_TARGET
to_server_duration_attrs_old
fixes this particular case but breaks others, e.g.http.target
starts appearing in starlette metrics with high cardinality values (i.e. the actual path, not the template).I strongly suggest that these tests assert the actual concrete values of the metrics data as much as possible. Right now they're very lenient and tied to the implementation which allowed this regression to pass through.
The text was updated successfully, but these errors were encountered: