Skip to content

Commit

Permalink
Implement ConfigurationDiscoveryService interface (#95)
Browse files Browse the repository at this point in the history
* Implement ConfigurationDiscoveryService interface

* Fix lint

* add license

* add change log

* fix lint

* fix lint
  • Loading branch information
qiansheng91 authored Feb 14, 2022
1 parent af7e73d commit a7e0b4d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ your changes, such as:

- [public] [both] [updated] add a new feature
## [Unreleased]
- [public] [both] [fixed] Fix error that skywalking v3 plugin doesn't implement ConfigurationDiscoveryService interface
29 changes: 29 additions & 0 deletions plugins/input/skywalkingv3/configuration_discovery_handler.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2021 iLogtail Authors
//
// Licensed 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 skywalkingv3

import (
"context"

v3 "github.com/alibaba/ilogtail/plugins/input/skywalkingv3/skywalking/network/agent/configuration/v3"
v3command "github.com/alibaba/ilogtail/plugins/input/skywalkingv3/skywalking/network/common/v3"
)

type ConfigurationDiscoveryHandler struct {
}

func (*ConfigurationDiscoveryHandler) FetchConfigurations(context context.Context, config *v3.ConfigurationSyncRequest) (*v3command.Commands, error) {
return &v3command.Commands{}, nil
}
12 changes: 7 additions & 5 deletions plugins/input/skywalkingv3/input_skywalking_agent_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
package skywalkingv3

import (
"net"

"google.golang.org/grpc"

"github.com/alibaba/ilogtail"

configuration "github.com/alibaba/ilogtail/plugins/input/skywalkingv3/skywalking/network/agent/configuration/v3"
agent "github.com/alibaba/ilogtail/plugins/input/skywalkingv3/skywalking/network/language/agent/v3"
profile "github.com/alibaba/ilogtail/plugins/input/skywalkingv3/skywalking/network/language/profile/v3"
management "github.com/alibaba/ilogtail/plugins/input/skywalkingv3/skywalking/network/management/v3"

"net"

"google.golang.org/grpc"
)

type Input struct {
Expand Down Expand Up @@ -65,7 +67,7 @@ func (r *Input) Start(collector ilogtail.Collector) error {
agent.RegisterTraceSegmentReportServiceServer(r.grpcServer, &TracingHandler{r.ctx, collector, resourcePropertiesCache, InitComponentMapping(r.ComponentMapping)})
management.RegisterManagementServiceServer(r.grpcServer, &ManagementHandler{r.ctx, collector, resourcePropertiesCache})
profile.RegisterProfileTaskServer(r.grpcServer, &ProfileHandler{})

configuration.RegisterConfigurationDiscoveryServiceServer(r.grpcServer, &ConfigurationDiscoveryHandler{})
if r.Address == "" {
r.Address = "0.0.0.0:11800" // skywalking collector default port
}
Expand Down

0 comments on commit a7e0b4d

Please sign in to comment.