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
64 changes: 23 additions & 41 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,57 +1,39 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.a
*.app
*.bak
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.dylib
*.exe
*.la
*.a
*.lai
*.lib

# Executables
*.exe
*.lo
*.log
*.o
*.obj
*.out
*.app

.DS_Store
*.slo
*.so

.cache/
.claude/
.vscode/

.DS_Store
compile_commands.json

__pycache__/
build-rum/
build/
httpd-*/
__pycache__/
httpd/
venv/

compile_commands.json
build-rum/
*.bak

# Integration tests
test/integration-test/.venv/
test/integration-test/uv.lock
test/integration-test/.pytest_cache/
test/integration-test/.coverage
test/integration-test/.pytest_cache/
test/integration-test/.venv/
test/integration-test/*.conf.tmp
test/integration-test/htmlcov/
test/integration-test/log-*/
test/integration-test/logs/
test/integration-test/*.conf.tmp
test/integration-test/*.log
test/integration-test/uv.lock
43 changes: 11 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing
# Contributing

## Fork, Clone, Branch and Create your PR

Expand All @@ -8,7 +8,7 @@ git submodule update --init --recursive
```

### Rules
- **Follow the pattern of what you already see in the code.**
- Follow the pattern of what you already see in the code.
- Follow the coding style.

# Development
Expand All @@ -27,37 +27,19 @@ Once you got a valid `python` installation, install all the dependencies with
pip install -r requirements.txt
````

Finally, you need HTTPD source code available. Use [scripts/setup-httpd.py](./scripts/setup-httpd.py) script:

````shell
python scripts/setup-httpd.py

usage: Download Apache HTTP Server and its dependencies [-h] [-v VERBOSE] [-o OUTPUT] version

positional arguments:
version HTTPD version to download

options:
-h, --help show this help message and exit
-v VERBOSE, --verbose VERBOSE
Increase verbosity level
-o OUTPUT, --output OUTPUT
Directory where HTTPD will be extracted
````

## Compiling

### Setup `httpd`

In order to build the module you have to configure httpd first:
In order to build the module you have to configure `httpd` with the [scripts/setup-httpd.py](./scripts/setup-httpd.py) script:

```sh
python scripts/setup-httpd.py -o httpd $HTTPD_VERSION
cd httpd

./configure --with-included-apr --prefix=$(pwd)/httpd-build --enable-mpms-shared="all"
cd httpd
./configure --with-included-apr --prefix=$(pwd)/httpd-build --enable-mpms-shared="all"
```

### Build the module
### Build the Module

CMake is our build system. If you are not familiar with CMake, read [the tutorial.](https://cmake.org/cmake/help/latest/guide/tutorial/index.html)

Expand All @@ -69,12 +51,9 @@ cmake --build build -j
```

### Testing
For now there are only integration tests. `docker-compose` orchestrate a runtime environment and the test suite interact with
It should be as simple as:

````sh
pytest test/integration-test
````
## How to debug
Run with `-X`
For now there are only [integration tests](./test/integration-test/).

## How to Debug

Run with `-X`.
5 changes: 5 additions & 0 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
add_subdirectory(dd-trace-cpp)

# Force POSITION_INDEPENDENT_CODE (PIC) because mod_datadog.so is loaded via
# dlopen, but dd-trace-cpp sets this based on BUILD_SHARED_LIBS, whereas we
# link with the static library.
set_target_properties(dd-trace-cpp-objects PROPERTIES POSITION_INDEPENDENT_CODE ON)
2 changes: 1 addition & 1 deletion deps/dd-trace-cpp
Submodule dd-trace-cpp updated 156 files
8 changes: 4 additions & 4 deletions mod_datadog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ target_compile_options(mod_datadog
PRIVATE -Wall -Wextra
)

add_dependencies(mod_datadog dd_trace_cpp-static httpd fmt)
add_dependencies(mod_datadog dd-trace-cpp-static httpd fmt)

target_include_directories(
mod_datadog
Expand All @@ -97,10 +97,10 @@ set_target_properties(

target_include_directories(mod_datadog PRIVATE httpd)

target_link_libraries(mod_datadog
target_link_libraries(mod_datadog
PRIVATE
dd_trace_cpp-static
httpd
dd-trace-cpp-static
httpd
fmt
)

Expand Down
2 changes: 1 addition & 1 deletion mod_datadog/src/mod_datadog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void init_tracer(datadog::tracing::TracerConfig& tracer_conf) {
// default value when no service name has been provided.
auto& service_name_metadata =
validated_config->metadata[datadog::tracing::ConfigName::SERVICE_NAME];
service_name_metadata.origin =
service_name_metadata.back().origin =
datadog::tracing::ConfigMetadata::Origin::DEFAULT;
}

Expand Down
4 changes: 0 additions & 4 deletions test/integration-test/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#
# Then source it before running tests:
# source .env
# make test

# Path to Apache apachectl binary
HTTPD_BIN_PATH=/usr/local/apache2/bin/apachectl

# Path to compiled mod_datadog.so module
HTTPD_MODULE_PATH=/path/to/mod_datadog.so
Expand Down
Loading