Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions instrumentation/otel-webserver-module/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'cpp'
apply from: 'common.gradle'

def coverageEnabled = System.getProperty('enableCoverage')
def coverageEnabled = System.getenv('enableCoverage')

project.ext {
// To do a 32-bit build, pass "-Dos.arch=x86"
Expand Down Expand Up @@ -416,7 +416,7 @@ task lcovCapture(type: Exec) {
args '--output-file', tracefile, // resulting tracefile
'--capture', // capture counts for a user space program
'--directory', "${platBuildDir}" // location where the program was compiled
// '--no-external' // ignore data for external files
'--no-external' // ignore data for external files
}

task lcov(type: Exec) {
Expand All @@ -434,7 +434,7 @@ task lcov(type: Exec) {
args '--quiet', // do not print progress messages
'--output-file', tracefile, // resulting tracefile
'--remove', lcovCapture.tracefile, // remove files matching patterns from tracefile
'*/prebuilt/*', '*.pb.*' // list of patterns
'*/prebuilt/*', '*.pb.*', '/opt/rh/*', '/usr/include/*', '*.h', '*.hpp' // list of patterns
}

task coverageHtml(type: Exec) {
Expand Down
95 changes: 43 additions & 52 deletions instrumentation/otel-webserver-module/test/ApacheTesting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,58 @@
# Bash script for testing Apache Server

# Extract the agent
tar -xf ../build/appdynamics-webserver-sdk-x64-linux.tgz -C /opt
tar -xf ../build/opentelemetry-webserver-sdk-x64-linux.tgz -C /opt

cd /opt/appdynamics-sdk-native
cd /opt/opentelemetry-webserver-sdk

echo "Installing Apache Agent"
echo "Installing webserver module"
./install.sh

# Create a appdynamics_agent.conf file
echo "Copying agent config to appdynamics_agent file"
echo '
LoadFile /opt/appdynamics-sdk-native/sdk_lib/lib/libopentelemetry_common.so
LoadFile /opt/appdynamics-sdk-native/sdk_lib/lib/libopentelemetry_resources.so
LoadFile /opt/appdynamics-sdk-native/sdk_lib/lib/libopentelemetry_trace.so
LoadFile /opt/appdynamics-sdk-native/sdk_lib/lib/libopentelemetry_otlp_recordable.so
LoadFile /opt/appdynamics-sdk-native/sdk_lib/lib/libopentelemetry_exporter_ostream_span.so
LoadFile /opt/appdynamics-sdk-native/sdk_lib/lib/libopentelemetry_exporter_otlp_grpc.so
#Load the AppDynamics SDK
LoadFile /opt/appdynamics-sdk-native/sdk_lib/lib/libappdynamics_native_sdk.so
#Load the Apache Agent. In this example for Apache 2.2
LoadModule appdynamics_module /opt/appdynamics-sdk-native/WebServerAgent/Apache/libmod_appdynamics22.so
AppDynamicsEnabled ON
#AppDynamics Otel Exporter details
AppDynamicsOtelSpanExporter OTLP
AppDynamicsOtelExporterEndpoint example.com:14250
AppDynamicsOtelSpanProcessor Batch
AppDynamicsOtelSampler AlwaysOn
AppDynamicsServiceName cart
AppDynamicsServiceNamespace e-commerce
AppDynamicsServiceInstanceId 71410b7dec09
AppDynamicsOtelMaxQueueSize 1024
AppDynamicsOtelScheduledDelayMillis 3000
AppDynamicsOtelExportTimeoutMillis 30000
AppDynamicsOtelMaxExportBatchSize 1024
AppDynamicsResolveBackends ON
AppDynamicsTraceAsError ON
AppDynamicsReportAllInstrumentedModules OFF
AppDynamicsWebserverContext electronics e-commerce 71410b7jan13
AppDynamicsMaskCookie ON
AppDynamicsCookieMatchPattern PHPSESSID
AppDynamicsMaskSmUser ON
AppDynamicsDelimiter /
AppDynamicsSegment 2,3
AppDynamicsMatchfilter CONTAINS
AppDynamicsMatchpattern myapp
' >> /opt/appdynamics_agent.conf
LoadFile /opt/opentelemetry-webserver-sdk/sdk_lib/lib/libopentelemetry_common.so
LoadFile /opt/opentelemetry-webserver-sdk/sdk_lib/lib/libopentelemetry_resources.so
LoadFile /opt/opentelemetry-webserver-sdk/sdk_lib/lib/libopentelemetry_trace.so
LoadFile /opt/opentelemetry-webserver-sdk/sdk_lib/lib/libopentelemetry_otlp_recordable.so
LoadFile /opt/opentelemetry-webserver-sdk/sdk_lib/lib/libopentelemetry_exporter_ostream_span.so
LoadFile /opt/opentelemetry-webserver-sdk/sdk_lib/lib/libopentelemetry_exporter_otlp_grpc.so
#Load the ApacheModule SDK
LoadFile /opt/opentelemetry-webserver-sdk/sdk_lib/lib/libopentelemetry_webserver_sdk.so
#Load the Apache Module. In this example for Apache 2.2
LoadModule otel_apache_module /opt/opentelemetry-webserver-sdk/WebServerModule/Apache/libmod_apache_otel22.so
ApacheModuleEnabled ON
#ApacheModule Otel Exporter details
ApacheModuleOtelSpanExporter otlp
ApacheModuleOtelExporterEndpoint docker.for.mac.localhost:4317
# SSL Certificates
#ApacheModuleOtelSslEnabled ON
#ApacheModuleOtelSslCertificatePath
ApacheModuleOtelSpanProcessor Batch
ApacheModuleOtelSampler AlwaysOn
ApacheModuleOtelMaxQueueSize 2048
ApacheModuleOtelScheduledDelayMillis 3000
ApacheModuleOtelExportTimeoutMillis 50000
ApacheModuleOtelMaxExportBatchSize 512
ApacheModuleServiceName DemoService
ApacheModuleServiceNamespace DemoServiceNamespace
ApacheModuleServiceInstanceId DemoInstanceId
ApacheModuleResolveBackends ON
ApacheModuleTraceAsError ON
#ApacheModuleWebserverContext DemoService DemoServiceNamespace DemoInstanceId
ApacheModuleSegmentType first
ApacheModuleSegmentParameter 2
' > /opt/opentelemetry_module.conf

#Include appdynamics_agent.conf file in httpd.conf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - change name of file.

echo 'Include /opt/appdynamics_agent.conf' >> /etc/httpd/conf/httpd.conf
cp -f /opt/opentelemetry_module.conf /etc/httpd/conf.d/opentelemetry_module.conf

echo "Starting Apache Server"
apachectl restart # re-start the server
Expand Down
93 changes: 0 additions & 93 deletions instrumentation/otel-webserver-module/test/NginxTesting.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ std::shared_ptr<appd::core::TenantConfig> getConfig() {
config->setServiceInstanceId("dummy_instance_id");
config->setOtelExporterType("otlp");
config->setOtelExporterEndpoint("otel-collector:4317");
config->setOtelLibraryName("opentelemetry-apache");
return config;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ class MockPropagator : public context::propagation::TextMapPropagator
const context::Context &context) noexcept override {
InjectImpl(carrier);
}

MOCK_METHOD(void, ExtractImpl, (const context::propagation::TextMapCarrier &carrier));
MOCK_METHOD(void, InjectImpl, (context::propagation::TextMapCarrier &carrier));
MOCK_METHOD(bool, Fields, (nostd::function_ref<bool(nostd::string_view)> callback),
(const, noexcept, override));
};

#endif
14 changes: 7 additions & 7 deletions instrumentation/otel-webserver-module/test/unit/unit_test.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'../../include/util/',
'$(ANSDK_DIR)/googletest/1.10.0/include',
'$(ANSDK_DIR)/googletest/1.10.0/include',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/include/',
'$(ANSDK_DIR)/opentelemetry/1.2.0/include/',

'$(ANSDK_DIR)/apache-log4cxx/0.11.0/include',
'$(ANSDK_DIR)/apr/1.7.0/include',
Expand Down Expand Up @@ -48,12 +48,12 @@
'$(ANSDK_DIR)/apr/1.7.0/lib/libapr-1.a',
'$(ANSDK_DIR)/apr-util/1.6.1/lib/libaprutil-1.a',
'$(ANSDK_DIR)/expat/2.3.0/lib/libexpat.a',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_common.so',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_resources.so',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_trace.so',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_otlp_recordable.so',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_exporter_ostream_span.so',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_exporter_otlp_grpc.so',
'$(ANSDK_DIR)/opentelemetry/1.2.0/lib/libopentelemetry_common.so',
'$(ANSDK_DIR)/opentelemetry/1.2.0/lib/libopentelemetry_resources.so',
'$(ANSDK_DIR)/opentelemetry/1.2.0/lib/libopentelemetry_trace.so',
'$(ANSDK_DIR)/opentelemetry/1.2.0/lib/libopentelemetry_otlp_recordable.so',
'$(ANSDK_DIR)/opentelemetry/1.2.0/lib/libopentelemetry_exporter_ostream_span.so',
'$(ANSDK_DIR)/opentelemetry/1.2.0/lib/libopentelemetry_exporter_otlp_grpc.so',
],

'ldflags': [
Expand Down