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

Update Falcon example to use version 3 #134

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
#!/usr/bin/env python

import json
import sys
import logging

import falcon
from wsgiref import simple_server
from opentelemetry import trace
from opentelemetry.trace import SpanKind


tracer = trace.get_tracer(__name__)

class HelloWorldResource(object):
def on_get(self, req, resp):
"""Handles GET requests"""
with tracer.start_as_current_span('internal_span', kind=SpanKind.INTERNAL) as span:
resp.body = json.dumps({'ok': True})
resp.body = json.dumps({'ok': True})


app = falcon.API()
app = falcon.App()
Copy link
Contributor

Choose a reason for hiding this comment

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

This change plus version update should be enough. Any reason to remove tracing or change the quotation marks?

Copy link
Author

Choose a reason for hiding this comment

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

Hey,
I'll change back to single quotes 👍🏻

I find it very confusing that Falcon is the only tracing example with a manual trace.
This repo tends to supply examples of how to instrument different frameworks. Using the SDK to start a trace manually has nothing to do with this framework or the other.


app.add_route('/hello', HelloWorldResource())

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
falcon==2.0.0
falcon~=3.0
splunk-opentelemetry[all]>=0.17.0