Skip to content

Conversation

@wangzlei
Copy link
Contributor

Description of changes:

When user create service by Django REST Framework

# Django REST Framework ViewSets
class TestViewSet(viewsets.ViewSet):
    """Test ViewSet for DRF routing"""
    
    def list(self, request):
        """GET /test/"""
        requests.get("https://aws.amazon.com/")
        return Response({
            "message": "Test ViewSet list action",
            "method": "GET",
            "action": "list"
        })

Trace data will have code attributes:

{
    "name": "GET ^api/test/$",
    "kind": "SpanKind.SERVER",
    "attributes": {
        "http.method": "GET",
        "http.url": "http://127.0.0.1:8080/api/test/",
        "http.route": "^api/test/$",
        "code.function.name": "views.TestViewSet.list",
        "code.file.path": "/Volumes/workplace/extension/aws-otel-python-instrumentation/samples/django/views.py",
        "code.line.number": 97,
        "http.status_code": 200
    },

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@wangzlei wangzlei requested a review from a team as a code owner November 19, 2025 05:21
@vastin vastin added the skip changelog doesn't need a CHANGELOG entry label Nov 19, 2025
@wangzlei wangzlei enabled auto-merge (squash) November 19, 2025 18:23
@wangzlei wangzlei merged commit c398aed into aws-observability:main Nov 19, 2025
25 of 27 checks passed
wangzlei added a commit to wangzlei/aws-otel-python-instrumentation that referenced this pull request Nov 19, 2025
*Description of changes:*

When user create service by Django REST Framework
```
# Django REST Framework ViewSets
class TestViewSet(viewsets.ViewSet):
    """Test ViewSet for DRF routing"""
    
    def list(self, request):
        """GET /test/"""
        requests.get("https://aws.amazon.com/")
        return Response({
            "message": "Test ViewSet list action",
            "method": "GET",
            "action": "list"
        })
```

Trace data will have code attributes:
```
{
    "name": "GET ^api/test/$",
    "kind": "SpanKind.SERVER",
    "attributes": {
        "http.method": "GET",
        "http.url": "http://127.0.0.1:8080/api/test/",
        "http.route": "^api/test/$",
        "code.function.name": "views.TestViewSet.list",
        "code.file.path": "/Volumes/workplace/extension/aws-otel-python-instrumentation/samples/django/views.py",
        "code.line.number": 97,
        "http.status_code": 200
    },
```

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
wangzlei added a commit to wangzlei/aws-otel-python-instrumentation that referenced this pull request Nov 19, 2025
*Description of changes:*

When user create service by Django REST Framework
```
# Django REST Framework ViewSets
class TestViewSet(viewsets.ViewSet):
    """Test ViewSet for DRF routing"""
    
    def list(self, request):
        """GET /test/"""
        requests.get("https://aws.amazon.com/")
        return Response({
            "message": "Test ViewSet list action",
            "method": "GET",
            "action": "list"
        })
```

Trace data will have code attributes:
```
{
    "name": "GET ^api/test/$",
    "kind": "SpanKind.SERVER",
    "attributes": {
        "http.method": "GET",
        "http.url": "http://127.0.0.1:8080/api/test/",
        "http.route": "^api/test/$",
        "code.function.name": "views.TestViewSet.list",
        "code.file.path": "/Volumes/workplace/extension/aws-otel-python-instrumentation/samples/django/views.py",
        "code.line.number": 97,
        "http.status_code": 200
    },
```

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
wangzlei added a commit that referenced this pull request Nov 19, 2025
*Description of changes:*

When user create service by Django REST Framework
```
# Django REST Framework ViewSets
class TestViewSet(viewsets.ViewSet):
    """Test ViewSet for DRF routing"""
    
    def list(self, request):
        """GET /test/"""
        requests.get("https://aws.amazon.com/")
        return Response({
            "message": "Test ViewSet list action",
            "method": "GET",
            "action": "list"
        })
```

Trace data will have code attributes:
```
{
    "name": "GET ^api/test/$",
    "kind": "SpanKind.SERVER",
    "attributes": {
        "http.method": "GET",
        "http.url": "http://127.0.0.1:8080/api/test/",
        "http.route": "^api/test/$",
        "code.function.name": "views.TestViewSet.list",
        "code.file.path": "/Volumes/workplace/extension/aws-otel-python-instrumentation/samples/django/views.py",
        "code.line.number": 97,
        "http.status_code": 200
    },
```

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog doesn't need a CHANGELOG entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants