cloud-trace-java icon indicating copy to clipboard operation
cloud-trace-java copied to clipboard

Unable to run on JVM 7

Open bitmori opened this issue 8 years ago • 5 comments

In TraceGrpcApiService constructor, it explicitly use JavaTimestampFactory which uses java.time.Instant which is introduced since JDK8 and there is no easy way to replace it with jodaTimestampFactory.

bitmori avatar Apr 06 '17 20:04 bitmori

This was a convenience implementation for what we believed would be the most common implementation options. It's probably easy enough to fork this code and make a service that uses the desired timestamp factory. But we could also provide an option or an override for the JodaTimestampFactory. We'll accept pull requests for this, if anyone is interested.

erikmcc avatar Apr 07 '17 20:04 erikmcc

You mean someone has asked to run the server on JVM 7?

On 8 Apr 2017 4:41 am, "Erik McClenney" [email protected] wrote:

This was a convenience implementation for what we believed would be the most common implementation options. It's probably easy enough to fork this code and make a service that uses the desired timestamp factory. But we could also provide an option or an override for the JodaTimestampFactory. We'll accept pull requests for this, if anyone is interested.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/cloud-trace-java/issues/84#issuecomment-292646245, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD61xiemBdoHm1C_lPo-cxuAq0iH8uaks5rtp9fgaJpZM4M2G_5 .

codefromthecrypt avatar Apr 08 '17 00:04 codefromthecrypt

App Engine Standard only supports JVM 7.

Can this SDK be used with App Engine Standard? What are the alternatives for implementing custom trace spans for App Engine Standard?

henrylawson avatar May 17 '17 11:05 henrylawson

Ah, I see. App Engine Standard Environment is actually supported through https://github.com/GoogleCloudPlatform/cloud-trace-java/tree/master/services/appengine-standard-service. Just make sure that this dependency is on the classpath at runtime (and none of the other service implementations from https://github.com/GoogleCloudPlatform/cloud-trace-java/tree/master/services is).

The gRPC-based client doesn't work in the current App Engine Standard environment.

ubschmidt2 avatar May 22 '17 20:05 ubschmidt2

Thanks! The README focuses on the gRPC client. So wasn't clear there was another lib for standard.

For others who land here:

compile group: 'com.google.cloud.trace',    name: 'appengine-standard-service',      version: '0.3.2'
import com.google.cloud.trace.Tracer;
import com.google.cloud.trace.core.TraceContext;
import com.google.cloud.trace.service.AppEngineTraceService;

Tracer tracer = new AppEngineTraceService().getTracer();
TraceContext context = tracer.startSpan("test-span");
// ... code to trace here ...
tracer.endSpan(context);

henrylawson avatar May 23 '17 10:05 henrylawson