Skip to content

Commit

Permalink
Introduce OTEL collector as go submodule
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay committed Mar 23, 2020
1 parent 83b2679 commit 35974f9
Show file tree
Hide file tree
Showing 7 changed files with 1,085 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ cmd/docs/*.1
cmd/docs/*.yaml
crossdock/crossdock-*
run-crossdock.log

cmd/opentelemetry-collector/opentelemetry-collector-*
__pycache__
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ matrix:
- go: "1.13.x"
env:
- HOTROD=true
- go: "1.13.x"
env:
- OTEL=true

services:
- docker
Expand Down Expand Up @@ -71,6 +74,7 @@ script:
- if [ "$CASSANDRA_INTEGRATION_TEST" == true ]; then bash ./scripts/travis/cassandra-integration-test.sh ; else echo 'skipping cassandra integration test'; fi
- if [ "$HOTROD" == true ]; then bash ./scripts/travis/hotrod-integration-test.sh ; else echo 'skipping hotrod example'; fi
- if [ "$PROTO_GEN_TEST" == true ]; then make proto && git diff --name-status --exit-code ; else echo 'skipping protoc validation'; fi
- if [ "$OTEL" == true ]; then make build-otel-collector; fi

after_success:
- if [ "$COVERAGE" == true ]; then mv cover.out coverage.txt ; else echo 'skipping coverage'; fi
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ else
$(GOBUILD) -o ./cmd/collector/collector-$(GOOS) $(BUILD_INFO) ./cmd/collector/main.go
endif

OTEL_COLLECTOR_DIR = ./cmd/opentelemetry-collector
.PHONY: build-otel-collector
build-otel-collector:
ifeq ($(GOARCH), s390x)
cd ${OTEL_COLLECTOR_DI} && $(GOBUILD) -o ./opentelemetry-collector-$(GOOS)-$(GOARCH) $(BUILD_INFO) main.go
else
cd ${OTEL_COLLECTOR_DIR} && $(GOBUILD) -o ./opentelemetry-collector-$(GOOS) $(BUILD_INFO) main.go
endif

.PHONY: build-ingester
build-ingester:
ifeq ($(GOARCH), s390x)
Expand Down
9 changes: 9 additions & 0 deletions cmd/opentelemetry-collector/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/jaegertracing/jaeger/cmd/opentelemetry-collector

go 1.13

replace k8s.io/client-go => k8s.io/client-go v0.0.0-20190620085101-78d2af792bab

replace github.com/jaegertracing/jaeger => ./../../

require github.com/open-telemetry/opentelemetry-collector v0.2.8-0.20200318211436-c7a11d6181c1 // indirect
1,012 changes: 1,012 additions & 0 deletions cmd/opentelemetry-collector/go.sum

Large diffs are not rendered by default.

Binary file added cmd/opentelemetry-collector/main
Binary file not shown.
50 changes: 50 additions & 0 deletions cmd/opentelemetry-collector/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (c) 2020 The Jaeger 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 main

import (
"log"

"github.com/open-telemetry/opentelemetry-collector/defaults"
"github.com/open-telemetry/opentelemetry-collector/service"
)

func main() {
handleErr := func(err error) {
if err != nil {
log.Fatalf("Failed to run the service: %v", err)
}
}

info := service.ApplicationStartInfo{
ExeName: "jaeger-opentelemetry-collector",
LongName: "Jaeger OpenTelemetry Collector",
// TODO
//Version: version.Version,
//GitHash: version.GitHash,
}

cmpts, err := defaults.Components()
handleErr(err)

svc, err := service.New(service.Parameters{
ApplicationStartInfo: info,
Factories: cmpts,
})
handleErr(err)

err = svc.Start()
handleErr(err)
}

0 comments on commit 35974f9

Please sign in to comment.