* Fix missing licenses in dist.
* Move all CoreRegisterLinker together into SharingReceiver.
* Setup receiver endpoint
* Revert "Provide create, delete, isExists template method by elastic client. (#2425)"
This reverts commit e6a7720f03.
This commit is contained in:
parent
6868803226
commit
e59a488005
|
|
@ -307,9 +307,12 @@ The text of each license is the standard Apache 2.0 license.
|
|||
consul-client 1.2.6: https://github.com/rickfast/consul-client, Apache 2.0
|
||||
okhttp 3.9.0: https://github.com/square/okhttp, Apache 2.0
|
||||
prometheus client_java 0.6.0: https://github.com/prometheus/client_java, Apache 2.0
|
||||
proto files from istio/istio: https://github.com/istio/istio Apache 2.0
|
||||
proto files from istio/api: https://github.com/istio/api Apache 2.0
|
||||
proto files from envoyproxy/data-plane-api: https://github.com/envoyproxy/data-plane-api Apache 2.0
|
||||
proto files from prometheus/client_model: https://github.com/prometheus/client_model Apache 2.0
|
||||
proto files from lyft/protoc-gen-validate: https://github.com/lyft/protoc-gen-validate Apache 2.0
|
||||
proto files from gogo/googleapis: https://github.com/gogo/googleapis Apache 2.0
|
||||
|
||||
========================================================================
|
||||
MIT licenses
|
||||
|
|
@ -340,7 +343,8 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
|
|||
Google: protobuf-java-util 3.4.0: https://github.com/google/protobuf/blob/master/java/pom.xml , BSD-3-Clause
|
||||
reflectasm 1.11.3: https://github.com/EsotericSoftware/reflectasm , BSD-3-Clause
|
||||
|
||||
gogo-protobuf, proto files: https://github.com/gogo/protobuf BSD-2-Clause
|
||||
proto files from gogo: https://github.com/gogo/protobuf BSD-2
|
||||
proto files from grpc-gateway, https://github.com/grpc-ecosystem/grpc-gateway/tree/master/protoc-gen-swagger/options BSD-3
|
||||
|
||||
========================================================================
|
||||
MPL 2.0 licenses
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
Protocol Buffers for Go with Gadgets
|
||||
|
||||
Copyright (c) 2013, The GoGo Authors. All rights reserved.
|
||||
http://github.com/gogo/protobuf
|
||||
|
||||
Protocol Buffers for Go with Gadgets
|
||||
|
||||
Go support for Protocol Buffers - Google's data interchange format
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
Copyright (c) 2015, Gengo, Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Gengo, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
<shardingjdbc.version>2.0.3</shardingjdbc.version>
|
||||
<commons-dbcp.version>1.4</commons-dbcp.version>
|
||||
<commons-io.version>2.6</commons-io.version>
|
||||
<elasticsearch.version>6.7.0</elasticsearch.version>
|
||||
<elasticsearch.version>6.3.2</elasticsearch.version>
|
||||
<joda-time.version>2.9.9</joda-time.version>
|
||||
<kubernetes.version>2.0.0</kubernetes.version>
|
||||
<hikaricp.version>3.1.0</hikaricp.version>
|
||||
|
|
|
|||
|
|
@ -18,35 +18,53 @@
|
|||
|
||||
package org.apache.skywalking.oap.server.library.client.elasticsearch;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.auth.*;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.CredentialsProvider;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
||||
import org.apache.http.nio.entity.NStringEntity;
|
||||
import org.apache.skywalking.oap.server.library.client.Client;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
|
||||
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
|
||||
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
|
||||
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
|
||||
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
|
||||
import org.elasticsearch.action.bulk.*;
|
||||
import org.elasticsearch.action.get.*;
|
||||
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
|
||||
import org.elasticsearch.action.admin.indices.get.GetIndexRequest;
|
||||
import org.elasticsearch.action.bulk.BackoffPolicy;
|
||||
import org.elasticsearch.action.bulk.BulkProcessor;
|
||||
import org.elasticsearch.action.bulk.BulkRequest;
|
||||
import org.elasticsearch.action.bulk.BulkResponse;
|
||||
import org.elasticsearch.action.get.GetRequest;
|
||||
import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.get.MultiGetRequest;
|
||||
import org.elasticsearch.action.get.MultiGetResponse;
|
||||
import org.elasticsearch.action.index.IndexRequest;
|
||||
import org.elasticsearch.action.search.*;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.action.update.UpdateRequest;
|
||||
import org.elasticsearch.client.*;
|
||||
import org.elasticsearch.client.indices.*;
|
||||
import org.elasticsearch.client.Response;
|
||||
import org.elasticsearch.client.RestClient;
|
||||
import org.elasticsearch.client.RestClientBuilder;
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.*;
|
||||
import org.elasticsearch.common.unit.ByteSizeUnit;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.index.reindex.*;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
import org.slf4j.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
|
|
@ -76,7 +94,13 @@ public class ElasticSearchClient implements Client {
|
|||
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
||||
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(user, password));
|
||||
builder = RestClient.builder(pairsList.toArray(new HttpHost[0]))
|
||||
.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider));
|
||||
.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
|
||||
@Override
|
||||
public HttpAsyncClientBuilder customizeHttpClient(
|
||||
HttpAsyncClientBuilder httpClientBuilder) {
|
||||
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
builder = RestClient.builder(pairsList.toArray(new HttpHost[0]));
|
||||
}
|
||||
|
|
@ -109,8 +133,8 @@ public class ElasticSearchClient implements Client {
|
|||
indexName = formatIndexName(indexName);
|
||||
CreateIndexRequest request = new CreateIndexRequest(indexName);
|
||||
request.settings(settings);
|
||||
request.mapping(mappingBuilder);
|
||||
CreateIndexResponse response = client.indices().create(request, RequestOptions.DEFAULT);
|
||||
request.mapping(TYPE, mappingBuilder);
|
||||
CreateIndexResponse response = client.indices().create(request);
|
||||
logger.debug("create {} index finished, isAcknowledged: {}", indexName, response.isAcknowledged());
|
||||
return response.isAcknowledged();
|
||||
}
|
||||
|
|
@ -118,44 +142,17 @@ public class ElasticSearchClient implements Client {
|
|||
public boolean deleteIndex(String indexName) throws IOException {
|
||||
indexName = formatIndexName(indexName);
|
||||
DeleteIndexRequest request = new DeleteIndexRequest(indexName);
|
||||
AcknowledgedResponse response = client.indices().delete(request, RequestOptions.DEFAULT);
|
||||
DeleteIndexResponse response;
|
||||
response = client.indices().delete(request);
|
||||
logger.debug("delete {} index finished, isAcknowledged: {}", indexName, response.isAcknowledged());
|
||||
return response.isAcknowledged();
|
||||
}
|
||||
|
||||
public boolean isExistsIndex(String indexName) throws IOException {
|
||||
indexName = formatIndexName(indexName);
|
||||
GetIndexRequest request = new GetIndexRequest(indexName);
|
||||
return client.indices().exists(request, RequestOptions.DEFAULT);
|
||||
}
|
||||
|
||||
public boolean isExistsTemplate(String indexName) throws IOException {
|
||||
indexName = formatIndexName(indexName);
|
||||
IndexTemplatesExistRequest request = new IndexTemplatesExistRequest(indexName);
|
||||
return client.indices().existsTemplate(request, RequestOptions.DEFAULT);
|
||||
}
|
||||
|
||||
public boolean createTemplate(String indexName, Settings settings,
|
||||
XContentBuilder mappingBuilder) throws IOException {
|
||||
indexName = formatIndexName(indexName);
|
||||
|
||||
org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest request = new PutIndexTemplateRequest(indexName);
|
||||
request.patterns(Collections.singletonList(indexName + "*"));
|
||||
request.settings(settings);
|
||||
request.mapping("_doc", mappingBuilder);
|
||||
|
||||
AcknowledgedResponse response = client.indices().putTemplate(request, RequestOptions.DEFAULT);
|
||||
logger.debug("create {} template finished, isAcknowledged: {}", indexName, response.isAcknowledged());
|
||||
return response.isAcknowledged();
|
||||
}
|
||||
|
||||
public boolean deleteTemplate(String indexName) throws IOException {
|
||||
indexName = formatIndexName(indexName);
|
||||
|
||||
DeleteIndexTemplateRequest request = new DeleteIndexTemplateRequest();
|
||||
request.name(indexName);
|
||||
AcknowledgedResponse deleteTemplateAcknowledge = client.indices().deleteTemplate(request, RequestOptions.DEFAULT);
|
||||
return deleteTemplateAcknowledge.isAcknowledged();
|
||||
GetIndexRequest request = new GetIndexRequest();
|
||||
request.indices(indexName);
|
||||
return client.indices().exists(request);
|
||||
}
|
||||
|
||||
public SearchResponse search(String indexName, SearchSourceBuilder searchSourceBuilder) throws IOException {
|
||||
|
|
@ -163,39 +160,39 @@ public class ElasticSearchClient implements Client {
|
|||
SearchRequest searchRequest = new SearchRequest(indexName);
|
||||
searchRequest.types(TYPE);
|
||||
searchRequest.source(searchSourceBuilder);
|
||||
return client.search(searchRequest, RequestOptions.DEFAULT);
|
||||
return client.search(searchRequest);
|
||||
}
|
||||
|
||||
public GetResponse get(String indexName, String id) throws IOException {
|
||||
indexName = formatIndexName(indexName);
|
||||
GetRequest request = new GetRequest(indexName, TYPE, id);
|
||||
return client.get(request, RequestOptions.DEFAULT);
|
||||
return client.get(request);
|
||||
}
|
||||
|
||||
public MultiGetResponse multiGet(String indexName, List<String> ids) throws IOException {
|
||||
final String newIndexName = formatIndexName(indexName);
|
||||
MultiGetRequest request = new MultiGetRequest();
|
||||
ids.forEach(id -> request.add(newIndexName, TYPE, id));
|
||||
return client.mget(request, RequestOptions.DEFAULT);
|
||||
return client.multiGet(request);
|
||||
}
|
||||
|
||||
public void forceInsert(String indexName, String id, XContentBuilder source) throws IOException {
|
||||
IndexRequest request = prepareInsert(indexName, id, source);
|
||||
request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
|
||||
client.index(request, RequestOptions.DEFAULT);
|
||||
client.index(request);
|
||||
}
|
||||
|
||||
public void forceUpdate(String indexName, String id, XContentBuilder source, long version) throws IOException {
|
||||
UpdateRequest request = prepareUpdate(indexName, id, source);
|
||||
request.version(version);
|
||||
request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
|
||||
client.update(request, RequestOptions.DEFAULT);
|
||||
client.update(request);
|
||||
}
|
||||
|
||||
public void forceUpdate(String indexName, String id, XContentBuilder source) throws IOException {
|
||||
UpdateRequest request = prepareUpdate(indexName, id, source);
|
||||
request.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
|
||||
client.update(request, RequestOptions.DEFAULT);
|
||||
client.update(request);
|
||||
}
|
||||
|
||||
public IndexRequest prepareInsert(String indexName, String id, XContentBuilder source) {
|
||||
|
|
@ -210,14 +207,20 @@ public class ElasticSearchClient implements Client {
|
|||
|
||||
public int delete(String indexName, String timeBucketColumnName, long endTimeBucket) throws IOException {
|
||||
indexName = formatIndexName(indexName);
|
||||
|
||||
DeleteByQueryRequest request = new DeleteByQueryRequest();
|
||||
request.indices(indexName);
|
||||
request.setQuery(QueryBuilders.rangeQuery(timeBucketColumnName).lte(endTimeBucket));
|
||||
|
||||
BulkByScrollResponse response = client.deleteByQuery(request, RequestOptions.DEFAULT);
|
||||
logger.debug("Delete data from index {}, deleted {}", indexName, response.getDeleted());
|
||||
return 200;
|
||||
Map<String, String> params = Collections.singletonMap("conflicts", "proceed");
|
||||
String jsonString = "{" +
|
||||
" \"query\": {" +
|
||||
" \"range\": {" +
|
||||
" \"" + timeBucketColumnName + "\": {" +
|
||||
" \"lte\": " + endTimeBucket +
|
||||
" }" +
|
||||
" }" +
|
||||
" }" +
|
||||
"}";
|
||||
HttpEntity entity = new NStringEntity(jsonString, ContentType.APPLICATION_JSON);
|
||||
Response response = client.getLowLevelClient().performRequest("POST", "/" + indexName + "/_delete_by_query", params, entity);
|
||||
logger.debug("delete indexName: {}, jsonString : {}", indexName, jsonString);
|
||||
return response.getStatusLine().getStatusCode();
|
||||
}
|
||||
|
||||
public String formatIndexName(String indexName) {
|
||||
|
|
@ -232,30 +235,22 @@ public class ElasticSearchClient implements Client {
|
|||
BulkProcessor.Listener listener = new BulkProcessor.Listener() {
|
||||
@Override
|
||||
public void beforeBulk(long executionId, BulkRequest request) {
|
||||
int numberOfActions = request.numberOfActions();
|
||||
logger.debug("Executing bulk [{}] with {} requests", executionId, numberOfActions);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {
|
||||
if (response.hasFailures()) {
|
||||
logger.warn("Bulk [{}] executed with failures", executionId);
|
||||
} else {
|
||||
logger.debug("Bulk [{}] completed in {} milliseconds",
|
||||
executionId, response.getTook().getMillis());
|
||||
}
|
||||
public void afterBulk(long executionId, BulkRequest request,
|
||||
BulkResponse response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterBulk(long executionId, BulkRequest request, Throwable failure) {
|
||||
logger.error("Failed to execute bulk", failure);
|
||||
logger.error("{} data bulk failed, reason: {}", request.numberOfActions(), failure);
|
||||
}
|
||||
};
|
||||
|
||||
BiConsumer<BulkRequest, ActionListener<BulkResponse>> bulkConsumer =
|
||||
(request, bulkListener) -> client.bulkAsync(request, RequestOptions.DEFAULT, bulkListener);
|
||||
|
||||
return BulkProcessor.builder(bulkConsumer, listener)
|
||||
return BulkProcessor.builder(client::bulkAsync, listener)
|
||||
.setBulkActions(bulkActions)
|
||||
.setBulkSize(new ByteSizeValue(bulkSize, ByteSizeUnit.MB))
|
||||
.setFlushInterval(TimeValue.timeValueSeconds(flushInterval))
|
||||
|
|
|
|||
|
|
@ -29,5 +29,16 @@
|
|||
|
||||
<artifactId>jaeger-receiver-plugin</artifactId>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>receiver-proto</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>skywalking-sharing-server-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.aop.server.receiver.jaeger;
|
||||
|
||||
import io.grpc.stub.StreamObserver;
|
||||
import io.jaegertracing.api_v2.*;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleManager;
|
||||
import org.slf4j.*;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
*/
|
||||
public class JaegerGRPCHandler extends CollectorServiceGrpc.CollectorServiceImplBase {
|
||||
private static final Logger logger = LoggerFactory.getLogger(JaegerGRPCHandler.class);
|
||||
|
||||
public JaegerGRPCHandler(ModuleManager manager) {
|
||||
|
||||
}
|
||||
|
||||
public void postSpans(Collector.PostSpansRequest request,
|
||||
StreamObserver<Collector.PostSpansResponse> responseObserver) {
|
||||
|
||||
request.getBatch().getSpansList().forEach(span -> {
|
||||
logger.debug(span.toString());
|
||||
});
|
||||
|
||||
responseObserver.onNext(Collector.PostSpansResponse.newBuilder().build());
|
||||
responseObserver.onCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.aop.server.receiver.jaeger;
|
||||
|
||||
import lombok.*;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleConfig;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class JaegerReceiverConfig extends ModuleConfig {
|
||||
private boolean registerJaegerEndpoint = true;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.aop.server.receiver.jaeger;
|
||||
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleDefine;
|
||||
|
||||
/**
|
||||
* Adapt Jaeger gRPC backend service.
|
||||
*
|
||||
* @author wusheng
|
||||
*/
|
||||
public class JaegerReceiverModule extends ModuleDefine {
|
||||
public static final String NAME = "receiver_jaeger";
|
||||
|
||||
public JaegerReceiverModule() {
|
||||
super(NAME);
|
||||
}
|
||||
|
||||
@Override public Class[] services() {
|
||||
return new Class[0];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.aop.server.receiver.jaeger;
|
||||
|
||||
import org.apache.skywalking.oap.server.core.server.GRPCHandlerRegister;
|
||||
import org.apache.skywalking.oap.server.library.module.*;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.SharingServerModule;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
*/
|
||||
public class JaegerReceiverProvider extends ModuleProvider {
|
||||
public static final String NAME = "default";
|
||||
|
||||
@Override public String name() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override public Class<? extends ModuleDefine> module() {
|
||||
return JaegerReceiverModule.class;
|
||||
}
|
||||
|
||||
@Override public ModuleConfig createConfigBeanIfAbsent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public void prepare() throws ServiceNotProvidedException, ModuleStartException {
|
||||
|
||||
}
|
||||
|
||||
@Override public void start() throws ServiceNotProvidedException, ModuleStartException {
|
||||
GRPCHandlerRegister grpcHandlerRegister = getManager().find(SharingServerModule.NAME).provider().getService(GRPCHandlerRegister.class);
|
||||
grpcHandlerRegister.addHandler(new JaegerGRPCHandler(getManager()));
|
||||
}
|
||||
|
||||
@Override public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException {
|
||||
|
||||
}
|
||||
|
||||
@Override public String[] requiredModules() {
|
||||
return new String[] {SharingServerModule.NAME};
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
org.apache.skywalking.aop.server.receiver.jaeger.JaegerReceiverModule
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
#
|
||||
|
||||
org.apache.skywalking.aop.server.receiver.jaeger.JaegerReceiverProvider
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.aop.server.receiver.mesh;
|
||||
|
||||
import org.apache.skywalking.oap.server.core.CoreModule;
|
||||
import org.apache.skywalking.oap.server.core.register.service.IEndpointInventoryRegister;
|
||||
import org.apache.skywalking.oap.server.core.register.service.IServiceInstanceInventoryRegister;
|
||||
import org.apache.skywalking.oap.server.core.register.service.IServiceInventoryRegister;
|
||||
import org.apache.skywalking.oap.server.library.module.ModuleManager;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
*/
|
||||
public class CoreRegisterLinker {
|
||||
private static volatile ModuleManager MODULE_MANAGER;
|
||||
private static volatile IServiceInventoryRegister SERVICE_INVENTORY_REGISTER;
|
||||
private static volatile IServiceInstanceInventoryRegister SERVICE_INSTANCE_INVENTORY_REGISTER;
|
||||
private static volatile IEndpointInventoryRegister ENDPOINT_INVENTORY_REGISTER;
|
||||
|
||||
public static void setModuleManager(ModuleManager moduleManager) {
|
||||
CoreRegisterLinker.MODULE_MANAGER = moduleManager;
|
||||
}
|
||||
|
||||
public static IServiceInventoryRegister getServiceInventoryRegister() {
|
||||
if (SERVICE_INVENTORY_REGISTER == null) {
|
||||
SERVICE_INVENTORY_REGISTER = MODULE_MANAGER.find(CoreModule.NAME).provider().getService(IServiceInventoryRegister.class);
|
||||
}
|
||||
return SERVICE_INVENTORY_REGISTER;
|
||||
}
|
||||
|
||||
public static IServiceInstanceInventoryRegister getServiceInstanceInventoryRegister() {
|
||||
if (SERVICE_INSTANCE_INVENTORY_REGISTER == null) {
|
||||
SERVICE_INSTANCE_INVENTORY_REGISTER = MODULE_MANAGER.find(CoreModule.NAME).provider().getService(IServiceInstanceInventoryRegister.class);
|
||||
}
|
||||
return SERVICE_INSTANCE_INVENTORY_REGISTER;
|
||||
}
|
||||
|
||||
public static IEndpointInventoryRegister getEndpointInventoryRegister() {
|
||||
if (ENDPOINT_INVENTORY_REGISTER == null) {
|
||||
ENDPOINT_INVENTORY_REGISTER = MODULE_MANAGER.find(CoreModule.NAME).provider().getService(IEndpointInventoryRegister.class);
|
||||
}
|
||||
return ENDPOINT_INVENTORY_REGISTER;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ import java.io.IOException;
|
|||
import org.apache.skywalking.oap.server.core.CoreModule;
|
||||
import org.apache.skywalking.oap.server.core.server.GRPCHandlerRegister;
|
||||
import org.apache.skywalking.oap.server.library.module.*;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.SharingServerModule;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.*;
|
||||
import org.apache.skywalking.oap.server.telemetry.TelemetryModule;
|
||||
|
||||
public class MeshReceiverProvider extends ModuleProvider {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import org.apache.skywalking.apm.network.common.DetectPoint;
|
|||
import org.apache.skywalking.apm.network.servicemesh.ServiceMeshMetric;
|
||||
import org.apache.skywalking.oap.server.core.Const;
|
||||
import org.apache.skywalking.oap.server.core.register.ServiceInstanceInventory;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.CoreRegisterLinker;
|
||||
|
||||
/**
|
||||
* @author wusheng
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package org.apache.skywalking.oap.server.receiver.zipkin;
|
||||
package org.apache.skywalking.oap.server.receiver.sharing.server;
|
||||
|
||||
import org.apache.skywalking.oap.server.core.CoreModule;
|
||||
import org.apache.skywalking.oap.server.core.register.service.*;
|
||||
|
|
@ -26,6 +26,7 @@ import org.apache.skywalking.oap.server.library.module.ModuleStartException;
|
|||
import org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException;
|
||||
import org.apache.skywalking.oap.server.library.server.ServerException;
|
||||
import org.apache.skywalking.oap.server.library.server.jetty.JettyServer;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.CoreRegisterLinker;
|
||||
import org.apache.skywalking.oap.server.receiver.trace.module.TraceModule;
|
||||
import org.apache.skywalking.oap.server.receiver.trace.provider.parser.ISegmentParserService;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.analysis.*;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package org.apache.skywalking.oap.server.receiver.zipkin.analysis;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.CoreRegisterLinker;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.*;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.analysis.cache.CacheFactory;
|
||||
import zipkin2.Span;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
|||
import org.apache.skywalking.apm.network.common.KeyStringValuePair;
|
||||
import org.apache.skywalking.apm.network.language.agent.*;
|
||||
import org.apache.skywalking.apm.network.language.agent.v2.*;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.CoreRegisterLinker;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.CoreRegisterLinker;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.analysis.*;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.analysis.data.SkyWalkingTrace;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.apache.skywalking.oap.server.core.Const;
|
|||
import org.apache.skywalking.oap.server.core.cache.*;
|
||||
import org.apache.skywalking.oap.server.core.source.*;
|
||||
import org.apache.skywalking.oap.server.library.util.*;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.CoreRegisterLinker;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.*;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.handler.SpanEncode;
|
||||
import org.apache.skywalking.oap.server.storage.plugin.zipkin.ZipkinSpan;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.apache.skywalking.apm.network.language.agent.SpanType;
|
|||
import org.apache.skywalking.apm.network.language.agent.v2.*;
|
||||
import org.apache.skywalking.oap.server.core.register.NodeType;
|
||||
import org.apache.skywalking.oap.server.core.register.service.*;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.CoreRegisterLinker;
|
||||
import org.apache.skywalking.oap.server.receiver.sharing.server.CoreRegisterLinker;
|
||||
import org.apache.skywalking.oap.server.receiver.zipkin.analysis.data.*;
|
||||
import org.junit.*;
|
||||
import org.powermock.reflect.Whitebox;
|
||||
|
|
|
|||
|
|
@ -131,6 +131,11 @@
|
|||
<artifactId>storage-zipkin-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.skywalking</groupId>
|
||||
<artifactId>jaeger-receiver-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- storage module -->
|
||||
|
||||
<!-- queryBuild module -->
|
||||
|
|
|
|||
|
|
@ -103,6 +103,8 @@ envoy-metric:
|
|||
# host: ${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
|
||||
# port: ${SW_RECEIVER_ZIPKIN_PORT:9411}
|
||||
# contextPath: ${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
|
||||
receiver_jaeger:
|
||||
default:
|
||||
query:
|
||||
graphql:
|
||||
path: ${SW_QUERY_GRAPHQL_PATH:/graphql}
|
||||
|
|
|
|||
Loading…
Reference in New Issue