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

Factorize all the aggregator, forwarder and sender code used to send container_lifecycle, container_image and sbom payloads. #16084

Merged
merged 4 commits into from
Mar 17, 2023

Conversation

L3n41c
Copy link
Member

@L3n41c L3n41c commented Mar 13, 2023

What does this PR do?

Leverage the generic “EventPlatform” pipeline in the agent in order to factorize the aggregator, forwarder and sender code that was used to send the container_lifecycle, container_image and sbom payloads.

Motivation

Get rid of duplicated pieces of code.

Additional Notes

The contimage and sbom parts were introduced by #14962 and were inspired by the contlcycle one.
All three are replaced by the generic EventPlatform pipeline in this PR.

The new parameters for the “EventPlatform” pipeline were added in pkg/epforwarder/epforwarder.go

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Enable container_image and sbom with this snippet of values.yaml file for the public Helm chart:

datadog:
  env:
    - name: DD_CONTAINER_IMAGE_COLLECTION_METADATA_ENABLED
      value: "true"
    - name: DD_CONTAINER_IMAGE_COLLECTION_SBOM_ENABLED
      value: "true"
    - name: DD_CONTAINER_IMAGE_ENABLED
      value: "true"
    - name: DD_SBOM_ENABLED
      value: "true"
  confd:
    container_image.yaml: |
      init_config:
      instances:
        - chunk_size: 1
          new_images_max_latency_seconds: 10
          periodic_refresh_seconds: 60
    sbom.yaml: |
      init_config:
      instances:
        - chunk_size: 1
          new_sbom_max_latency_seconds: 10
          periodic_refresh_seconds: 60

and validate that container images are still visible in the app.

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the k8s/<min-version> label, indicating the lowest Kubernetes version compatible with this feature.
  • If applicable, the config template has been updated.

@L3n41c L3n41c added this to the 7.45.0 milestone Mar 13, 2023
@L3n41c L3n41c force-pushed the lenaic/factorize_forwarder branch 2 times, most recently from ac717af to a5b459d Compare March 14, 2023 13:56
used to send `container_lifecycle`, `container_image` and `sbom` payloads.
@L3n41c L3n41c force-pushed the lenaic/factorize_forwarder branch from a5b459d to b86b42f Compare March 14, 2023 17:22
@L3n41c L3n41c changed the title [WIP] Factorize all the aggregator, forwarder and sender code used to send container_lifecycle, container_image and sbom payloads. Factorize all the aggregator, forwarder and sender code used to send container_lifecycle, container_image and sbom payloads. Mar 14, 2023
@L3n41c L3n41c marked this pull request as ready for review March 14, 2023 20:36
@L3n41c L3n41c requested review from a team as code owners March 14, 2023 20:36
@L3n41c L3n41c requested a review from dineshg13 March 14, 2023 20:36
Copy link
Contributor

@paulcacheux paulcacheux left a comment

Choose a reason for hiding this comment

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

LGTM for team/agent-security related files

Copy link
Member

@NouemanKHAL NouemanKHAL left a comment

Choose a reason for hiding this comment

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

Approved for cmd/cluster-agent-cloudfoundry/subcommands/run/command.go owned by @DataDog/platform-integrations

Copy link
Member

@dineshg13 dineshg13 left a comment

Choose a reason for hiding this comment

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

LGTM from @DataDog/opentelemetry perspective.

@L3n41c L3n41c requested a review from vickenty March 15, 2023 16:24
@L3n41c L3n41c force-pushed the lenaic/factorize_forwarder branch from eeb719c to 17b0450 Compare March 15, 2023 22:50
@L3n41c L3n41c requested a review from vickenty March 16, 2023 12:20
Copy link
Contributor

@clamoriniere clamoriniere left a comment

Choose a reason for hiding this comment

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

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants