Axway APIM Integration with OpenTelemetry using OpenTelemetry Java SDK
This artefact tested with following version:
- V7.7 May 2024
In build.gradle
file, update dependencies location:
- Set the variable
apim_folder
to you API-Gateway installation folder (e.g.opt/Axway/APIM/apigateway
)
gradlew clean jar
Copy following jar files
-
Copy opentelemetry-apim-agent--x.x.x.jar file to apigateway/ext/lib
-
Copy Aspectj weaver - aspectjweaver-1.9.6.jar to apigateway/ext/lib
-
Copy opentelmetry sdk jar files to apigateway/ext/lib
-
Create a file named jvm.xml under APIGATEWAY_INSTALL_DIR/apigateway/conf/
<ConfigurationFragment> <VMArg name="-javaagent:/home/axway/Axway-7.7.0/apigateway/ext/lib/aspectjweaver-1.9.22.1.jar"/> </ConfigurationFragment>
-
Restart API Gateway instances
- Start Jaeger server
docker run --name jaeger -e COLLECTOR_OTLP_ENABLED=true -p 16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:1.49
- Environment variables for API Gateway to send metrics to Jaeger
export OTEL_EXPORTER_OTLP_ENDPOINT=http://10.129.61.129:4317
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
export OTEL_TRACES_EXPORTER=otlp
export OTEL_SERVICE_NAME=apim-gw
export OTEL_METRICS_EXPORTER=none
- Restart API Gateway
- Create a licence key
- Environment variables for API Gateway to send metrics to New Relic
export OTEL_SERVICE_NAME=api-gw
export OTEL_EXPERIMENTAL_EXPORTER_OTLP_RETRY_ENABLED=true
export OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=BASE2_EXPONENTIAL_BUCKET_HISTOGRAM
export OTEL_EXPERIMENTAL_RESOURCE_DISABLED_KEYS=process.command_args
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net
export OTEL_EXPORTER_OTLP_HEADERS=api-key=<<license key>>
export OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT=4095
export OTEL_EXPORTER_OTLP_COMPRESSION=gzip
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
- Restart API Gateway
-
Copy API key
- Goto https://us3.datadoghq.com/organization-settings/api-keys and copy the key
-
Update datadog/docker-compose.yaml with key and site parameter
environment:
- DD_API_KEY=<apikey>
- DD_SITE=us3.datadoghq.com
- Start OTEL collector
$docker-compose -f datadog/docker-compose.yaml start
- Setup environment variable for api gateway
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
export OTEL_TRACES_EXPORTER=otlp
export OTEL_SERVICE_NAME=apim-gw
export OTEL_METRICS_EXPORTER=none
- Restart API Gateway
-
Create a Dynatrace account. If you don’t have one, you can use a trial account.
-
create an access token that includes scopes for the following:
Ingest OpenTelemetry traces (openTelemetryTrace.ingest) Ingest metrics (metrics.ingest) - Currently not used Ingest logs (logs.ingest) - currently not used For details, see Dynatrace API – Tokens and authentication in the Dynatrace documentation.
-
Update dynatrace/docker-compose.yaml with api key and dynatrace endpoint
environment:
- DT_API_TOKEN=<Access Token>
- DT_ENDPOINT=https://{your-env-id}.live.dynatrace.com/api/v2/otlp
- Start OTEL collector
$docker-compose -f dynatrace/docker-compose.yaml start
- Setup environment variable for api gateway
export OTEL_EXPORTER_OTLP_ENDPOINT=http://loclhost:4317
export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
export OTEL_TRACES_EXPORTER=otlp
export OTEL_SERVICE_NAME=apim-gw
export OTEL_METRICS_EXPORTER=none
- Restart API Gateway
- Policy exposed as Endpoint.
- API manager Traffic
- API Repository defined in Policystudio
- API Manager UI traffic
- API Manager REST API call.
- Servlet defined in Policystudio.
Please read Contributing.md for details on our code of conduct, and the process for submitting pull requests to us.