Skip to content

New AWS Lambda Support #219

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

Merged
merged 29 commits into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4642823
Refactor, reorganize and cleanup for AWS prep
pglombardo Feb 14, 2020
d090049
AWS Lambda Agent, Layer, Span & handler method
pglombardo Feb 25, 2020
4e5e1ed
Functional Lambda Tracing and Infra linking
pglombardo Feb 27, 2020
a53e74b
Bug fixes for test suite issues
pglombardo Feb 27, 2020
f0d336e
Bug fixes for test suite issues: second batch
pglombardo Feb 27, 2020
df6f73f
Restructured tag collection
pglombardo Mar 3, 2020
cc3dd0a
Update suds and grpcio tests. Unify spans in span.py
pglombardo Mar 3, 2020
2b641ea
Remove debug remnants
pglombardo Mar 3, 2020
63c4dd6
Update/fix cassandra tests
pglombardo Mar 3, 2020
1e7f775
Check if agent supports extra_headers before proceeding
pglombardo Mar 5, 2020
ddd45ce
Centralize all lambda instrumentation
pglombardo Mar 10, 2020
130e931
New Lambda test suite
pglombardo Mar 10, 2020
6d27d42
New and improved lambda handler and handler parsing
pglombardo Mar 10, 2020
e3c5f92
Fix trailing slash bug reported by Justyn
pglombardo Mar 10, 2020
a2f9ae4
Refinement and additions for the test suite
pglombardo Mar 10, 2020
d7189a4
Linter love
pglombardo Mar 10, 2020
46df777
Allow get/set of agent & tracer for tests
pglombardo Mar 10, 2020
a28c1ae
Updated build script
pglombardo Mar 10, 2020
2c824ad
Restore agent and tracer after each test; lint fixes
pglombardo Mar 10, 2020
cdd15b0
Enable script for all regions
pglombardo Mar 13, 2020
26888d0
Better script name
pglombardo Mar 13, 2020
e70ae15
Trigger support & tests
pglombardo Mar 17, 2020
e214ceb
Move Lambda inst into it's own package
pglombardo Mar 17, 2020
d583626
Code documentation
pglombardo Mar 18, 2020
61d80ce
Update import path
pglombardo Mar 18, 2020
372672d
Keep 2.7 compatible: no type hints
pglombardo Mar 18, 2020
06be7e8
Py 2.7 compatible decompression
pglombardo Mar 18, 2020
58abc62
Fix Python 3.5 compatibility
pglombardo Mar 19, 2020
4e0571e
Remove comment
pglombardo Mar 19, 2020
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
Prev Previous commit
Next Next commit
Bug fixes for test suite issues
  • Loading branch information
pglombardo committed Feb 27, 2020
commit a53e74b27aa2b64dcf807e331569bbfefbce792d
4 changes: 2 additions & 2 deletions instana/json_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ def __init__(self, span, kind, data, agent, **kwargs):
self.p = span.parent_id
self.s = span.context.span_id
self.ts = int(round(span.start_time * 1000))
self.ta = "py"
self.d = int(round(span.duration * 1000))
self.f = agent.get_from_structure()
self.ec = span.tags.pop("ec", None)
self.error = span.tags.pop("error", False)
self.error = span.tags.pop("error", None)

if data.sdk:
self.n = "sdk"
Expand Down Expand Up @@ -191,6 +190,7 @@ def __init__(self, span, **kwargs):
self.db = span.tags.pop(ot_tags.DATABASE_INSTANCE, None)
self.user = span.tags.pop(ot_tags.DATABASE_USER, None)
self.stmt = span.tags.pop(ot_tags.DATABASE_STATEMENT, None)
self.error = span.tags.pop('error', None)
super(MySQLData, self).__init__(**kwargs)


Expand Down
8 changes: 6 additions & 2 deletions instana/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,14 @@ def build_registered_span(self, span):
def _populate_entry_span_data(self, span, data):
if span.operation_name in self.http_spans:
data.http = HttpData(span)
elif span.operation_name == "rpc-server":
data.rpc = RPCData(span)
elif span.operation_name == "aws.lambda.entry":
data.aws_lambda = AWSLambdaData(span)
elif span.operation_name == "rabbitmq":
data.rabbitmq = RabbitmqData(span)
elif span.operation_name == "rpc-server":
data.rpc = RPCData(span)
elif span.operation_name == "soap":
data.soap = SoapData(span)
else:
logger.debug("SpanRecorder: Unknown entry span: %s" % span.operation_name)

Expand Down
37 changes: 12 additions & 25 deletions tests/test_ot_propagators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import inspect

import basictracer
import opentracing as ot
from nose.tools import assert_equals

Expand All @@ -23,8 +22,7 @@ def test_http_basics():


def test_http_inject_with_dict():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {}
span = ot.tracer.start_span("nosetests")
Expand All @@ -39,8 +37,7 @@ def test_http_inject_with_dict():


def test_http_inject_with_list():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = []
span = ot.tracer.start_span("nosetests")
Expand All @@ -52,8 +49,7 @@ def test_http_inject_with_list():


def test_http_basic_extract():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {'X-Instana-T': '1', 'X-Instana-S': '1', 'X-Instana-L': '1'}
ctx = ot.tracer.extract(ot.Format.HTTP_HEADERS, carrier)
Expand All @@ -64,8 +60,7 @@ def test_http_basic_extract():


def test_http_mixed_case_extract():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {'x-insTana-T': '1', 'X-inSTANa-S': '1', 'X-INstana-l': '1'}
ctx = ot.tracer.extract(ot.Format.HTTP_HEADERS, carrier)
Expand All @@ -76,8 +71,7 @@ def test_http_mixed_case_extract():


def test_http_no_context_extract():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {}
ctx = ot.tracer.extract(ot.Format.HTTP_HEADERS, carrier)
Expand All @@ -86,8 +80,7 @@ def test_http_no_context_extract():


def test_http_128bit_headers():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {'X-Instana-T': '0000000000000000b0789916ff8f319f',
'X-Instana-S': '0000000000000000b0789916ff8f319f', 'X-Instana-L': '1'}
Expand All @@ -111,8 +104,7 @@ def test_text_basics():


def test_text_inject_with_dict():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {}
span = ot.tracer.start_span("nosetests")
Expand All @@ -127,8 +119,7 @@ def test_text_inject_with_dict():


def test_text_inject_with_list():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = []
span = ot.tracer.start_span("nosetests")
Expand All @@ -140,8 +131,7 @@ def test_text_inject_with_list():


def test_text_basic_extract():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {'X-INSTANA-T': '1', 'X-INSTANA-S': '1', 'X-INSTANA-L': '1'}
ctx = ot.tracer.extract(ot.Format.TEXT_MAP, carrier)
Expand All @@ -152,8 +142,7 @@ def test_text_basic_extract():


def test_text_mixed_case_extract():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {'x-insTana-T': '1', 'X-inSTANa-S': '1', 'X-INstana-l': '1'}
ctx = ot.tracer.extract(ot.Format.TEXT_MAP, carrier)
Expand All @@ -162,8 +151,7 @@ def test_text_mixed_case_extract():


def test_text_no_context_extract():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {}
ctx = ot.tracer.extract(ot.Format.TEXT_MAP, carrier)
Expand All @@ -172,8 +160,7 @@ def test_text_no_context_extract():


def test_text_128bit_headers():
opts = options.Options()
ot.tracer = InstanaTracer(opts)
ot.tracer = InstanaTracer()

carrier = {'X-INSTANA-T': '0000000000000000b0789916ff8f319f',
'X-INSTANA-S': ' 0000000000000000b0789916ff8f319f', 'X-INSTANA-L': '1'}
Expand Down