Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rapphil committed Mar 30, 2023
2 parents 28886e4 + b575a2d commit 3f3d840
Show file tree
Hide file tree
Showing 39 changed files with 1,277 additions and 1,170 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ updates:
schedule:
interval: weekly
day: sunday
ignore:
- dependency-name: "github.com/open-telemetry/opentelemetry-collector-contrib/*"
- dependency-name: "go.opentelemetry.io/collector*"
- package-ecosystem: gomod
directory: /pkg/lambdacomponents
labels:
Expand All @@ -28,6 +31,9 @@ updates:
schedule:
interval: weekly
day: sunday
ignore:
- dependency-name: "github.com/open-telemetry/opentelemetry-collector-contrib/*"
- dependency-name: "go.opentelemetry.io/collector*"
- package-ecosystem: gomod
directory: /tools/linters
labels:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CD-adot-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ~1.18.9
go-version: ~1.20.2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1-node16
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:

- name: Pull image from integration test ECR and Upload to public release ECR and Dockerhub
if: steps.release-version-image.outputs.cache-hit != 'true'
uses: akhilerm/tag-push-action@v2.0.0
uses: akhilerm/tag-push-action@v2.1.0
with:
src: public.ecr.aws/${{ env.ECR_REPO_INTEGRATION_TEST }}:${{ needs.release-checking.outputs.testing_version }}
dst: |
Expand All @@ -191,7 +191,7 @@ jobs:
- name: Pull image from release ECR, tag as latest and push to public release ECR and DockerHub
if: ${{ needs.release-checking.outputs.latest-or-newer == 'true' && steps.release-version-image.outputs.cache-hit != 'true'}}
uses: akhilerm/tag-push-action@v2.0.0
uses: akhilerm/tag-push-action@v2.1.0
with:
src: public.ecr.aws/${{ env.ECR_REPO }}:${{ needs.release-checking.outputs.version }}
dst: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CI-Operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
ref: ${{ needs.create-test-ref.outputs.testRef }}

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '~1.18.9'
go-version: '~1.20.2'

- name: Create test batch key values
id: set-batches
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ env:
DDB_TABLE_NAME: BatchTestCache
MAX_JOBS: 90
BATCH_INCLUDED_SERVICES: EC2,ECS
GO_VERSION: ~1.18.9
GO_VERSION: ~1.20.2

concurrency:
group: ci-batched${{ github.ref_name }}
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
path: testing-framework
ref: ${{ needs.create-test-ref.outputs.testRef }}
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build aotutil
Expand All @@ -104,7 +104,7 @@ jobs:
steps:
# Set up building environment, patch the dev repo code on dispatch events.
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -534,7 +534,7 @@ jobs:
#-Export it for delivery version image in CD
#Documentation: https://github.com/docker/build-push-action
- name: Build ADOT collector image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
if: steps.e2etest-release.outputs.cache-hit != 'true'
with:
file: cmd/awscollector/Dockerfile
Expand Down Expand Up @@ -564,7 +564,7 @@ jobs:
ref: ${{ needs.create-test-ref.outputs.testRef }}

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down Expand Up @@ -706,7 +706,7 @@ jobs:
ref: ${{ needs.create-test-ref.outputs.testRef }}

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/PR-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ jobs:
# Set up building environment, patch the dev repo code on dispatch events.
- name: Set up Go 1.x
if: ${{ needs.changes.outputs.changed == 'true' }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '~1.18.9'
go-version: '~1.20.2'

- name: Checkout
if: ${{ needs.changes.outputs.changed == 'true' }}
Expand Down Expand Up @@ -209,6 +209,8 @@ jobs:

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Get all the testing suites
id: set-matrix
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ jobs:
ref: ${{ needs.create-test-ref.outputs.testRef }}

- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: '~1.18.9'
go-version: '~1.20.2'
- name: Build aotutil
run: cd testing-framework/cmd/aotutil && make build
- name: Cache aotutil
Expand All @@ -77,6 +77,8 @@ jobs:

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: get all the canary test cases
id: get-test-cases
Expand Down Expand Up @@ -140,4 +142,3 @@ jobs:
if: ${{ always() }}
run: |
cd testing-framework/terraform/canary && terraform destroy -auto-approve -var="region=us-west-2"
14 changes: 9 additions & 5 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ env:
COMMIT_USER: Github Actions
COMMIT_EMAIL: actions@github.com
TESTING_FRAMEWORK_REPO: aws-observability/aws-otel-test-framework
GO_VERSION: ~1.18.9
GO_VERSION: ~1.20.2

permissions:
id-token: write
Expand Down Expand Up @@ -106,7 +106,9 @@ jobs:

- name: Setup Python
uses: actions/setup-python@v4

with:
python-version: '3.9'

- name: Get all the perf test cases (all the soaking test cases are perf test cases)
id: get-test-cases
run: |
Expand All @@ -124,7 +126,7 @@ jobs:
path: testing-framework
ref: ${{ needs.create-test-ref.outputs.testRef }}
- name: Set up Go 1.x
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build aotutil
Expand Down Expand Up @@ -197,10 +199,12 @@ jobs:
needs: [get-testing-version, run-perf-test]
steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4

with:
python-version: '3.9'

- name: Install Jinja2
run: pip install Jinja2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rollback-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
env:
AWS_REGION: us-east-1
- name: Rollback ECR latest
uses: akhilerm/tag-push-action@v2.0.0
uses: akhilerm/tag-push-action@v2.1.0
with:
src: public.ecr.aws/${{ env.ECR_REPO }}:${{ github.event.inputs.rollback-version }}
dst: public.ecr.aws/${{ env.ECR_REPO }}:latest
4 changes: 2 additions & 2 deletions .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ jobs:
env:
AWS_REGION: us-east-1
- name: Rollback ECR latest
uses: akhilerm/tag-push-action@v2.0.0
uses: akhilerm/tag-push-action@v2.1.0
with:
src: public.ecr.aws/${{ env.ECR_REPO }}:${{ github.event.inputs.rollback-version }}
dst: public.ecr.aws/${{ env.ECR_REPO }}:latest
- name: Rollback DockerHub latest
uses: akhilerm/tag-push-action@v2.0.0
uses: akhilerm/tag-push-action@v2.1.0
with:
src: ${{ env.DOCKERHUB_REPO }}:${{ github.event.inputs.rollback-version }}
dst: ${{ env.DOCKERHUB_REPO }}:latest
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ lint-static-check:
golint: lint-static-check
@$(MAKE) for-all-target TARGET="lint"

.PHONY: gomod-tidy
gomod-tidy:
@$(MAKE) for-all-target TARGET="mod-tidy"

.PHONY: multimod-verify
multimod-verify:
@echo "Validating versions.yaml"
Expand Down
5 changes: 4 additions & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ fmt:
go fmt ./...
$(TOOL_BIN)/goimports $(GOIMPORTS_OPT) ./


.PHONY: lint
lint:
$(TOOL_BIN)/$(LINT) run --timeout 5m --enable gosec

.PHONY: mod-tidy
mod-tidy:
go mod tidy
41 changes: 13 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,19 @@ This table represents the supported components of the ADOT Collector. The highli

| Receiver | Processor | Exporter | Extensions |
|---------------------------------|-------------------------------|------------------------------------|------------------------|
| prometheusreceiver | attributesprocessor | `awsxrayexporter` | healthcheckextension |
| otlpreceiver | resourceprocessor | `awsemfexporter` | pprofextension |
| `awsecscontainermetricsreceiver`| batchprocessor | prometheusremotewriteexporter | zpagesextension |
| `awsxrayreceiver` | memorylimiterprocessor | loggingexporter | `ecsobserver` |
| statsdreceiver | probabilisticsamplerprocessor | otlpexporter | `awsproxy` |
| zipkinreceiver | metricstransformprocessor | fileexporter | ballastextention |
| jaegerreceiver | spanprocessor | otlphttpexporter | `sigv4authextension` |
| `awscontainerinsightreceiver` | filterprocessor | prometheusexporter | |
| | resourcedetectionprocessor | datadogexporter | |
| | metricsgenerationprocessor | dynatraceexporter | |
| | cumulativetodeltaprocessor | sapmexporter | |
| | deltatorateprocessor | signalfxexporter | |
| | | logzioexporter | |

\* Note that the `awsprometheusremotewriteexporter` has been removed in v0.21.0. Users who want to send metrics to Amazon Managed Service for Prometheus will need to instead use the [Prometheus Remote Write Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/prometheusremotewriteexporter/README.md) along with the [Sigv4 Authenticator Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/sigv4authextension/README.md) to achieve the same result.

#### ADOT Collector AWS Components

* [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector/)
* [Trace X-Ray Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/awsxrayexporter)
* [Trace X-Ray Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsxrayreceiver)
* [Metrics EMF Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/awsemfexporter)
* [Metrics ContainerInsightReceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awscontainerinsightreceiver)
* [ECS Container Metrics Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsecscontainermetricsreceiver)
* [ECS Observer Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/observer/ecsobserver)
* [SigV4 Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/sigv4authextension)
* [AWS Proxy Extension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/awsproxy)

| [prometheusreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/prometheusreceiver#prometheus-receiver) | [attributesprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/attributesprocessor#attributes-processor) | [`awsxrayexporter`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/awsxrayexporter) | [healthcheckextension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/healthcheckextension#health-check) |
| [otlpreceiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver#otlp-receiver) | [resourceprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor#resource-processor) | [`awsemfexporter`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/awsemfexporter) | [pprofextension](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/pprofextension#performance-profiler) |
| [`awsecscontainermetricsreceiver`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsecscontainermetricsreceiver) | [batchprocessor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor#batch-processor) | [prometheusremotewriteexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/prometheusremotewriteexporter#prometheus-remote-write-exporter) | [zpagesextension](https://github.com/open-telemetry/opentelemetry-collector/tree/main/extension/zpagesextension#zpages) |
| [`awsxrayreceiver`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsxrayreceiver) | [memorylimiterprocessor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiterprocessor#memory-limiter-processor) | [loggingexporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/loggingexporter#logging-exporter) | [`ecsobserver`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/observer/ecsobserver) |
| [statsdreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/statsdreceiver#statsd-receiver) | [probabilisticsamplerprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/probabilisticsamplerprocessor#probabilistic-sampling-processor) | [otlpexporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter) | [`awsproxy`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/awsproxy) |
| [zipkinreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/zipkinreceiver#zipkin-receiver) | [metricstransformprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricstransformprocessor#metrics-transform-processor) | [fileexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/fileexporter#file-exporter) | [ballastextention](https://github.com/open-telemetry/opentelemetry-collector/tree/main/extension/ballastextension#memory-ballast) |
| [jaegerreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/jaegerreceiver#jaeger-receiver) | [spanprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/spanprocessor#span-processor) | [otlphttpexporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter#otlphttp-exporter) | [`sigv4authextension`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/sigv4authextension) |
| [`awscontainerinsightreceiver`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awscontainerinsightreceiver) | [filterprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor#filter-processor) | [prometheusexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/prometheusexporter#prometheus-exporter) | |
| | [resourcedetectionprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#resource-detection-processor) | [datadogexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/datadogexporter#datadog-exporter) | |
| | [metricsgenerationprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricsgenerationprocessor#metrics-generation-processor) | [dynatraceexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/dynatraceexporter#dynatrace-exporter) | |
| | [cumulativetodeltaprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/cumulativetodeltaprocessor#cumulative-to-delta-processor) | [sapmexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/sapmexporter#sapm-exporter) | |
| | [deltatorateprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/deltatorateprocessor#delta-to-rate-processor) | [signalfxexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/signalfxexporter#signalfx-metrics-exporter) | |
| | | [logzioexporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/logzioexporter#logzio-exporter) | |

### Getting Started

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.26.0
v0.27.0
11 changes: 1 addition & 10 deletions cmd/awscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,13 @@ func setCollectorConfigFromExtraCfg(extraCfg *extraconfig.ExtraConfig) {

// newCommand constructs a new cobra.Command using the given settings.
func newCommand(params otelcol.CollectorSettings) *cobra.Command {
flagSet := config.Flags()
flagSet := config.Flags(featuregate.GlobalRegistry())
// build the Command we will use that only has config/set flags
rootCmd := &cobra.Command{
Use: params.BuildInfo.Command,
Version: params.BuildInfo.Version,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {

flags := config.GetFeatureGatesFlag(flagSet)

for featureKey, featureEnable := range flags {
if err := featuregate.GlobalRegistry().Set(featureKey, featureEnable); err != nil {
return err
}
}

// Initialize provider after flags have been set
params.ConfigProvider = config.GetConfigProvider(flagSet)
col, err := otelcol.NewCollector(params)
Expand Down
9 changes: 9 additions & 0 deletions cmd/awscollector/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import (
"github.com/pkg/errors"
"golang.org/x/sys/windows/svc"

"go.opentelemetry.io/collector/featuregate"
"go.opentelemetry.io/collector/otelcol"

"github.com/aws-observability/aws-otel-collector/pkg/config"
)

func run(params otelcol.CollectorSettings) error {
Expand All @@ -44,6 +47,12 @@ func run(params otelcol.CollectorSettings) error {

func runService(params otelcol.CollectorSettings) error {
// do not need to supply service name when startup is invoked through Service Control Manager directly
flagSet := config.Flags(featuregate.GlobalRegistry())
// Parse all the flags manually. Flags need to be parsed so URIs can be set in confmap provider.
if err := flagSet.Parse(os.Args[1:]); err != nil {
return err
}
params.ConfigProvider = config.GetConfigProvider(flagSet)
if err := svc.Run("", otelcol.NewSvcHandler(params)); err != nil {
return errors.Wrap(err, "failed to start service")
}
Expand Down
Loading

0 comments on commit 3f3d840

Please sign in to comment.