Skip to content

Commit

Permalink
Testing cassandra (#344)
Browse files Browse the repository at this point in the history
fixing bug from customer ticket https://instana.zendesk.com/agent/tickets/23556

* update version
  • Loading branch information
pdimitra authored Dec 9, 2021
1 parent 6245d48 commit d143140
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion instana/instrumentation/cassandra_inst.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def cb_request_finish(results, span, fn):

def cb_request_error(results, span, fn):
collect_response(span, fn)
span.mark_as_errored({"cassandra.error": results.message})
span.mark_as_errored({"cassandra.error": results.summary})
span.finish()


Expand Down
2 changes: 1 addition & 1 deletion instana/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# Module version file. Used by setup.py and snapshot reporting.

VERSION = '1.36.1'
VERSION = '1.36.2'
5 changes: 3 additions & 2 deletions tests/clients/test_cassandra-driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
cluster = Cluster([testenv['cassandra_host']], load_balancing_policy=None)
session = cluster.connect()

session.execute("CREATE KEYSPACE IF NOT EXISTS instana_tests WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};")
session.execute(
"CREATE KEYSPACE IF NOT EXISTS instana_tests WITH replication = {'class':'SimpleStrategy', 'replication_factor':1};")
session.set_keyspace('instana_tests')
session.execute("CREATE TABLE IF NOT EXISTS users("
"id int PRIMARY KEY,"
Expand Down Expand Up @@ -203,7 +204,7 @@ def test_execute_error(self):
self.assertEqual(cspan.data["cassandra"]["keyspace"], 'instana_tests')
self.assertIsNone(cspan.data["cassandra"]["achievedConsistency"])
self.assertIsNotNone(cspan.data["cassandra"]["triedHosts"])
self.assertIsNotNone(cspan.data["cassandra"]["error"])
self.assertEqual(cspan.data["cassandra"]["error"], "Syntax error in CQL query")

def test_prepared_statement(self):
prepared = None
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements-cassandra.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cassandra-driver==3.20.2
cassandra-driver>=3.20.2
mock>=2.0.0
nose>=1.0
pytest>=4.6
Expand Down

0 comments on commit d143140

Please sign in to comment.