Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
on 04-27-2023 02:06 PM - edited on 03-15-2024 09:34 AM by Ryan.Paredez
This article provides step-by-step instructions and sample configuration files you can use to install an OTel collector as a sidecar in ECS Fargate, so you can monitor applications.
It includes two alternatives for configuring your application to use OpenTelemetry:
(a) by modifying your existing application image, or
(b) by injecting the OTel Java agent into your container.
REPLACE: | WITH: |
<<client-id>> <<client-secret>> <<token-url>> |
Replace with the values from step 1. |
<<tenant-url>> | Replace with the actual tenant URL |
processors:
batch:
timeout: 10s
send_batch_size: 8192
receivers:
otlp:
protocols:
grpc:
http:
exporters:
logging:
#loglevel: debug
verbosity: detailed
otlphttp:
logs_endpoint: https://<<tenant-url>>/data/v1/logs
metrics_endpoint: https://<<tenant-url>>/data/v1/metrics
traces_endpoint: https://<<tenant-url>>/data/v1/trace
auth:
authenticator: oauth2client
extensions:
oauth2client:
client_id: <<client-id>>
client_secret: <<client-secret>>
token_url: <<token-url>>
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp, logging]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlphttp]
extensions: [oauth2client]
telemetry:
logs:
level: "debug"
In the same directory as the collector-values.yaml file, create an otelcollector-dockerfile file with the following content:
# Sample Dockerfile for the OpenTelemetry Contrib Collector SideCar Container.
# This is provided for illustration purposes only, for full details
# please consult the product documentation: https://docs.appdynamics.com/
FROM debian
# Install Required Packages
RUN apt-get update && apt-get -y install curl && apt-get -y install openssl && apt-get -y install bash && apt-get clean
# Create a work directory to copy the Otel Collector artifacts
ENV APP_HOME /opt/otel
RUN mkdir -p ${APP_HOME}
WORKDIR ${APP_HOME}
# Download and extract Contrib version of Otel Collector artifacts to the work directory
RUN curl -L0 https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.75.0/otelcol-contrib_0.75.0_linux_386.tar.gz --output otelcol-contrib_0.75.0_linux_386.tar.gz
RUN tar -xvf otelcol-contrib_0.75.0_linux_386.tar.gz
RUN rm -rf otelcol-contrib_0.75.0_linux_386.tar.gz
# Copy the config file for Otel Collector to work directory
COPY collector-values.yaml ${APP_HOME}
# Expose the /opt/otel directory as a shared volume
#VOLUME ["/opt/otel"]
# Expose ports
EXPOSE 4317 4318 8888 8889 13133 55679
CMD ${APP_HOME}/otelcol-contrib --config ${APP_HOME}/collector-values.yaml
docker build -t otel-collector-contrib:latest --no-cache -f otelcollector-dockerfile .
docker tag otel-collector-contrib:latest <repository-url>/otel-collector-contrib:latest
docker push <repository-url>/otel-collector-contrib:latest
Option 1 | Configure your app to use OTel by modifying the existing application image
|
|
Option 2 | Configure your app to use OTel by injecting the (OTel) Java Agent into your application as an init container
|
At this stage, we have images for the:
ADD A CONTAINER FOR: | |
otel-java-agent |
|
otel-collector-contrib |
|
<your application> |
|
Environment Variables Template: KEY |
VALUE TYPE |
VALUE |
OTEL_SERVICE_NAME | value | Name of the Service |
OTEL_RESOURCE_ATTRIBUTES | value | service.namespace=name of the application |
JAVA_TOOL_OPTIONS | value | -javaagent:/opt/otel/aws-opentelemetry-agent.jar |
OTEL_LOGS_EXPORTER | value | otlp |
OTEL_TRACES_EXPORTER | value | otlp |
OTEL_EXPORTER_OTLP_INSECURE | value | true |
OTEL_PROPAGATORS | value | tracecontext,baggage,b3 |
"volumesFrom": [
{
"sourceContainer": "otel-java-agent"
}
],
"dependsOn": [
{
"containerName": "otel-java-agent",
"condition": "START"
}
]
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form