Skip to content

Commit

Permalink
fix(otel-node): resolve lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
david-luna committed Jan 21, 2025
1 parent 2d48792 commit efcb693
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ async function main() {
});

await client.connect();
await client.execute(`CREATE KEYSPACE IF NOT EXISTS ${keyspace} WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': 1 };`);
await client.execute(
`CREATE KEYSPACE IF NOT EXISTS ${keyspace} WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': 1 };`
);
await client.execute(`USE ${keyspace}`);
await client.execute(`CREATE TABLE IF NOT EXISTS ${keyspace}.${table}(id uuid,text varchar,PRIMARY KEY(id));`);
await client.execute(
`CREATE TABLE IF NOT EXISTS ${keyspace}.${table}(id uuid,text varchar,PRIMARY KEY(id));`
);
await client.batch([
{
query: `INSERT INTO ${keyspace}.${table} (id, text) VALUES (uuid(), ?)`,
params: ['value1']
params: ['value1'],
},
{
query: `INSERT INTO ${keyspace}.${table} (id, text) VALUES (uuid(), ?)`,
params: ['value2']
}
params: ['value2'],
},
]);
await client.execute(`DROP TABLE IF EXISTS ${keyspace}.${table}`);
await client.shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

const test = require('tape');
const { filterOutDnsNetSpans, runTestFixtures } = require('./testutils');
const {filterOutDnsNetSpans, runTestFixtures} = require('./testutils');

// TODO: check https://github.com/elastic/apm-agent-nodejs/blob/main/test/_is_cassandra_incompat.js
const skip = process.env.CASSANDRA_HOST === undefined;
Expand Down Expand Up @@ -55,7 +55,10 @@ const testFixtures = [
t.equal(s.traceId, spans[0].traceId, 'traceId');
t.equal(s.parentSpanId, spans[0].spanId, 'parentSpanId');
t.equal(s.kind, 'SPAN_KIND_CLIENT', 'kind');
t.equal(s.scope.name, '@opentelemetry/instrumentation-cassandra-driver');
t.equal(
s.scope.name,
'@opentelemetry/instrumentation-cassandra-driver'
);
t.equal(s.attributes['db.system'], 'cassandra');
});
t.equal(spans[1].name, 'cassandra-driver.execute');
Expand All @@ -67,7 +70,7 @@ const testFixtures = [
},
];

test('cassandra-driver instrumentation', { skip }, (suite) => {
test('cassandra-driver instrumentation', {skip}, (suite) => {
runTestFixtures(suite, testFixtures);
suite.end();
});
1 change: 1 addition & 0 deletions packages/opentelemetry-node/types/instrumentations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type InstrumentaionsMap = {
"@opentelemetry/instrumentation-aws-sdk": import('@opentelemetry/instrumentation-aws-sdk').AwsSdkInstrumentationConfig | InstrumentationFactory;
"@opentelemetry/instrumentation-bunyan": import('@opentelemetry/instrumentation-bunyan').BunyanInstrumentationConfig | InstrumentationFactory;
"@opentelemetry/instrumentation-connect": import('@opentelemetry/instrumentation').InstrumentationConfig | InstrumentationFactory;
"@opentelemetry/instrumentation-cassandra-driver": import('@opentelemetry/instrumentation-cassandra-driver').CassandraDriverInstrumentation | InstrumentationFactory;
"@opentelemetry/instrumentation-cucumber": import('@opentelemetry/instrumentation-cucumber').CucumberInstrumentationConfig | InstrumentationFactory;
"@opentelemetry/instrumentation-dataloader": import('@opentelemetry/instrumentation-dataloader').DataloaderInstrumentationConfig | InstrumentationFactory;
"@opentelemetry/instrumentation-dns": import('@opentelemetry/instrumentation-dns').DnsInstrumentationConfig | InstrumentationFactory;
Expand Down

0 comments on commit efcb693

Please sign in to comment.