Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opentelemetry version update for otel-webserver-module #115

Merged
merged 5 commits into from
Mar 16, 2022
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
3 changes: 3 additions & 0 deletions instrumentation/otel-webserver-module/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## [1.0.0] 2022-03-10

[Dependencies] Update Opentelemetry C++ SDK version to 1.2.0 from previous version 1.0.0-rc1 ([#115](https://github.com/open-telemetry/opentelemetry-cpp-contrib/pull/115/))
20 changes: 10 additions & 10 deletions instrumentation/otel-webserver-module/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,23 @@ RUN mkdir -p dependencies/apache-log4cxx/0.11.0 \
&& cd .. && rm -rf apache-log4cxx-0.11.0.tar.gz && rm -rf apache-log4cxx-0.11.0

# install opentelemetry
RUN mkdir -p dependencies/opentelemetry/1.0.0-rc1/lib \
&& mkdir -p dependencies/opentelemetry/1.0.0-rc1/include \
RUN mkdir -p dependencies/opentelemetry/1.2.0/lib \
&& mkdir -p dependencies/opentelemetry/1.2.0/include \
&& git clone https://github.com/open-telemetry/opentelemetry-cpp \
&& cd opentelemetry-cpp/ \
&& git checkout tags/v1.0.0-rc1 -b v1.0.0-rc1 \
&& git checkout tags/v1.2.0 -b v1.2.0 \
&& git submodule update --init --recursive \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DWITH_OTLP=ON -DCMAKE_INSTALL_PREFIX=/dependencies/opentelemetry/1.0.0-rc1 \
&& cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DWITH_OTLP=ON -DCMAKE_INSTALL_PREFIX=/dependencies/opentelemetry/1.2.0 \
&& cmake --build . --target all \
&& cd .. \
&& find . -name "*.so" -type f -exec cp {} /dependencies/opentelemetry/1.0.0-rc1/lib/ \; \
&& cp build/libopentelemetry_proto.a /dependencies/opentelemetry/1.0.0-rc1/lib \
&& cp -r api/include/ /dependencies/opentelemetry/1.0.0-rc1/ \
&& for dir in exporters/*; do if [ -d "$dir" ]; then cp -rf "$dir/include" /dependencies/opentelemetry/1.0.0-rc1/; fi; done \
&& cp -r sdk/include/ /dependencies/opentelemetry/1.0.0-rc1/ \
&& cp -r build/generated/third_party/opentelemetry-proto/opentelemetry/proto/ /dependencies/opentelemetry/1.0.0-rc1/include/opentelemetry/ \
&& find . -name "*.so" -type f -exec cp {} /dependencies/opentelemetry/1.2.0/lib/ \; \
&& cp build/libopentelemetry_proto.a /dependencies/opentelemetry/1.2.0/lib \
&& cp -r api/include/ /dependencies/opentelemetry/1.2.0/ \
&& for dir in exporters/*; do if [ -d "$dir" ]; then cp -rf "$dir/include" /dependencies/opentelemetry/1.2.0/; fi; done \
&& cp -r sdk/include/ /dependencies/opentelemetry/1.2.0/ \
&& cp -r build/generated/third_party/opentelemetry-proto/opentelemetry/proto/ /dependencies/opentelemetry/1.2.0/include/opentelemetry/ \
&& cd .. && rm -rf opentelemetry-cpp

# install googletest
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/otel-webserver-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Monitoring individual modules is crucial to the instrumentation of Apache web se
| Apr-util | 1.6.1 |
| Expat | 2.3.0 |
| Boost | 1.75.0 |
| Opentelemetry - C++ SDK | 1.0.0-rc1 |
| Opentelemetry - C++ SDK | 1.2.0 |
| Googletest | 1.10.0 |

*There are some libraries which are just used to generate Apache Header files
Expand Down
11 changes: 6 additions & 5 deletions instrumentation/otel-webserver-module/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,12 @@ task stageLibrary(type: Copy) {

from("src/sdk_lib/src/api/include/appdynamics.h") { it.into "sdk_lib" }
from(buildLibrary) { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.0.0-rc1/lib/libopentelemetry_common.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.0.0-rc1/lib/libopentelemetry_resources.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.0.0-rc1/lib/libopentelemetry_trace.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.0.0-rc1/lib/libopentelemetry_exporter_ostream_span.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.0.0-rc1/lib/libopentelemetry_exporter_otprotocol.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.2.0/lib/libopentelemetry_common.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.2.0/lib/libopentelemetry_resources.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.2.0/lib/libopentelemetry_trace.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.2.0/lib/libopentelemetry_otlp_recordable.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.2.0/lib/libopentelemetry_exporter_ostream_span.so") { it.into "sdk_lib/lib" }
from("${modDepDir}/opentelemetry/1.2.0/lib/libopentelemetry_exporter_otlp_grpc.so") { it.into "sdk_lib/lib" }
from("dist/appdynamics_sdk_log4cxx.xml.template") { it.into "conf" }
from("dist/install.${scriptExt}") { it.fileMode 0700 }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
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_otprotocol.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
Expand Down
13 changes: 7 additions & 6 deletions instrumentation/otel-webserver-module/src/build.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@
'$(ANSDK_DIR)/apache-log4cxx/0.11.0/lib/liblog4cxx.a',
'$(ANSDK_DIR)/boost/1.75.0/lib/libboost_filesystem.a',
'$(ANSDK_DIR)/boost/1.75.0/lib/libboost_system.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_exporter_ostream_span.so',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_exporter_otprotocol.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'
],

'include_dirs': [
Expand All @@ -64,7 +65,7 @@
'$(ANSDK_DIR)/boost/1.75.0/include',
'../include/util',
'../include/core',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/include/',
'$(ANSDK_DIR)/opentelemetry/1.2.0/include/',
],

'ldflags': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "opentelemetry/sdk/trace/samplers/parent.h"
#include "opentelemetry/sdk/trace/samplers/trace_id_ratio.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/exporters/otlp/otlp_exporter.h"
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter.h"
#include "opentelemetry/baggage/propagation/baggage_propagator.h"
#include <module_version.h>
#include <fstream>
Expand Down Expand Up @@ -124,15 +124,15 @@ OtelSpanExporter SdkHelperFactory::GetExporter(
LOG4CXX_WARN(mLogger, "Received unknown exporter type: " << type << ". Will create default(otlp) exporter");
type = OTLP_EXPORTER_TYPE;
}
opentelemetry::exporter::otlp::OtlpExporterOptions opts;
opentelemetry::exporter::otlp::OtlpGrpcExporterOptions opts;
opts.endpoint = config->getOtelExporterEndpoint();
if (config->getOtelSslEnabled()) {
opts.use_ssl_credentials = config->getOtelSslEnabled();
opts.ssl_credentials_cacert_path = config->getOtelSslCertPath();
LOG4CXX_TRACE(mLogger, "Ssl Credentials are enabled for exporter, path: "
<< opts.ssl_credentials_cacert_path);
}
exporter.reset(new opentelemetry::exporter::otlp::OtlpExporter(opts));
exporter.reset(new opentelemetry::exporter::otlp::OtlpGrpcExporter(opts));
}

LOG4CXX_INFO(mLogger, "Exporter created with ExporterType: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ 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_otprotocol.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
'$(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_otprotocol.so',
'$(ANSDK_DIR)/opentelemetry/1.0.0-rc1/lib/libopentelemetry_exporter_otlp_grpc.so',
],

'ldflags': [
Expand Down