[ 
https://issues.apache.org/jira/browse/HIVE-19685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Todd Lipcon updated HIVE-19685:
-------------------------------
    Assignee: Todd Lipcon
      Status: Patch Available  (was: Open)

Attached patch does the most basic integration here. It instruments the Thrift 
protocol so that it propagates traces from clients and creates spans around the 
thrift calls themselves.

Using opentracing's JDBC driver you can also get the query traces "for free".

Here's a set of steps you can use to try it out:

1. Build the metastore as normal
2. cd into the bin/ target directory

{code}
mvn dependency:get -Dartifact=io.jaegertracing:jaeger-tracerresolver:0.27.0 
-Ddest=lib/
mvn dependency:get -Dartifact=io.jaegertracing:jaeger-core:0.27.0 -Ddest=lib/
mvn dependency:get -Dartifact=io.jaegertracing:jaeger-thrift:0.27.0 -Ddest=lib/
mvn dependency:get -Dartifact=io.opentracing.contrib:opentracing-jdbc:0.0.6 
-Ddest=lib/

export JAEGER_SERVICE_NAME=hms
export JAEGER_AGENT_HOST=localhost
export JAEGER_AGENT_PORT=6831
export JAEGER_REPORTER_LOG_SPANS=1
export JAEGER_REPORTER_FLUSH_INTERVAL=1000
export JAEGER_SAMPLER_TYPE=const
export JAEGER_SAMPLER_PARAM=1

 docker run -d -e \
  COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
  -p 5775:5775/udp \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 14268:14268 \
  -p 9411:9411 \
  jaegertracing/all-in-one:latest

./bin/schematool -initSchema -dbType derby
bin/start-metastore  \
  -hiveconf 
'javax.jdo.option.ConnectionURL=jdbc:tracing:derby:;databaseName=metastore_db;create=true'
 \ 
  -hiveconf 
javax.jdo.option.ConnectionDriverName=io.opentracing.contrib.jdbc.TracingDriver
{code}

If you navigate to http://localhost:16686 you should see the jaeger UI. You can 
then run some thrift calls against the HMS and you should see the resulting 
traces.

I wasn't sure if it was worth adding explicit new unit tests for this. If you 
think so, let me know. There is some kind of MockTracer implementation we could 
use for testing.

> OpenTracing support for HMS
> ---------------------------
>
>                 Key: HIVE-19685
>                 URL: https://issues.apache.org/jira/browse/HIVE-19685
>             Project: Hive
>          Issue Type: New Feature
>          Components: Metastore
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>            Priority: Major
>         Attachments: hive-19685.patch, trace.png
>
>
> When diagnosing performance of metastore operations it isn't always obvious 
> why something took a long time. Using a tracing framework can provide an 
> end-to-end view of an operation including time spent in dependent systems (eg 
> filesystem operations, RDBMS queries, etc). This JIRA proposes to integrate 
> OpenTracing, which is a vendor-neutral tracing API into the HMS server and 
> client.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to