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

Add a test assertion in ioredis that asserts the instance metrics #2228

Closed
bizob2828 opened this issue May 29, 2024 · 1 comment · Fixed by #2230
Closed

Add a test assertion in ioredis that asserts the instance metrics #2228

bizob2828 opened this issue May 29, 2024 · 1 comment · Fixed by #2230
Assignees
Labels
points: 3 A few days

Comments

@bizob2828
Copy link
Member

Description

We're missing a test assertion for Datastore/instance/Redis/<host>/<port> in ioredis versioned tests. This metric is going to be needed to link APM entities to AWS elasticache.

Additional context

This test should have the metric

  t.test('creates expected metrics', { timeout: 5000 }, (t) => {
    t.plan(6)
    agent.on('transactionFinished', function (tx) {
      const expected = [
        [{ name: 'Datastore/all' }],
        [{ name: 'Datastore/Redis/all' }],
        [{ name: 'Datastore/operation/Redis/set' }]
      ]

      t.assertMetrics(tx.metrics, expected, false, false)
      t.end()
    })

    helper.runInTransaction(agent, (transaction) => {
      redisClient
        .set('testkey', 'testvalue')
        .then(function () {
          transaction.end()
        }, t.error)
        .catch(t.error)
    })
  })

If not, we need to fix the instrumentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
points: 3 A few days
Projects
Archived in project
1 participant