Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ Release Notes.
* [Breaking Change] Compatible with 3.x and 4.x RabbitMQ Client, rename `rabbitmq-5.x-plugin` to `rabbitmq-plugin`
* Polish JDBC plugins to make DBType accurate
* Report the agent version to OAP as an instance attribute
* Polish jedis-4.x-plugin to change command to lowercase, which is consistent with jedis-2.x-3.x-plugin
* Add micronauthttpclient,micronauthttpserver,memcached,ehcache,guavacache,jedis,redisson plugin config properties to agent.config

#### Documentation

* Update `Plugin-test.md`, support string operators `start with` and `end with`
* Polish agent configurations doc to fix type error



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public abstract class AbstractConnectionInterceptor implements InstanceMethodsAroundInterceptor {

private static final String UNKNOWN = "UNKNOWN";
private static final String UNKNOWN = "unknown";

private static final String CACHE_TYPE = "Redis";

Expand All @@ -46,7 +46,9 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
if (iterator.hasNext()) {
protocolCommand = iterator.next().toString();
}
String cmd = protocolCommand == null ? UNKNOWN : protocolCommand;
// Use lowercase to make config compatible with jedis-2.x-3.x plugin
// Refer to `plugin.jedis.operation_mapping_read`, `plugin.jedis.operation_mapping_write` config item in agent.config
String cmd = protocolCommand == null ? UNKNOWN : protocolCommand.toLowerCase();
String peer = String.valueOf(objInst.getSkyWalkingDynamicField());
AbstractSpan span = ContextManager.createExitSpan("Jedis/" + cmd, peer);
span.setComponent(ComponentsDefine.JEDIS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,66 +50,66 @@ public static class Jedis {
* @see AbstractConnectionInterceptor#parseOperation(String)
*/
public static Set<String> OPERATION_MAPPING_WRITE = new HashSet<>(Arrays.asList(
"GETSET",
"SET",
"SETBIT",
"SETEX ",
"SETNX ",
"SETRANGE",
"STRLEN ",
"MSET",
"MSETNX ",
"PSETEX",
"INCR ",
"INCRBY ",
"INCRBYFLOAT",
"DECR ",
"DECRBY ",
"APPEND ",
"HMSET",
"HSET",
"HSETNX ",
"HINCRBY",
"HINCRBYFLOAT",
"HDEL",
"RPOPLPUSH",
"RPUSH",
"RPUSHX",
"LPUSH",
"LPUSHX",
"LREM",
"LTRIM",
"LSET",
"BRPOPLPUSH",
"LINSERT",
"SADD",
"SDIFF",
"SDIFFstore",
"SINTERSTORE",
"SISMEMBER",
"SREM",
"SUNION",
"SUNIONSTORE",
"SINTER",
"ZADD",
"ZINCRBY",
"ZINTERSTORE",
"ZRANGE",
"ZRANGEBYLEX",
"ZRANGEBYSCORE",
"ZRANK",
"ZREM",
"ZREMRANGEBYLEX",
"ZREMRANGEBYRANK",
"ZREMRANGEBYSCORE",
"ZREVRANGE",
"ZREVRANGEBYSCORE",
"ZREVRANK",
"ZUNIONSTORE",
"XADD",
"XDEL",
"DEL",
"XTRIM"
"getset",
"set",
"setbit",
"setex ",
"setnx ",
"setrange",
"strlen ",
"mset",
"msetnx ",
"psetex",
"incr ",
"incrby ",
"incrbyfloat",
"decr ",
"decrby ",
"append ",
"hmset",
"hset",
"hsetnx ",
"hincrby",
"hincrbyfloat",
"hdel",
"rpoplpush",
"rpush",
"rpushx",
"lpush",
"lpushx",
"lrem",
"ltrim",
"lset",
"brpoplpush",
"linsert",
"sadd",
"sdiff",
"sdiffstore",
"sinterstore",
"sismember",
"srem",
"sunion",
"sunionstore",
"sinter",
"zadd",
"zincrby",
"zinterstore",
"zrange",
"zrangebylex",
"zrangebyscore",
"zrank",
"zrem",
"zremrangebylex",
"zremrangebyrank",
"zremrangebyscore",
"zrevrange",
"zrevrangebyscore",
"zrevrank",
"zunionstore",
"xadd",
"xdel",
"del",
"xtrim"
));
/**
* Operation represent a cache span is "write" or "read" action , and "op"(operation) is tagged with key "cache.op" usually
Expand All @@ -118,40 +118,40 @@ public static class Jedis {
* @see org.apache.skywalking.apm.agent.core.context.tag.Tags#CACHE_OP
* @see AbstractConnectionInterceptor#parseOperation(String)
*/
public static Set<String> OPERATION_MAPPING_READ = new HashSet<>(Arrays.asList("GET",
"GETRANGE",
"GETBIT ",
"MGET",
"HVALS",
"HKEYS",
"HLEN",
"HEXISTS",
"HGET",
"HGETALL",
"HMGET",
"BLPOP",
"BRPOP",
"LINDEX",
"LLEN",
"LPOP",
"LRANGE",
"RPOP",
"SCARD",
"SRANDMEMBER",
"SPOP",
"SSCAN",
"SMOVE",
"ZLEXCOUNT",
"ZSCORE",
"ZSCAN",
"ZCARD",
"ZCOUNT",
"XGET",
"GET",
"XREAD",
"XLEN",
"XRANGE",
"XREVRANGE"
public static Set<String> OPERATION_MAPPING_READ = new HashSet<>(Arrays.asList("get",
"getrange",
"getbit ",
"mget",
"hvals",
"hkeys",
"hlen",
"hexists",
"hget",
"hgetall",
"hmget",
"blpop",
"brpop",
"lindex",
"llen",
"lpop",
"lrange",
"rpop",
"scard",
"srandmember",
"spop",
"sscan",
"smove",
"zlexcount",
"zscore",
"zscan",
"zcard",
"zcount",
"xget",
"get",
"xread",
"xlen",
"xrange",
"xrevrange"
));

}
Expand Down
28 changes: 28 additions & 0 deletions apm-sniffer/config/agent.config
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,31 @@ plugin.neo4j.cypher_parameters_max_length=${SW_PLUGIN_NEO4J_CYPHER_PARAMETERS_MA
plugin.neo4j.cypher_body_max_length=${SW_PLUGIN_NEO4J_CYPHER_BODY_MAX_LENGTH:2048}
# If set to a positive number and activate `trace sampler CPU policy plugin`, the trace would not be collected when agent process CPU usage percent is greater than `plugin.cpupolicy.sample_cpu_usage_percent_limit`.
plugin.cpupolicy.sample_cpu_usage_percent_limit=${SW_SAMPLE_CPU_USAGE_PERCENT_LIMIT:-1}
# This config item controls that whether the Micronaut http client plugin should collect the parameters of the request. Also, activate implicitly in the profiled trace.
plugin.micronauthttpclient.collect_http_params=${SW_PLUGIN_MICRONAUTHTTPCLIENT_COLLECT_HTTP_PARAMS:false}
# This config item controls that whether the Micronaut http server plugin should collect the parameters of the request. Also, activate implicitly in the profiled trace.
plugin.micronauthttpserver.collect_http_params=${SW_PLUGIN_MICRONAUTHTTPSERVER_COLLECT_HTTP_PARAMS:false}
# Specify which command should be converted to write operation
plugin.memcached.operation_mapping_write=${SW_PLUGIN_MEMCACHED_OPERATION_MAPPING_WRITE:set,add,replace,append,prepend,cas,delete,touch,incr,decr}
# Specify which command should be converted to read operation
plugin.memcached.operation_mapping_read=${SW_PLUGIN_MEMCACHED_OPERATION_MAPPING_READ:get,gets,getAndTouch,getKeys,getKeysWithExpiryCheck,getKeysNoDuplicateCheck}
# Specify which command should be converted to write operation
plugin.ehcache.operation_mapping_write=${SW_PLUGIN_EHCACHE_OPERATION_MAPPING_WRITE:tryRemoveImmediately,remove,removeAndReturnElement,removeAll,removeQuiet,removeWithWriter,put,putAll,replace,removeQuiet,removeWithWriter,removeElement,removeAll,putWithWriter,putQuiet,putIfAbsent,putIfAbsent}
# Specify which command should be converted to read operation
plugin.ehcache.operation_mapping_read=${SW_PLUGIN_EHCACHE_OPERATION_MAPPING_READ:get,getAll,getQuiet,getKeys,getKeysWithExpiryCheck,getKeysNoDuplicateCheck,releaseRead,tryRead,getWithLoader,getAll,loadAll,getAllWithLoader}
# Specify which command should be converted to write operation
plugin.guavacache.operation_mapping_write=${SW_PLUGIN_GUAVACACHE_OPERATION_MAPPING_WRITE:put,putAll,invalidate,invalidateAll,invalidateAll,cleanUp}
# Specify which command should be converted to read operation
plugin.guavacache.operation_mapping_read=${SW_PLUGIN_GUAVACACHE_OPERATION_MAPPING_READ:getIfPresent,get,getAllPresent,size}
# If set to true, the parameters of Redis commands would be collected by Jedis agent.
plugin.jedis.trace_redis_parameters=${SW_PLUGIN_JEDIS_TRACE_REDIS_PARAMETERS:false}
# If set to positive number and plugin.jedis.trace_redis_parameters is set to true, Redis command parameters would be collected and truncated to this length.
plugin.jedis.redis_parameter_max_length=${SW_PLUGIN_JEDIS_REDIS_PARAMETER_MAX_LENGTH:128}
# Specify which command should be converted to write operation
plugin.jedis.operation_mapping_write=${SW_PLUGIN_JEDIS_OPERATION_MAPPING_WRITE:getset,set,setbit,setex,setnx,setrange,strlen,mset,msetnx,psetex,incr,incrby,incrbyfloat,decr,decrby,append,hmset,hset,hsetnx,hincrby,hincrbyfloat,hdel,rpoplpush,rpush,rpushx,lpush,lpushx,lrem,ltrim,lset,brpoplpush,linsert,sadd,sdiff,sdiffstore,sinterstore,sismember,srem,sunion,sunionstore,sinter,zadd,zincrby,zinterstore,zrange,zrangebylex,zrangebyscore,zrank,zrem,zremrangebylex,zremrangebyrank,zremrangebyscore,zrevrange,zrevrangebyscore,zrevrank,zunionstore,xadd,xdel,del,xtrim}
# Specify which command should be converted to read operation
plugin.jedis.operation_mapping_read=${SW_PLUGIN_JEDIS_OPERATION_MAPPING_READ:getrange,getbit,mget,hvals,hkeys,hlen,hexists,hget,hgetall,hmget,blpop,brpop,lindex,llen,lpop,lrange,rpop,scard,srandmember,spop,sscan,smove,zlexcount,zscore,zscan,zcard,zcount,xget,get,xread,xlen,xrange,xrevrange}
# If set to true, the parameters of Redis commands would be collected by Redisson agent.
plugin.redisson.trace_redis_parameters=${SW_PLUGIN_REDISSON_TRACE_REDIS_PARAMETERS:false}
# If set to positive number and plugin.redisson.trace_redis_parameters is set to true, Redis command parameters would be collected and truncated to this length.
plugin.redisson.redis_parameter_max_length=${SW_PLUGIN_REDISSON_REDIS_PARAMETER_MAX_LENGTH:128}
Loading