Adds a sidecar with an AWS Distro OpenTelemetry Collector. https://aws-otel.github.io/docs/setup/ecs
You also need to add either the Java SDK for OTel or a Java agent, to capture telemetry and send to this collector.
The OpenTelemetry Java agent may run by default in the Docker image. This method will tell the agent to disable itself.
You might want to do this to avoid overhead or error logs from failed connection attempts to the otel collector.
Returns a string representation of this construct.
Static
disableThe OpenTelemetry Java agent may run by default in the Docker image. This method will tell the agent to disable itself.
You might want to do this to avoid overhead or error logs from failed connection attempts to the otel collector.
Static
isChecks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
Any object
true if x
is an object created from a class which extends Construct
.
Methods to enable collection of Open Telemetry (otel) data of a FargateService using a docker container with an otel agent.
An example of a Java auto-instrumentation agent in Docker can be found in liflig-rest-baseline Dockerfile.
The agent must be configured to output metrics to a collector. That collector is what this construct provides. Usually, the agent is specified in the Dockerfile or as a dependency/library, and configured in the Dockerfile or in the application source code.
Use this construct on a FargateService by constructing a new instance of OpenTelemetryCollectors and calling the addOpenTelemetryCollectorSidecar method on it.
The sidecar exposes these ports to your service:
You can also disable the OpenTelemetry instrumentation agent for Java-based services, by setting the appropriate environment variable with disableOpenTelemetryJavaAgent:
See
OpenTelemetryCollectors.addOpenTelemetryCollectorSidecar