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

feat(fargate): use adot image for otel #2481

Merged
merged 34 commits into from
Mar 4, 2024
Merged

Conversation

InesNi
Copy link
Contributor

@InesNi InesNi commented Feb 6, 2024

Description

Running AWS Distro for OpenTelemetry (ADOT) as a sidecar in Fargate in place of the Datadog agent in order to enable supporting multiple publish-metrics reporters rather than just Datadog.

Context

Some observability platforms can't ingest OTLP data directly, but through either OpenTelemetry Collector or their own agent. Currently Artillery AWS Fargate runs support only one such platform - Datadog, by running the Datadog agent as a sidecar.

In order to enable providing Fargate support for other such reporters (primarily Cloudwatch reporter), in this PR the Datadog agent is replaced by ADOT.

ADOT provides an array of built-in components including exporters for Datadog, AWS X-Ray, Cloudwatch, Splunk (SAML and SignalFX), Prometheus etc. Due to this implementing ADOT will enable providing tracing support for multiple platforms with one sidecar.

Implementation

Multiple components needed to be implemented in order to configure and run ADOT:

  • Access to a resolved config in the run-cluster.js file ( 3c03ac3, 17d0268, e2b9e68, ef54217, 3c03ac3) in order to:
    • check if ADOT sidecar needs to be set,
    • get the required reporter configurations
  • Vendor specific translator functions (7de3f85):
    • translate the reporter configuration into OTel Collector configuration (used by ADOT),
    • provide any additional environment variables that need to be provided to ADOT
  • In order for ADOT to use our custom configuration(6aacc28):
    • SSM parameter whose value is the full custom configuration is created

    • The AOT_CONFIG_CONTENT variable that points to the created parameter is set in the ADOT task definition

    • Any environment variables required by the custom config are provided in task overrides

    • The SSM parameter is deleted on cleanup

Testing

  • Manually tested with both Playwright and HTTP engine scenarios.
  • Unit tests added on publish-metrics side for functions in vendor-adot.js
  • Unit test on CLI side added for new applyScriptChanges function responsible for resolving templates in config
  • e2e test added on CLI side

@InesNi InesNi changed the title feat(fargate): use generic adot image for otel feat(fargate): use adot image for otel Feb 6, 2024
@InesNi InesNi force-pushed the nidhi-art-1585-implement-adot branch 2 times, most recently from c8c6757 to 62480cd Compare February 7, 2024 13:23
@InesNi InesNi force-pushed the nidhi-art-1585-implement-adot branch from 18e76ee to 14f399b Compare February 7, 2024 13:58
@InesNi InesNi marked this pull request as ready for review February 7, 2024 16:37
@InesNi InesNi requested a review from a team February 8, 2024 11:44
@InesNi InesNi force-pushed the nidhi-art-1585-implement-adot branch from 66b5cb3 to c22c38e Compare February 15, 2024 16:59
return resolve(context);
}
}
);
});
}

async function createADOTDefinitionIfNeeded(context) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we agreed @hassy , I'm filtering the publish-metrics config in a separate function here before resolving the config and env vars for ADOT.

However maybe it can be moved into the resolveADOTConfigSettings to allow for better separation of concerns: everything publish-metrics related would get done on publish-metrics side , and this function only does run-cluster type stuff (ssm, task definition, etc) ? Let me know.

@InesNi InesNi force-pushed the nidhi-art-1585-implement-adot branch from 124163b to 502753f Compare February 29, 2024 18:00
Copy link

socket-security bot commented Mar 1, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/chai@4.3.7 None +2 778 kB chai
npm/cheerio@1.0.0-rc.10 None +1 227 kB feedic
npm/ci-info@3.9.0 environment 0 26.1 kB sibiraj-s
npm/cli-highlight@2.1.11 Transitive: environment, filesystem +3 690 kB felixfbecker

🚮 Removed packages: npm/artillery-plugin-fake-data@1.0.2

View full report↗︎

@InesNi InesNi merged commit e22f369 into main Mar 4, 2024
15 checks passed
@InesNi InesNi deleted the nidhi-art-1585-implement-adot branch March 4, 2024 13:23
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.

2 participants