opentracing: Disable the fetch jaeger traces feature
With latest targets, the opentracing.ui module would not load because
javax.xml.bind comes from 2 dependency chains. So removing the
javax.ws.rs chain (the one necessary to fetch jaeger traces) fixes the
problem, until the javax.xml.bind package is upgraded in orbit.
Change-Id: Ib8933891fc737be64d5e498609583622048e3d23
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/155883
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/META-INF/MANIFEST.MF b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/META-INF/MANIFEST.MF
index 631ee18..ef1b335 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/META-INF/MANIFEST.MF
+++ b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/META-INF/MANIFEST.MF
@@ -26,8 +26,6 @@
Import-Package: com.google.common.collect,
com.google.gson,
com.google.gson.stream,
- javax.ws.rs.client,
- javax.ws.rs.core,
org.apache.commons.compress.utils,
org.apache.commons.lang3
Automatic-Module-Name: org.eclipse.tracecompass.incubator.opentracing.ui
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/FetchJaegerTraceWizard.java b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/FetchJaegerTraceWizard.java
index 8e3e386..58a46af 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/FetchJaegerTraceWizard.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/FetchJaegerTraceWizard.java
@@ -21,24 +21,25 @@
*/
public class FetchJaegerTraceWizard extends Wizard implements IImportWizard {
- private IStructuredSelection fSelection;
- private FetchJaegerTracesWizardPage fPage;
+// private IStructuredSelection fSelection;
+ private FetchJaegerTracesNotAvailableWizardPage fPage;
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
- fSelection = selection;
+// fSelection = selection;
setWindowTitle(Messages.FetchJaegerTraceWizard_wizardTitle);
}
@Override
public boolean performFinish() {
- return fPage.performFinish();
+ return true;
+// return fPage.performFinish();
}
@Override
public void addPages() {
super.addPages();
- fPage = new FetchJaegerTracesWizardPage(fSelection);
+ fPage = new FetchJaegerTracesNotAvailableWizardPage();
addPage(fPage);
}
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/FetchJaegerTracesNotAvailableWizardPage.java b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/FetchJaegerTracesNotAvailableWizardPage.java
new file mode 100644
index 0000000..ef7963b
--- /dev/null
+++ b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/FetchJaegerTracesNotAvailableWizardPage.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2019 École Polytechnique de Montréal
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.incubator.internal.opentracing.ui.project.wizards;
+
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * Temporary wizard page to tell users fetching jaeger traces is unavailable.
+ * The original feature should come back when the javax.xml.bind version is
+ * upgraded in orbit
+ *
+ * @author Geneviève Bastien
+ */
+public class FetchJaegerTracesNotAvailableWizardPage extends WizardPage {
+
+ /**
+ * Constructor
+ */
+ protected FetchJaegerTracesNotAvailableWizardPage() {
+ super(Messages.FetchJaegerTracesWizardPage_wizardPageName, Messages.FetchJaegerTracesWizardPage_wizardPageName, null);
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(GridLayoutFactory.swtDefaults().create());
+ composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
+
+ Label targetUrlLabel = new Label(composite, SWT.NONE);
+ targetUrlLabel.setText(Messages.FetchJaegerTracesWizardPage_importNotAvailable);
+
+ setControl(composite);
+ }
+
+}
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/JaegerRestUtils.java b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/JaegerRestUtils.java
index fcb8ed2..8c7f7f4 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/JaegerRestUtils.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/JaegerRestUtils.java
@@ -9,23 +9,6 @@
package org.eclipse.tracecompass.incubator.internal.opentracing.ui.project.wizards;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Invocation.Builder;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-
/**
* Jaeger REST utility class
*
@@ -33,22 +16,22 @@
*/
public class JaegerRestUtils {
- private static final String SERVICES_ENDPOINT = "services"; //$NON-NLS-1$
- private static final String TRACES_ENDPOINT = "traces"; //$NON-NLS-1$
-
- private static final String SERVICES_DATA_KEY = "data"; //$NON-NLS-1$
-
- /**
- * Parameters key for traces request
- */
- private static final String SEARCH_END_TIME = "end"; //$NON-NLS-1$
- private static final String NB_TRACES_LIMIT = "limit"; //$NON-NLS-1$
- private static final String LOOKBACK = "lookback"; //$NON-NLS-1$
- private static final String MAX_DURATION = "maxDuration"; //$NON-NLS-1$
- private static final String MIN_DURATION = "minDuration"; //$NON-NLS-1$
- private static final String SERVICE_NAME = "service"; //$NON-NLS-1$
- private static final String SEARCH_START_TIME = "start"; //$NON-NLS-1$
- private static final String TAGS = "tags"; //$NON-NLS-1$
+// private static final String SERVICES_ENDPOINT = "services"; //$NON-NLS-1$
+// private static final String TRACES_ENDPOINT = "traces"; //$NON-NLS-1$
+//
+// private static final String SERVICES_DATA_KEY = "data"; //$NON-NLS-1$
+//
+// /**
+// * Parameters key for traces request
+// */
+// private static final String SEARCH_END_TIME = "end"; //$NON-NLS-1$
+// private static final String NB_TRACES_LIMIT = "limit"; //$NON-NLS-1$
+// private static final String LOOKBACK = "lookback"; //$NON-NLS-1$
+// private static final String MAX_DURATION = "maxDuration"; //$NON-NLS-1$
+// private static final String MIN_DURATION = "minDuration"; //$NON-NLS-1$
+// private static final String SERVICE_NAME = "service"; //$NON-NLS-1$
+// private static final String SEARCH_START_TIME = "start"; //$NON-NLS-1$
+// private static final String TAGS = "tags"; //$NON-NLS-1$
private JaegerRestUtils() {
}
@@ -62,16 +45,17 @@
* @return Array of service names
*/
public static String[] fetchServices(String baseUrl) {
- URI uri = UriBuilder.fromUri(baseUrl).path(SERVICES_ENDPOINT).build();
- String response = jaegerGet(uri.toString());
- Gson gson = new Gson();
- JsonObject jsonResponse = gson.fromJson(response, JsonObject.class);
- JsonArray servicesArray = jsonResponse.get(SERVICES_DATA_KEY).getAsJsonArray();
- String[] services = new String[servicesArray.size()];
- for (int i = 0; i < servicesArray.size(); i++) {
- services[i] = servicesArray.get(i).getAsString();
- }
- return services;
+ return new String[0];
+// URI uri = UriBuilder.fromUri(baseUrl).path(SERVICES_ENDPOINT).build();
+// String response = jaegerGet(uri.toString());
+// Gson gson = new Gson();
+// JsonObject jsonResponse = gson.fromJson(response, JsonObject.class);
+// JsonArray servicesArray = jsonResponse.get(SERVICES_DATA_KEY).getAsJsonArray();
+// String[] services = new String[servicesArray.size()];
+// for (int i = 0; i < servicesArray.size(); i++) {
+// services[i] = servicesArray.get(i).getAsString();
+// }
+// return services;
}
/**
@@ -99,27 +83,28 @@
* @return The built URL
*/
public static String buildTracesUrl(String baseUrl, String endTime, String limit, String lookback, String maxDuration, String minDuration, String service, String startTime, String tags) {
- UriBuilder uriBuilder = UriBuilder.fromUri(baseUrl).path(TRACES_ENDPOINT)
- .queryParam(SEARCH_END_TIME, endTime)
- .queryParam(NB_TRACES_LIMIT, limit)
- .queryParam(LOOKBACK, lookback)
- .queryParam(SERVICE_NAME, service)
- .queryParam(SEARCH_START_TIME, startTime);
- if (!maxDuration.isEmpty()) {
- uriBuilder.queryParam(MAX_DURATION, maxDuration);
- }
- if (!minDuration.isEmpty()) {
- uriBuilder.queryParam(MIN_DURATION, minDuration);
- }
- if (!tags.isEmpty()) {
- try {
- uriBuilder.queryParam(TAGS, URLEncoder.encode(tags, StandardCharsets.UTF_8.name()));
- } catch (UnsupportedEncodingException e) {
- // We don't add the tags if the encoding fails
- }
- }
-
- return uriBuilder.build().toString();
+ return "";
+// UriBuilder uriBuilder = UriBuilder.fromUri(baseUrl).path(TRACES_ENDPOINT)
+// .queryParam(SEARCH_END_TIME, endTime)
+// .queryParam(NB_TRACES_LIMIT, limit)
+// .queryParam(LOOKBACK, lookback)
+// .queryParam(SERVICE_NAME, service)
+// .queryParam(SEARCH_START_TIME, startTime);
+// if (!maxDuration.isEmpty()) {
+// uriBuilder.queryParam(MAX_DURATION, maxDuration);
+// }
+// if (!minDuration.isEmpty()) {
+// uriBuilder.queryParam(MIN_DURATION, minDuration);
+// }
+// if (!tags.isEmpty()) {
+// try {
+// uriBuilder.queryParam(TAGS, URLEncoder.encode(tags, StandardCharsets.UTF_8.name()));
+// } catch (UnsupportedEncodingException e) {
+// // We don't add the tags if the encoding fails
+// }
+// }
+//
+// return uriBuilder.build().toString();
}
/**
@@ -134,16 +119,20 @@
return jaegerGet(url);
}
+ /**
+ * @param url
+ */
private static String jaegerGet(String url) {
- Client client = ClientBuilder.newClient();
- WebTarget resource = client.target(url);
- Builder request = resource.request();
- request.accept(MediaType.APPLICATION_JSON);
- try {
- return request.get(String.class);
- } catch (Exception e) {
- return null;
- }
+ return null;
+// Client client = ClientBuilder.newClient();
+// WebTarget resource = client.target(url);
+// Builder request = resource.request();
+// request.accept(MediaType.APPLICATION_JSON);
+// try {
+// return request.get(String.class);
+// } catch (Exception e) {
+// return null;
+// }
}
/**
@@ -154,14 +143,15 @@
* @return True if the connection can be establish
*/
public static boolean jaegerCheckConnection(String url) {
- Client client = ClientBuilder.newClient();
- WebTarget resource = client.target(url);
- Builder request = resource.request();
- try {
- int status = request.get().getStatus();
- return Response.Status.fromStatusCode(status) == Response.Status.OK;
- } catch (Exception e) {
- return false;
- }
+ return false;
+// Client client = ClientBuilder.newClient();
+// WebTarget resource = client.target(url);
+// Builder request = resource.request();
+// try {
+// int status = request.get().getStatus();
+// return Response.Status.fromStatusCode(status) == Response.Status.OK;
+// } catch (Exception e) {
+// return false;
+// }
}
}
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/Messages.java b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/Messages.java
index 1bc534e..489d929 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/Messages.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/Messages.java
@@ -17,6 +17,7 @@
@SuppressWarnings("javadoc")
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.tracecompass.incubator.internal.opentracing.ui.project.wizards.messages"; //$NON-NLS-1$
+ public static String FetchJaegerTracesWizardPage_importNotAvailable;
public static String FetchJaegerTracesWizardPage_apiBaseUrlLabel;
public static String FetchJaegerTracesWizardPage_deselectAllButton;
public static String FetchJaegerTracesWizardPage_fetchJaegerShellTitle;
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/messages.properties b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/messages.properties
index 486c7a0..a5a39d0 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/messages.properties
+++ b/tracetypes/org.eclipse.tracecompass.incubator.opentracing.ui/src/org/eclipse/tracecompass/incubator/internal/opentracing/ui/project/wizards/messages.properties
@@ -32,3 +32,4 @@
FetchJaegerTracesWizardPage_wizardDescriptionMessage=Search for Jaeger traces to import
FetchJaegerTracesWizardPage_wizardPageName=Fetch Traces from Jaeger
FetchJaegerTraceWizard_wizardTitle=Import traces from Jaeger
+FetchJaegerTracesWizardPage_importNotAvailable=Jaeger trace import is temporarily not available. This feature will come back in a future release.
\ No newline at end of file