Skip to content

Provide plugin for Solr-7.x(client)#2730

Merged
wu-sheng merged 31 commits intoapache:masterfrom
dmsolr:solrj-plugin
Jun 5, 2019
Merged

Provide plugin for Solr-7.x(client)#2730
wu-sheng merged 31 commits intoapache:masterfrom
dmsolr:solrj-plugin

Conversation

@dmsolr
Copy link
Copy Markdown
Member

@dmsolr dmsolr commented May 22, 2019

Please answer these questions before submitting pull request

@wu-sheng wu-sheng requested review from IanCao and zhaoyuguang May 22, 2019 06:19
@wu-sheng wu-sheng added agent Language agent related. bug Something isn't working and you are sure it's a bug! feature New feature plugin Plugin for agent or collector. Be used to extend the capabilities of default implementor. TBD To be decided later, need more discussion or input. and removed bug Something isn't working and you are sure it's a bug! labels May 22, 2019
@wu-sheng
Copy link
Copy Markdown
Member

Waiting for the integration test pull request.

@coveralls
Copy link
Copy Markdown

coveralls commented May 22, 2019

Coverage Status

Coverage increased (+0.2%) to 17.185% when pulling f24d46c on dmsolr:solrj-plugin into 3217ff1 on apache:master.

.setLayer(SpanLayer.DB);
span.tag(SolrjTags.TAG_QT, params.get(CommonParams.QT, "/select"));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above codes include a lot of instanceof, which would be an impact for performance, especially in JRE 6-8. If possible, please consider a better way to do this.

Copy link
Copy Markdown
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inline

@SkyWalkingRobot
Copy link
Copy Markdown

Here is the test report and validate logs

@wu-sheng
Copy link
Copy Markdown
Member

@dmsolr The test fails, please make sure your local test passed.

@dmsolr
Copy link
Copy Markdown
Member Author

dmsolr commented May 23, 2019

I think that is why I committed the expected data of test cases that dosen't take effect.

I modified the tags' sequence.

@wu-sheng
Copy link
Copy Markdown
Member

I think that is why I committed the expected data of test cases that dosen't take effect.
I modified the tags' sequence.

The robot will use the latest commit of this and SkyAPMTest/agent-auto-integration-testcases#72 . What do you mean dosen't take effect.?

@wu-sheng wu-sheng removed the TBD To be decided later, need more discussion or input. label May 23, 2019
@dmsolr
Copy link
Copy Markdown
Member Author

dmsolr commented May 29, 2019

I talk with @wu-sheng about how to deal status of span in the afterMethod and handleMethodException.

  1. Skywalking care about performance very much.
  2. Interceptor will miss to trace customized Requests of SolrJ users.

So I decide to trace all of path.

Test Report - 2019-05-29 18:14

Cases List

Case description Status Cases
solrj 12 passed. 0 failed click me

@IanCao
Copy link
Copy Markdown
Contributor

IanCao commented May 31, 2019

inline

@dmsolr
Copy link
Copy Markdown
Member Author

dmsolr commented May 31, 2019

Hi @IanCao, I had resolved the checking conditions must be in pairs.
I will create the span anytime, so I think the re-checking conditions is ok in afterMethod().
How about you?

@SkyWalkingRobot
Copy link
Copy Markdown

Here is the test report and validate logs

@IanCao
Copy link
Copy Markdown
Contributor

IanCao commented May 31, 2019

Hi @IanCao, I had resolved the checking conditions must be in pairs.
I will create the span anytime, so I think the re-checking conditions is ok in afterMethod().
How about you?

yes.in my opinion , it's ok
and test passed

@IanCao
Copy link
Copy Markdown
Contributor

IanCao commented May 31, 2019

lgtm @wu-sheng

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.6</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need these three, L35-L37.

Copy link
Copy Markdown
Member

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need a little explanation about the tags, because from my understanding, SolrJ is the first plugin to set up its own tags. To be clear, new tags are not bad things, I just want to make sure we make things good, and keep SkyWalking in a good performance as always.

Could you brief about what these tags for? Clearly, it is not for analysis, because no backend codes will know that. Such as,

  1. Are these tags like SQL statement?
  2. Are these tags including parameters of each request?
  3. Do we have other choices to format these, such as format it as a JSON into DB_STATEMENT tag? The reason I asked this is because it will benefit from existing DB metrics and slow statement analysis.

You have already defined the SolrJ as DB layer, so for me, I think following the existing DB plugin tradition makes more sense.

Look forward to having your reply.

Copy link
Copy Markdown
Member

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, as a DB layer, you don't set DB_INSTANCE and DB_TYPE tags. These are important tags, with DB_STATEMENT in above comment.

@dmsolr
Copy link
Copy Markdown
Member Author

dmsolr commented May 31, 2019

Hi @wu-sheng ,

  • common tags:
  1. status : status of response.
  2. qtime : solr
  • query tags
  1. qt: Query Type - which Request Handler should handle the request.
  2. numFound : the numer of SolrDocuments returned from a search.
  3. db.statment: If it enable, span will trace the query parameters of query. (Default disable)
  • insert tags(/update/ADD)
  1. docsSize: the number of committed documents.
  2. commitWithin: the time horizon by which the document should be committed
  • delete tag(/update/DELETE_X)
  1. delete.by : deletes a list of documents by doc_id. (or deletes documents base on query)
  • commit tags (/update/COMMIT)
  1. softCommit : Performs an explicit commit, causing pending documents to be committed for indexing.
  • optimize tags (/update/OPTIMIZE)
  1. maxOptimizeSegs : optimizes down to at most this number of segments

On commit/optimize request,maybe need to trace waitFLush and waitSearch. They explain whether QTime is available.

About DB_INSTANCE, for solr, to get this is expensive and useless.
About db.statement, it will be encode by URLEncoder. I have not idea whether to decode it.

image

image

image

@wu-sheng
Copy link
Copy Markdown
Member

@dmsolr I just read your reply again, here is my reply

status : status of response.

Why this status doesn't match span status? Which values of these status?

qtime : solr

Why doesn't this match the span duration? If this represents target(solr server) duration, we should have solr server trace in next step, right? Then we still don't need this.

docsSize
commitWithin
softCommit
delete.by
softCommit
maxOptimizeSegs
waitFLush
waitSearch

All these are either execution results or parameters. In my mind, all these should only be tagged when the user explicitly opens it. Add config item to Config#Plugin#SolrJ.
Because all these String tags cost a lot of network and storage.

For URLEncoder, it is a very simple encode OP, you could easily decode it. Just google it :) I think that perfectly match the statement.

And in your example, could you tell me, what does mycore mean? Look like your operation name include it.


Out of the above context, my other question is, what is purpose and benefit to provide Solr server plugin.
Thinking in these ways

  1. We have no intention to improve solr server performance.
  2. We analysis database performance based on client(Exist Span), read `MultiScopesSpanListener#L162). It will be confusing, both service metrics and database metrics dashboards showing with different names. Service dashboard shows agent config service_code, database dashboards show based on client(solrJ) peer.

The point is, I hope we could focus on APM, and don't get user confused.

@dmsolr
Copy link
Copy Markdown
Member Author

dmsolr commented Jun 3, 2019

@wu-sheng , I am sorry to reply so late.

Why this status doesn't match span status? Which values of these status?

It looks like http status. But it uses 0 instead of 2xx and uses 500 instead of less than 100.

Why doesn't this match the span duration? If this represents target(solr server) duration, we should have solr server trace in next step, right? Then we still don't need this.

Yes. It represents elapsed time on server side. It exclude http, de/en-serialized time-consuming.

And in your example, could you tell me, what does mycore mean? Look like your operation name include it.

That likes table name in SQL. It consist of shards and replicas. If the request sends to the specified sharding, the operation name will use sharding name( it names collectionName_shardingNum_replicaNum). However collection name will be contained. So it can be removed.

About docsSize, delete.by.

I think they are useful. delete.by likes deleting statement in SQL. I will move it to db.statement. docsSize represents the number of effected rows in the upserting.

commitWithin, softCommit, maxOptimizeSegs

They may not be useful for single request analysis, but they let us know what is done to the server and what state the server is in. But for caller, they are really useless. For me, a ops of solr, they are a bit important. So they are opened through config.

if (result != null) {
NamedList<Object> header = (NamedList<Object>) result.get("responseHeader");
if (header != null) {
span.tag(SolrjTags.TAG_STATUS, String.valueOf(header.get("status")));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By following your explanation, this tag value should work with span#errorOccurred together.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok.

@wu-sheng
Copy link
Copy Markdown
Member

wu-sheng commented Jun 3, 2019

@dmsolr Most are good to me, just one change required.

@dmsolr
Copy link
Copy Markdown
Member Author

dmsolr commented Jun 3, 2019

Test Report - 2019-06-03 19:58

Cases List

Case description Status Cases
solrj 12 passed. 0 failed click me

@SkyWalkingRobot
Copy link
Copy Markdown

Here is the test report and validate logs

Copy link
Copy Markdown
Member

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the config to document of setup

Copy link
Copy Markdown
Member

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @ascrutae Recheck?

@wu-sheng wu-sheng merged commit 6ae5174 into apache:master Jun 5, 2019
@dmsolr dmsolr mentioned this pull request Jun 17, 2019
3 tasks
@SkyWalkingRobot
Copy link
Copy Markdown

Here is the test report and validate logs

@dmsolr dmsolr deleted the solrj-plugin branch July 16, 2019 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Language agent related. feature New feature plugin Plugin for agent or collector. Be used to extend the capabilities of default implementor.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants