Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Unable to run on JVM 7 #84

Open
bitmori opened this issue Apr 6, 2017 · 5 comments
Open

Unable to run on JVM 7 #84

bitmori opened this issue Apr 6, 2017 · 5 comments

Comments

@bitmori
Copy link

bitmori commented Apr 6, 2017

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 bitmori changed the title Unable to run on JDK 7 Unable to run on JVM 7 Apr 6, 2017
@erikmcc
Copy link
Contributor

erikmcc commented Apr 7, 2017

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.

@codefromthecrypt
Copy link

codefromthecrypt commented Apr 8, 2017 via email

@henrylawson
Copy link

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?

@ubschmidt2
Copy link

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.

@henrylawson
Copy link

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);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants