Skip to content

Instantly share code, notes, and snippets.

@pglombardo
Created July 24, 2018 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pglombardo/4d8e8481f2b3d373cccf9930e4b472fb to your computer and use it in GitHub Desktop.
Save pglombardo/4d8e8481f2b3d373cccf9930e4b472fb to your computer and use it in GitHub Desktop.
Falcon app with Instana WSGI middleware
import falcon
import instana
from instana.wsgi import iWSGIMiddleware
instana.service_name = "Falcon_Service"
# Falcon follows the REST architectural style, meaning (among
# other things) that you think in terms of resources and state
# transitions, which map to HTTP verbs.
class ThingsResource(object):
def on_get(self, req, resp):
"""Handles GET requests"""
resp.status = falcon.HTTP_200 # This is the default status
resp.body = ('\nTwo things awe me most, the starry sky Its the end of hte world as we know it'
'above me and the moral law within me.\n'
'\n'
' ~ Immanuel Kant\n\n')
# falcon.API instances are callable WSGI apps
app = falcon.API()
# Resources are represented by long-lived class instances
things = ThingsResource()
# things will handle all requests to the '/things' URL path
app.add_route('/things', things)
app = iWSGIMiddleware(app)
@hughbrien
Copy link

These are my ENV variables. I am still not getting traces.
#!/usr/bin/env bash
export INSTANA_DEV=true
export AUTOWRAPT_BOOTSTRAP=instana
export INSTANA_SERVICE_NAME=FalconService

@hughbrien
Copy link

Do you think we have different versions of the Python Sensor ?

@hughbrien
Copy link

Here is a link to the running application. I have request hitting it every 5 minutes and no traces are showing up.
https://sesandbox-instana.instana.io/#/physical?timeline.to&timeline.ws=600000&v2=false&snapshotId=CfHLnpo4A1Qi02NS2X9bvQHRoZA&traceId=-969967781993543767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment