Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running OpenTelemetry collector #181

Merged
merged 5 commits into from
Oct 23, 2023
Merged

Allow running OpenTelemetry collector #181

merged 5 commits into from
Oct 23, 2023

Conversation

JamieMagee
Copy link
Contributor

This PR adds the ability to run an OpenTelemetryCollector container image alongside the proxy and updater image. This depends on dependabot/dependabot-core#8210, which adds the OpenTelemetry SDK to dependabot-core.

The main changes in this PR are:

  • The OpenTelemetry collector is run after the proxy container, but before the updater container
  • 3 new CLI flags:
    • enable-opentelemetry a boolean flag to control if the OpenTelemetry collector container should be created, and the OTEL_ENABLED environment variable should be passed to the updater container

    • collector-image a string flag that controls which container image to use for the OpenTelemetry collector. Defaults to ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest. See the Dockerfile for this container image here

    • collector-config a string flag that sets a path to OpenTelemetry collector YAML configuration. I've been using the following for testing:

      Click to expand
      receivers:
        otlp:
          protocols:
            grpc:
      
      exporters:
        debug:
      
      processors:
        batch:
      
      service:
        pipelines:
          traces:
            receivers: [otlp]
            processors: [batch]
            exporters: [debug]
          metrics:
            receivers: [otlp]
            processors: [batch]
            exporters: [debug]

@JamieMagee JamieMagee requested a review from a team as a code owner October 18, 2023 15:22
Copy link

@jpinz jpinz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some questions/comments.

cmd/dependabot/internal/cmd/test.go Outdated Show resolved Hide resolved
cmd/dependabot/internal/cmd/test.go Show resolved Hide resolved
cmd/dependabot/internal/cmd/update.go Outdated Show resolved Hide resolved
cmd/dependabot/internal/cmd/update.go Show resolved Hide resolved
internal/infra/open_telemetry.go Show resolved Hide resolved
internal/infra/updater.go Outdated Show resolved Hide resolved
Copy link
Member

@jakecoffman jakecoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this might change if we decide on a different architecture so let's hold off merging this until then.

internal/infra/run.go Outdated Show resolved Hide resolved
@JamieMagee JamieMagee requested a review from jpinz October 18, 2023 21:19
@jakecoffman jakecoffman enabled auto-merge (squash) October 23, 2023 17:58
@jakecoffman jakecoffman merged commit dfcbba8 into dependabot:main Oct 23, 2023
41 checks passed
@JamieMagee JamieMagee deleted the jamiemagee/opentelemetry-collector branch October 26, 2023 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants