-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a makefile with targets to allow building the contrib distribution. The contrib distribution includes all components present in the upstream distribution plus all components present in the contrib repo. - Does not include the e2e testbed yet. I'll add that in a follow up PR. - Also copies version package from upstream. Need to re-use that. Fixes #17
- Loading branch information
1 parent
bb95418
commit 35bf257
Showing
10 changed files
with
1,147 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM alpine:latest as certs | ||
RUN apk --update add ca-certificates | ||
|
||
FROM scratch | ||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY otelcontribcol / | ||
ENTRYPOINT ["/otelcontribcol"] | ||
EXPOSE 55678 55679 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2019 OpenTelemetry 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 ( | ||
"github.com/open-telemetry/opentelemetry-collector/config" | ||
"github.com/open-telemetry/opentelemetry-collector/defaults" | ||
"github.com/open-telemetry/opentelemetry-collector/exporter" | ||
"github.com/open-telemetry/opentelemetry-collector/oterr" | ||
"github.com/open-telemetry/opentelemetry-collector/receiver" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/stackdriverexporter" | ||
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinscribereceiver" | ||
) | ||
|
||
func components() (config.Factories, error) { | ||
errs := []error{} | ||
factories, err := defaults.Components() | ||
if err != nil { | ||
return config.Factories{}, err | ||
} | ||
|
||
receivers := []receiver.Factory{&zipkinscribereceiver.Factory{}} | ||
for _, rcv := range factories.Receivers { | ||
receivers = append(receivers, rcv) | ||
} | ||
factories.Receivers, err = receiver.Build(receivers...) | ||
if err != nil { | ||
errs = append(errs, err) | ||
} | ||
|
||
exporters := []exporter.Factory{&stackdriverexporter.Factory{}} | ||
for _, exp := range factories.Exporters { | ||
exporters = append(exporters, exp) | ||
} | ||
factories.Exporters, err = exporter.Build(exporters...) | ||
if err != nil { | ||
errs = append(errs, err) | ||
} | ||
|
||
return factories, oterr.CombineErrors(errs) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2019 OpenTelemetry 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. | ||
|
||
// Program otelcontribcol is the Omnition Telemetry Service built on top of | ||
// OpenTelemetry Service. | ||
package main | ||
|
||
import ( | ||
"log" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector/service" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/version" | ||
) | ||
|
||
func main() { | ||
handleErr := func(err error) { | ||
if err != nil { | ||
log.Fatalf("Failed to run the service: %v", err) | ||
} | ||
} | ||
|
||
factories, err := components() | ||
handleErr(err) | ||
|
||
info := service.ApplicationStartInfo{ | ||
ExeName: "otelcontribcol", | ||
LongName: "OpenTelemetry Contrib Collector", | ||
Version: version.Version, | ||
GitHash: version.GitHash, | ||
} | ||
|
||
svc, err := service.New(factories, info) | ||
handleErr(err) | ||
|
||
err = svc.Start() | ||
handleErr(err) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.