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

PHOENIX-4817 Fixed Phoenix Tracing Web Application #311

Closed
wants to merge 4 commits into from
Closed

PHOENIX-4817 Fixed Phoenix Tracing Web Application #311

wants to merge 4 commits into from

Conversation

MrSandmanRUS
Copy link
Contributor

Fixed check null, trace table name, webapp path, column names. Fixed traceserver.py

…name, webapp path, column names). Fixed traceserver.py
@MrSandmanRUS
Copy link
Contributor Author

Fixed Phoenix Tracing Web Application, fixed traceserver.py

@MrSandmanRUS MrSandmanRUS changed the title Fixed Phoenix Tracing Web Application PHOENIX-4817 Fixed Phoenix Tracing Web Application Jul 18, 2018
@@ -116,8 +116,10 @@

# " -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n " + \
# " -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true" + \
java_cmd = '%(java)s $PHOENIX_OPTS ' + \
'-cp ' + hbase_config_path + os.pathsep + phoenix_utils.phoenix_traceserver_jar + os.pathsep + phoenix_utils.phoenix_client_jar + \
java_cmd = '%(java)s ' + \
Copy link
Member

Choose a reason for hiding this comment

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

Seems like $PHOENIX_OPTS was dropped. Was this not being interpolated correctly? Is this environment variable propagated into the traceserver java process?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://issues.apache.org/jira/browse/PHOENIX-2659
I think it's your comment:
"Josh Elser added a comment - 12/Feb/16 03:23
ok, PHOENIX_OPTS isn't working because subprocess isn't popping a shell like sqlline does. It will automatically get added to PQS's environment already. We can just remove that.
Steve is spot-on for the argument parsing. It's just busted."
So, I just remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All in all, when I remove it, the server successfully starts and works correctly.

Copy link
Member

Choose a reason for hiding this comment

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

The issue is that subprocess doesn't handle shell variable expansion "in the command". Subprocess has API to provide an environment to the process being run.

$PHOENIX_OPTS and $PHOENIX_TRACESERVER_OPTS should be placed into the subprocess's environment, not just dropped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I need to add something like this?

phoenix_opts= os.getenv('PHOENIX_OPTS', '')
......
if hbase_env.has_key('PHOENIX_OPTS'):
phoenix_opts= hbase_env['PHOENIX_OPTS']
.....
java_cmd = '%(java)s ' + phoenix_opts +
....

Copy link
Member

Choose a reason for hiding this comment

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

Actually, looks like queryserver.py doesn't include $PHOENIX_OPTS so let's just leave that to clients. $PHOENIX_TRACESERVER_OPTS is inlined, so you're good. Sorry for the confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, thank you

ProtectionDomain domain = Main.class.getProtectionDomain();
URL location = domain.getCodeSource().getLocation();
String webappDirLocation = location.toString().split("target")[0] +"src/main/webapp";
String webappDirLocation = DEFAULT_WEBAPP_DIR_LOCATION;
Copy link
Member

Choose a reason for hiding this comment

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

Suggest dropping webappDirLocation and just using DEFAULT_WEBAPP_DIR_LOCATION since this is not configurable anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


@Override
public void init() {
org.apache.hadoop.conf.Configuration conf = HBaseConfiguration.create();
Copy link
Member

Choose a reason for hiding this comment

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

Import org.apache.hadoop.conf.Configuration please.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}
if(!logic.equals(LOGIC_AND) || !logic.equals(LOGIC_OR)) {
throw new RuntimeException("Wrong logical operator passed to the query. Only "+ LOGIC_AND+","+LOGIC_OR+" are allowed.") ;
if (logic != null && (!logic.equals(LOGIC_AND) && !logic.equals(LOGIC_OR))) {
Copy link
Member

Choose a reason for hiding this comment

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

Parenthesis around (!logic.equals(LOGIC_AND) && !logic.equals(LOGIC_OR)) are unnecessary, please drop them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@SiCheng-Zheng
Copy link

SiCheng-Zheng commented Jul 20, 2018

traceserver.py start NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet

2018-07-20 18-33-36
@MrSandmanRUS

@MrSandmanRUS
Copy link
Contributor Author

It's ok, just info message, try to open localhost:8864
@mygood

@SiCheng-Zheng
Copy link

SiCheng-Zheng commented Jul 20, 2018

Tracing List is ok but Trace Count Chart Graph
Request URL: http://192.168.178.31:8864/trace/?action=getCount
Request Method: GET
Status Code: 500 Unknown tracename: description
image
see trace log
image
@MrSandmanRUS

@MrSandmanRUS
Copy link
Contributor Author

MrSandmanRUS commented Jul 20, 2018

Can you show me your trace table? Column “description” is standard column of this table, if you start tracing via hbase-site.xml
@mygood

@SiCheng-Zheng
Copy link

SiCheng-Zheng commented Jul 20, 2018

hbase-site.xml default SYSTEM.TRACING_STATS
CREATE TABLE SYSTEM.TRACING_STATS (
trace_id BIGINT NOT NULL,
parent_id BIGINT NOT NULL,
span_id BIGINT NOT NULL,
description VARCHAR,
start_time BIGINT,
end_time BIGINT,
hostname VARCHAR,
tags.count SMALLINT,
annotations.count SMALLINT,
CONSTRAINT pk PRIMARY KEY (trace_id, parent_id, span_id)
)
Phoenix Tracing List
image
Is it caused by this problem? NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet

@MrSandmanRUS

@MrSandmanRUS
Copy link
Contributor Author

MrSandmanRUS commented Jul 20, 2018

You use version from apache phoenix, I fixed this bug and some others, just compile my sources
@mygood

@SiCheng-Zheng
Copy link

apache-phoenix-4.11.0-HBase-1.1-bin 、hadoop-2.7.1
@MrSandmanRUS

@MrSandmanRUS
Copy link
Contributor Author

MrSandmanRUS commented Jul 20, 2018

It's ok, clone my branch and compile only web application, then rename jars for your version, then replace it with web application phoenix jars
@mygood

@SiCheng-Zheng
Copy link

Thank you very much for the problem.

@MrSandmanRUS

@SiCheng-Zheng
Copy link

You use version from apache phoenix 、hbase 、hadoop
@MrSandmanRUS

@MrSandmanRUS
Copy link
Contributor Author

Yes
@mygood

@SiCheng-Zheng
Copy link

I have a problem that the data does not into SYSTEM.TRACING_STATS
0: jdbc:phoenix:localhost:2181:/hbase> trace on;
+----------------------+
| trace_id |
+----------------------+
| 2701156331755118993 |
+----------------------+
1 row selected (0.001 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> upsert into T(a,b) values(2,2);
1 row affected (0.015 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> trace off;
+----------------------+
| trace_id |
+----------------------+
| 2701156331755118993 |
+----------------------+
1 row selected (0.001 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> trace off;
+-----------+
| trace_id |
+-----------+
+-----------+
No rows selected (0 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> select * from SYSTEM.TRACING_STATS where trace_id=2701156331755118993;
+-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+
| TRACE_ID | PARENT_ID | SPAN_ID | DESCRIPTION | START_TIME | END_TIME | HOSTNAME | COUNT | COUNT |
+-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+
+-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+
No rows selected (0.109 seconds)
0: jdbc:phoenix:localhost:2181:/hbase> select * from SYSTEM.TRACING_STATS;
+-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+
| TRACE_ID | PARENT_ID | SPAN_ID | DESCRIPTION | START_TIME | END_TIME | HOSTNAME | COUNT | COUNT |
+-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+
| 2 | 2 | 2 | upsert | 20180720 | 20180721 | host1 | 20 | 30 |
| 3 | 3 | 3 | upsert | 20180720 | 20180721 | host1 | 10 | 30 |
+-----------+------------+----------+--------------+-------------+-----------+-----------+--------+--------+
2 rows selected (0.098 seconds)
@MrSandmanRUS

@MrSandmanRUS
Copy link
Contributor Author

MrSandmanRUS commented Jul 25, 2018

Add to hbase-site.xml:

phoenix.trace.enabled
true

@mygood

asfgit pushed a commit that referenced this pull request Jul 25, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Jul 25, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
@asfgit asfgit closed this in 6b363b3 Jul 25, 2018
asfgit pushed a commit that referenced this pull request Jul 25, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Jul 29, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Aug 3, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Aug 3, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Aug 3, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Aug 3, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Aug 3, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Aug 3, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Oct 17, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Oct 17, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Oct 17, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Oct 17, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
asfgit pushed a commit that referenced this pull request Oct 17, 2018
… trace table name, webapp path, column names) and traceserver.py

Closes #311

Signed-off-by: Josh Elser <elserj@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants