Deploy a sample application to test the Amazon Distro for OpenTelemetry Collector
The sample application will generate and send OTLP data to any of the services that you have configured through the Amazon Distro for OpenTelemetry (ADOT) Collector deployment. This step is optional if you already have an application running inside your cluster that can produce data. Consult your application's documentation to ensure that data is sent to the correct endpoints.
The sample application and traffic generator were largely taken from an example in the
ADOT Collector repositorydocker-compose.yaml
file was translated to
Kubernetes resources using the Kompose
tool
To apply the traffic generator and sample application, do the following steps.
-
Download the
traffic-generator.yaml
file to your computer. You can also view the fileon GitHub. curl -O https://raw.githubusercontent.com/aws-observability/aws-otel-community/master/sample-configs/traffic-generator.yaml
-
In
traffic-generator.yaml
, make sure that the secondkind
value reflects your mode. For more information, see Deploy the ADOT Collectoron GitHub. kind:
Deployment
traffic-generator.yaml
makeshttp
calls to the Kubernetes servicesample-app:4567
. This allows the traffic generator to interact with the sample application on port4567
.sample-app
resolves to the IP address of thesample-app
pod. -
Apply
traffic-generator.yaml
to your cluster.kubectl apply -f traffic-generator.yaml
-
Download the
sample-app.yaml
file to your computer. You can also view the fileon GitHub. curl -O https://raw.githubusercontent.com/aws-observability/aws-otel-community/master/sample-configs/sample-app.yaml
-
In
sample-app.yaml
, replace the following with your own Amazon Web Services Region:value: "
"<YOUR_AWS_REGION>
The following actions are defined by
sample-app.yaml
:-
The Service resource configures
port: 4567
to allow HTTP requests for the traffic generator. -
The Deployment resource configures some environment variables:
-
The
LISTEN_ADDRESS
is configured to0.0.0.0:4567
for HTTP requests from the traffic generator. -
The
OTEL_EXPORTER_OTLP_ENDPOINT
has a value ofhttp://my-collector-collector:4317
.my-collector-collector
is the name of the Kubernetes service that allows the sample application to interact with the ADOT Collector on port4317
. In the ADOT Collector configuration, the ADOT Collector receives metrics and traces from an endpoint:0.0.0.0:4317
.
-
-
-
In
sample-app.yaml
, update thevalue
forOTEL_EXPORTER_OTLP_ENDPOINT
if it doesn't match your collector service name.For example, X-Ray requires replacing
http://my-collector-collector:4317
withhttp://my-collector-xray-collector:4317
. -
Apply
sample-app.yaml
to your cluster.kubectl apply -f sample-app.yaml