Dynatrace OneAgent SDK The primary purpose of this SDK is to facilitate end-to-end tracing of transactions. While other tracing frameworks are rather generic, the Dynatrace OneAgent SDK has more semantics to explicitly model remote calls, database requests, web requests, message passing, in-process context passing and more.
In order to use the Dynatrace OneAgent SDK you need to have access to the source code of the application in question. In languages like Java and Node.js you might have other possibilities to use the SDK even if you do not want or cannot modify the original code (aspects and monkey patching).
OneAgent automatically detects that your application is instrumented with the OneAgent SDK and immediately begins monitoring it.
Language specific SDKs are open source and published directly to GitHub: OneAgent SDK for Node.js OneAgent SDK for Java OneAgent SDK for C/C++ OneAgent SDK for Python OneAgent SDK for .NET
See http://www.mastertheboss.com/soa-cloud/openshift/deploying-jboss-eap-applications-on-openshift https://github.com/Dynatrace/OneAgent-SDK#oneagentsdk https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html-single/getting_started_with_jboss_eap_for_openshift_container_platform/index
oc new-project jbosseap-with-dynatraceonegentsdk
Create a secret with a Service Account Token at https://access.redhat.com/terms-based-registry/
Example: the user I created at https://access.redhat.com/terms-based-registry/ is 11009103|marcz2 oc create secret docker-registry marcsecret \ --docker-server=registry.redhat.io \ --docker-username="11009103|marcz2" \ --docker-password="<PASSWORD>" \ --docker-email=<EMAIL> oc secrets link default marcsecret --for=pull oc secrets link builder marcsecret
oc import-image jboss-eap-7/eap73-openjdk11-openshift-rhel8 --from=registry.redhat.io/jboss-eap-7/eap73-openjdk11-openshift-rhel8 --confirm oc replace --force -f https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates/eap73/templates/eap73-basic-s2i.json oc replace --force -f https://raw.githubusercontent.com/jboss-container-images/jboss-eap-7-openshift-image/7.3.x/templates/eap73-openjdk11-image-stream.json
for resource in \ eap73-openjdk11-amq-persistent-s2i.json \ eap73-openjdk11-amq-s2i.json \ eap73-openjdk11-basic-s2i.json \ eap73-openjdk11-https-s2i.json \ eap73-openjdk11-image-stream.json \ eap73-openjdk11-sso-s2i.json \ eap73-openjdk11-starter-s2i.json \ eap73-openjdk11-third-party-db-s2i.json \ eap73-openjdk11-tx-recovery-s2i.json do oc replace --force -f \ https://raw.githubusercontent.com/jboss-container-images/jboss-eap-7-openshift-image/7.3.x/templates/${resource} done
Add the following to the kitchesink/pom.xml at SOURCE_REPOSITORY_URL: <!-- Marc added https://mvnrepository.com/artifact/com.dynatrace.oneagent.sdk.java/oneagent-sdk --> <dependency> <groupId>com.dynatrace.oneagent.sdk.java</groupId> <artifactId>oneagent-sdk</artifactId> <version>1.7.0</version> <scope>compile</scope> </dependency>
See my kitchesink/pom.xml at https://github.com/marcredhat/jboss-eap-quickstarts/blob/7.3.x/kitchensink/pom.xml
Check IMAGE_STREAM_NAMESPACE below oc new-app --template=eap73-basic-s2i \ -p IMAGE_STREAM_NAMESPACE=jbosseap-with-dynatraceonegentsdk \ -p SOURCE_REPOSITORY_URL=https://github.com/marcredhat/jboss-eap-quickstarts \ -p SOURCE_REPOSITORY_REF=7.3.x-openshift \ -p CONTEXT_DIR=kitchensink
Note
|
The build process can take up to 20 minutes, use the commands below to check the progress. |
oc get bc NAME TYPE FROM LATEST eap-app Docker Dockerfile 2 eap-app-build-artifacts Source [email protected] 1
oc logs -f bc/eap-app-build-artifacts --follow oc logs -f bc/eap-app --follow
oc get pods NAME READY STATUS RESTARTS AGE eap-app-1-7x2fl 0/1 Running 0 63s eap-app-1-deploy 1/1 Running 0 67s eap-app-2-build 0/1 Completed 0 3m48s eap-app-build-artifacts-1-build 0/1 Completed 0 7m43s
oc expose svc eap-app
oc get route NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD eap-app eap-app-jbosseap-with-dynatraceonegentsdk.apps.ocp4.local eap-app <all> edge/Redirect None
oc logs eap-app-1-7x2fl | grep oneagent 04:14:52,919 DEBUG [org.jboss.as.config] (MSC service thread 1-1) VM Arguments: -D[Standalone] ..... -agentpath:/opt/dynatrace/oneagent/agent/bin/1.195.161.20200720-160625/linux-x86-64/liboneagentloader.so=loglevelcon=none,tenant=