Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
123fd14
initaial setup for telemtry
Niroshan2001 Aug 25, 2025
e1008ad
automate link between parent and child
Niroshan2001 Sep 10, 2025
c939607
Merge remote-tracking branch 'origin/master' into opentelemetry
Sep 10, 2025
052062f
fix segmentation issue
Niroshan2001 Sep 13, 2025
2a50b41
open telemetry integrated successfully
Niroshan2001 Sep 13, 2025
3cfcf16
some overhead reduced
Niroshan2001 Sep 16, 2025
0cb9f7b
initially worked for workers
Niroshan2001 Sep 26, 2025
3e597f0
refactor the codebase
Niroshan2001 Sep 30, 2025
ad76f71
Merge branch 'master' of https://github.com/Niroshan2001/jasminegraph…
Niroshan2001 Oct 1, 2025
178358c
refactor codebase
Niroshan2001 Oct 2, 2025
0bb58dc
remove some files
Niroshan2001 Oct 5, 2025
92b1bbe
minor changes
Niroshan2001 Oct 6, 2025
a3d2806
fix style issue
Niroshan2001 Oct 6, 2025
001c32b
add jasminegraph-prerequisites:20250930T172442
Niroshan2001 Oct 7, 2025
b40cf82
update dockerfile
Niroshan2001 Oct 7, 2025
b785906
fix syle issue
Niroshan2001 Oct 7, 2025
6e08022
comment initialization
Niroshan2001 Oct 8, 2025
5dcfec9
add isTelemetrEnabled
Niroshan2001 Oct 8, 2025
c66af38
initiallized
Niroshan2001 Oct 10, 2025
66ab684
fix tests
Niroshan2001 Oct 10, 2025
f514393
fix style issue
Niroshan2001 Oct 18, 2025
2465fd2
fixing segmentation fault
Niroshan2001 Oct 18, 2025
a4ed227
fix style issue
Niroshan2001 Oct 18, 2025
a3d9c50
fix style
Niroshan2001 Oct 18, 2025
8187284
disable telemetry for unit test
Niroshan2001 Oct 19, 2025
d4e7419
fix style
Niroshan2001 Oct 19, 2025
c20af39
minor changes
Niroshan2001 Oct 21, 2025
028c492
fix style issue
Niroshan2001 Oct 21, 2025
6d3d56b
add global exit handler
Niroshan2001 Oct 21, 2025
26ce24c
fix style issue
Niroshan2001 Oct 21, 2025
0406bbc
create a compile-time flag
Niroshan2001 Oct 21, 2025
0531f04
modify cmake
Niroshan2001 Oct 21, 2025
683ba36
fix issue
Niroshan2001 Oct 21, 2025
d82a13a
add uniqur_ptr
Niroshan2001 Oct 21, 2025
4a12200
Merge branch 'master' of https://github.com/Niroshan2001/jasminegraph…
Niroshan2001 Oct 22, 2025
b7226c3
delete trace_api
Niroshan2001 Oct 22, 2025
f69c830
fix build issue
Niroshan2001 Oct 22, 2025
c9aa1f3
minor changes
Niroshan2001 Oct 22, 2025
5bedd0f
add conditional declarations
Niroshan2001 Oct 23, 2025
50be72b
minor change
Niroshan2001 Oct 23, 2025
7fd5328
modify CmakeList
Niroshan2001 Oct 23, 2025
2996850
minor changes
Niroshan2001 Oct 24, 2025
f973620
fix some issue
Niroshan2001 Oct 24, 2025
4bfd204
add a stub implementation
Niroshan2001 Oct 24, 2025
9de4d38
change to jasminegraph-prerequisites:20241231T070657 in test
Niroshan2001 Oct 25, 2025
e1653a7
fix style issue
Niroshan2001 Oct 25, 2025
2940e18
replace cout, cerr with loggers
Niroshan2001 Oct 27, 2025
4442408
address other comments
Niroshan2001 Oct 27, 2025
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
5 changes: 5 additions & 0 deletions .github/workflows/resources/unit-test-conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ spec:
containers:
- name: jasminegraph-container
image: jasminegraph:unit
env:
- name: TEST_MODE
value: "true"
- name: DISABLE_TELEMETRY
value: "true"
volumeMounts:
- name: host-volume
mountPath: /home/ubuntu/software/jasminegraph/coverage
Expand Down
55 changes: 51 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Build type not specified, setting to RelWithDebInfo for VTune profiling")
endif()



set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(Protobuf REQUIRED)
find_package(CURL REQUIRED)

set(HEADERS globals.h
src/backend/JasmineGraphBackend.h
Expand Down Expand Up @@ -91,6 +91,7 @@ set(HEADERS globals.h
src/util/hdfs/HDFSStreamHandler.h
src/partitioner/stream/HDFSMultiThreadedHashPartitioner.h
src/query/processor/cypher/util/Const.h
src/util/telemetry/OpenTelemetryUtil.h
src/nativestore/MetaPropertyLink.h
src/nativestore/MetaPropertyEdgeLink.h
src/query/processor/cypher/queryplanner/Operators.h
Expand Down Expand Up @@ -160,6 +161,8 @@ set(SOURCES src/backend/JasmineGraphBackend.cpp
src/util/kafka/InstanceStreamHandler.cpp
src/util/logger/Logger.cpp
src/util/scheduler/SchedulerService.cpp
src/util/telemetry/OpenTelemetryUtil.cpp
src/util/telemetry/TelemetryInitializer.cpp
src/k8s/K8sInterface.cpp
src/nativestore/NodeManager.cpp
src/nativestore/NodeBlock.cpp
Expand Down Expand Up @@ -284,8 +287,8 @@ target_link_libraries(JasmineGraphLib PRIVATE /usr/lib/x86_64-linux-gnu/libflatb
target_link_libraries(JasmineGraphLib PRIVATE /usr/lib/x86_64-linux-gnu/libjsoncpp.so)
target_link_libraries(JasmineGraphLib PRIVATE /usr/local/lib/libcppkafka.so)
target_link_libraries(JasmineGraphLib PRIVATE /usr/local/libhdfs3/lib/libhdfs3.so)
target_link_libraries(JasmineGraph JasmineGraphLib)
target_link_libraries(JasmineGraph curl)
target_link_libraries(JasmineGraph PRIVATE JasmineGraphLib)
target_link_libraries(JasmineGraph PRIVATE curl)

include_directories(/usr/local/libhdfs3/include/hdfs/)
include_directories(/usr/include/oneapi/)
Expand All @@ -300,6 +303,50 @@ target_link_libraries(JasmineGraphLib PRIVATE yaml-cpp)
target_link_libraries(JasmineGraphLib PRIVATE curl)
target_link_libraries(JasmineGraphLib PRIVATE antlr4-runtime)

# Option to enable/disable OpenTelemetry
option(ENABLE_OPENTELEMETRY "Enable OpenTelemetry support" ON)

# Disable OpenTelemetry for DEBUG builds to avoid issues in unit tests
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(ENABLE_OPENTELEMETRY OFF)
message(STATUS "DEBUG build detected - disabling OpenTelemetry to prevent test issues")
endif()

# Conditionally find and link OpenTelemetry packages
if(ENABLE_OPENTELEMETRY)
# Find OpenTelemetry packages
find_package(opentelemetry-cpp REQUIRED)
find_package(PkgConfig REQUIRED)

# Find nlohmann_json package for OpenTelemetry
find_package(nlohmann_json REQUIRED)

# OpenTelemetry libraries for native tracing support (without gRPC)
target_link_libraries(JasmineGraphLib PRIVATE opentelemetry-cpp::api)
target_link_libraries(JasmineGraphLib PRIVATE opentelemetry-cpp::sdk)
target_link_libraries(JasmineGraphLib PRIVATE opentelemetry-cpp::trace)
target_link_libraries(JasmineGraphLib PRIVATE opentelemetry-cpp::metrics)
target_link_libraries(JasmineGraphLib PRIVATE opentelemetry-cpp::ostream_span_exporter)
target_link_libraries(JasmineGraphLib PRIVATE opentelemetry-cpp::otlp_http_exporter)
target_link_libraries(JasmineGraphLib PRIVATE nlohmann_json::nlohmann_json)

# Link main executable with OpenTelemetry libraries
target_link_libraries(JasmineGraph PRIVATE opentelemetry-cpp::api)
target_link_libraries(JasmineGraph PRIVATE opentelemetry-cpp::sdk)
target_link_libraries(JasmineGraph PRIVATE opentelemetry-cpp::trace)
target_link_libraries(JasmineGraph PRIVATE opentelemetry-cpp::metrics)
target_link_libraries(JasmineGraph PRIVATE opentelemetry-cpp::ostream_span_exporter)
target_link_libraries(JasmineGraph PRIVATE opentelemetry-cpp::otlp_http_exporter)
target_link_libraries(JasmineGraph PRIVATE nlohmann_json::nlohmann_json)

message(STATUS "OpenTelemetry support enabled - linking OpenTelemetry libraries")
else()
message(STATUS "OpenTelemetry support disabled - skipping OpenTelemetry library linking")
endif()

# Include OpenTelemetry headers
target_include_directories(JasmineGraphLib PRIVATE /usr/local/include)


if (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
# Include google test
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM miyurud/jasminegraph-prerequisites:20250930T172442

RUN apt-get update && apt-get install -y libcurl4-openssl-dev sysstat nmon
RUN apt-get update && apt-get install -y libcurl4-openssl-dev sysstat nmon python3-setuptools
RUN rm -r /usr/lib/python3.8/distutils
RUN apt-get purge -y libpython3.8-dev python3.8-dev python3.8-distutils libpython3.8 python3.8

Expand Down
3 changes: 1 addition & 2 deletions conf/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ scrape_configs:
static_configs:
- targets: ["172.28.5.2:9090"]


- job_name: "pushgateway"
scrape_interval: 2s
static_configs:
- targets: ["172.28.5.3:9091"]
- targets: ["172.28.5.3:9091"]
40 changes: 38 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ services:
- kafka
- alloy
- grafana
- tempo
prometheus:
image: prom/prometheus:latest
ports:
- 9090:9090
volumes:
- './conf/prometheus.yaml:/etc/prometheus/prometheus.yml'
- './prometheus_data:/prometheus'
networks:
jasminenet:
ipv4_address: 172.28.5.2
Expand Down Expand Up @@ -64,8 +66,6 @@ services:
image: grafana/alloy:latest
ports:
- 12345:12345
- 4317:4317
- 4318:4318
volumes:
- ./config.alloy:/etc/alloy/config.alloy
- /var/run/docker.sock:/var/run/docker.sock
Expand Down Expand Up @@ -111,11 +111,47 @@ services:
isDefault: true
version: 1
editable: true
- name: Tempo
type: tempo
access: proxy
orgId: 1
url: 'http://tempo:3200'
basicAuth: false
isDefault: false
version: 1
editable: true
jsonData:
httpMethod: GET
serviceMap:
datasourceUid: 'prometheus'
- name: Prometheus
type: prometheus
access: proxy
orgId: 1
url: 'http://prometheus:9090'
basicAuth: false
isDefault: false
version: 1
editable: true
EOF
/run.sh
networks:
jasminenet:
ipv4_address: 172.28.5.6

tempo:
image: grafana/tempo:latest
ports:
- "3200:3200"
- "4317:4317"
- "4318:4318"
- "14268:14268"
volumes:
- ./tempo-config.yaml:/etc/tempo.yaml
command: -config.file=/etc/tempo.yaml
networks:
jasminenet:
ipv4_address: 172.28.5.9

networks:
jasminenet:
Expand Down
17 changes: 13 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ limitations under the License.
#include <unistd.h>

#include <future>
#include <iostream>

#include "globals.h"
#include "src/k8s/K8sWorkerController.h"
#include "src/server/JasmineGraphInstance.h"
#include "src/util/logger/Logger.h"
#include "src/util/scheduler/SchedulerService.h"
#include "src/util/telemetry/TelemetryInitializer.h"

unsigned int microseconds = 10000000;
JasmineGraphServer *server;
Expand Down Expand Up @@ -54,7 +54,10 @@ enum worker_mode_args {
WORKER_ENABLE_NMON = 7
};

void fnExit3(void) { delete (server); }
void fnExit3(void) {
shutdownOpenTelemetry();
delete (server);
}

int main(int argc, char *argv[]) {
atexit(fnExit3);
Expand All @@ -65,7 +68,7 @@ int main(int argc, char *argv[]) {
"<hostName> <serverPort> <serverDataPort> to start as worker");
return -1;
}
std::cout << argc << std::endl;
main_logger.info(std::to_string(argc));

int mode = atoi(argv[args::MODE]);
std::string JASMINEGRAPH_HOME = Utils::getJasmineGraphHome();
Expand All @@ -77,6 +80,9 @@ int main(int argc, char *argv[]) {
thread schedulerThread(SchedulerService::startScheduler);

if (mode == Conts::JASMINEGRAPH_RUNTIME_PROFILE_MASTER) {
// Initialize OpenTelemetry for master process
initializeOpenTelemetry();

std::string masterIp = argv[master_mode_args::MASTER_IP];
int numberOfWorkers = atoi(argv[master_mode_args::NUMBER_OF_WORKERS]);
std::string workerIps = argv[master_mode_args::WORKER_IPS];
Expand All @@ -97,6 +103,9 @@ int main(int argc, char *argv[]) {
} else if (mode == Conts::JASMINEGRAPH_RUNTIME_PROFILE_WORKER) {
main_logger.info(to_string(argc));

// Initialize OpenTelemetry for worker process
initializeWorkerTelemetry();

if (argc < 8) {
main_logger.info(
"Need 7 arguments. Use <mode> 2 <hostName> <masterIP> <serverPort> <serverDataPort> <enable-nmon> to "
Expand All @@ -113,7 +122,7 @@ int main(int argc, char *argv[]) {
int serverDataPort = atoi(argv[worker_mode_args::SERVER_DATA_PORT]);
enableNmon = argv[worker_mode_args::WORKER_ENABLE_NMON];

std::cout << "In worker mode" << std::endl;
main_logger.info("In worker mode");
instance = new JasmineGraphInstance();
instance->start_running(hostName, masterHost, serverPort, serverDataPort, enableNmon);

Expand Down
Loading