Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

PHP Agent is not collecting some Redis spans

php
infrastructure
redis
configuration

#1

Please share your agent version and other relevant versions below:

Agent version: 9.7.0.258

Please share your question/describe your issue below. Include any screenshots that may help us understand your question:

We’re using Redis extension for PHP (https://pecl.php.net/package/redis -> https://github.com/phpredis/phpredis) to handle our Redis IO. But we’re experiencing a problem in APM level due to miscollected spans.

I think that the agent is only collecting spans for small subset of Redis commands, and we can’t see any spans for Redis calls like;

  • lpop
  • rpush
  • scard
  • smembers
  • exists

etc.

We only see span data for simple calls like “set”, “del”, “connect”. Due to this we’re missing some critical metrics on our Redis-based implementations.

Could you please help us to figure out what’s wrong and maybe share more details about agents’ capability on Redis extension?

Side Note: We also have some other applications using https://github.com/nrk/predis instead of the extension and the span collection seems OK for them.


#2

Hello @tugca.eker, happy to dig into this with you! To start out I was hoping to get a permalink to the application in question, which can only be viewed by New Relic support outside of your account.

Thank you!


#3

Of course @ntierney

Here are some of our applications;

https://rpm.newrelic.com/accounts/2271475/applications/340206127
https://rpm.newrelic.com/accounts/2271475/applications/272924585
https://rpm.newrelic.com/accounts/2271475/applications/282214813
https://rpm.newrelic.com/accounts/2271475/applications/340205107
https://rpm.newrelic.com/accounts/2271475/applications/272914566
https://rpm.newrelic.com/accounts/2271475/applications/340206412


#4

@tugca.eker I went and compiled a list of the phpredis commands auto-instrumented by the Agent. For anything not on that list, you can use the newrelic_record_datastore_segment call included in the Agent API.

redis_connect
redis_pconnect
redis_open
redis_popen
redis_close
redis_select
redis_del
redis_delete
redis_get
redis_set
redis_setex
redis_setnx
redis_incr
redis_incrby
redis_decr
redis_decrby
redis_lset
redis_lget
redis_lrem
redis_lremove
redis_lindex
redis_hset
redis_hsetnx
redis_hget
redis_hmset
redis_hmget

#5

Thanks @scandela , it’s really nice to have the full list.

But IMHO this should be handled in agent level. I don’t see any reason why most commonly used commands like “lpop”, “rpush” are not being spanned by the agent. It should be really simple change in agent, for the next version (or am I missing smt ?:slight_smile: ).


#6

@tugca.eker I can’t speak to its difficulty, but we are always looking for ways to improve the product!

To raise visibility, you can submit a feature idea here, which allows other users to vote on it:
https://discuss.newrelic.com/c/feature-ideas/feature-ideas-php-agent