Skip to content

Commit c3231a9

Browse files
authored
Expand README for Apache module (#23)
* Add codeowners Fixes #9 * Fix team names inside codeowners * Use CODEOWNERS from otel-cpp-contrib * Update README
1 parent a50e7cf commit c3231a9

File tree

1 file changed

+62
-22
lines changed

1 file changed

+62
-22
lines changed

instrumentation/httpd/README.md

+62-22
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,73 @@
88

99
## Requirements
1010

11+
- httpd (Apache) ver. 2.4.x on Linux (Current release tested only with Ubuntu LTS 18.04 & 20.04)
12+
13+
### Usage
14+
15+
For manual build please check below. Otherwise please use one of the [released versions](/../releases).
16+
17+
### Installation
18+
19+
Mod_otel works as a module which is loaded when Apache starts. It is written in C++ therefore standard library has to be included as well. Below is an example of lines which should be added to your configuration file (usually `/etc/httpd/conf.d` or equivalent):
20+
21+
```
22+
LoadFile /usr/lib/x86_64-linux-gnu/libstdc++.so.6
23+
LoadModule otel_module $SCRIPT_DIR/bazel-out/k8-opt/bin/otel.so
24+
```
25+
26+
Please check that module is loaded correctly with command `apache2ctl configtest`
27+
28+
### Configuration
29+
30+
Below is the list of possible OpenTelemetry directives.
31+
32+
__OpenTelemetryExporter__
33+
Configures exporter to be used. At the moment only one global exporter is allowed for entire daemon. Possible values for this setting are:
34+
- `file` - to export to a file
35+
- `otlp` - to export using the OpenTelemetry Protocol
36+
37+
__OpenTelemetryPath__
38+
This option specifies file to which to export when `file` exporter is used. If no `OpenTelemetryPath` is specified then spans goes to standard error output which is apache error log.
39+
40+
__OpenTelemetryEndpoint__
41+
OpenTelemetryEndpoint specifies where to export spans when OTLP is used. Put hostname and then port. Example value: `host.docker.internal:55680`
42+
43+
__OpenTelemetryBatch__
44+
This directive takes 3 numerical arguments for batch processing:
45+
- Max Queue Size
46+
- Delay (in milliseconds, 1000 = 1s)
47+
- Max Export Batch Size
48+
-
49+
For example `OpenTelemetryBatch 10 5000 5`
50+
51+
__OpenTelemetryPropagators__
52+
OpenTelemetryPropagators sets which context propagator should be used (defaults to none). Currently supported values are:
53+
- `trace-context`
54+
- `b3`
55+
- `b3-multiheader`
56+
57+
__OpenTelemetryIgnoreInbound__
58+
OpenTelemetryIgnoreInbound indicates that we don't trust incoming context. This is a safe default when httpd is an edge server with traffic from Internet. Set it to false only if you run httpd in safe/trusted environment. Possbile values are `on` and `off` (defaults to on).
59+
60+
__OpenTelemetrySetAttribute__
61+
Allows to add extra attribute for each span. It takes two text arguments. For example `OpenTelemetrySetAttribute foo bar`
62+
63+
List of configuration options can be found in [provided configuration file](./opentelemetry.conf)
64+
65+
## Development
66+
67+
### Requirements
68+
1169
- C++11
1270
- [OpenTelemetry-Cpp](https://github.com/open-telemetry/opentelemetry-cpp)
13-
- httpd (Apache) ver. 2.4.x on Linux (Current release tested only with Ubuntu LTS 18.04)
1471
- Bazel 3.7.x
1572

16-
## Build + development
17-
73+
### Build
1874
Build can be done within docker or alternatively check Development section for Ubuntu below. Execute: `make build` to start build process.
1975

2076
After build is successful enable module for httpd (Apache) the `httpd_install_otel.sh` (prepared for Docker Image) script can be used for this.
2177

22-
### Development
23-
2478
For development purposes (to get inside docker) execute `make start` and `make devsh` for each extra terminal.
2579

2680
Build is done with Bazel. Execute: `./build.sh` and it should create file `otel.so` inside `bazel-out/k8-opt/bin` directory.
@@ -35,7 +89,7 @@ ln -s /mnt/host src
3589

3690
When local changes are made, you need to restart the `httpd` server to load new version of library, to do that: `apachectl stop; ./build.sh && apachectl start`
3791

38-
### Development (Ubuntu)
92+
### Prerequisites (Ubuntu)
3993

4094
On Ubuntu you need packages listed here: [setup_environment.sh](./setup_environment.sh) which are prerequisites to compile opentelemetry-cpp and here: [setup-buildtools.sh](./setup-buildtools.sh) for apache development stuff. Then just execute [bulid.sh](./build.sh).
4195

@@ -47,23 +101,9 @@ Please make sure that code is well formatted with this command:
47101
./tools/check-formatting.sh
48102
```
49103

104+
when contributing.
105+
50106
### Testing
51107

52108
Integration tests exists in `tests` directory. Please run `run-all.sh` to check functionality.
53109

54-
## Configuration
55-
56-
At the moment only one global exporter is allowed for entire daemon. Include it following way:
57-
58-
```
59-
<IfModule mod_otel.cpp>
60-
OpenTelemetryExporter file
61-
OpenTelemetryPath /tmp/spans
62-
</IfModule>
63-
```
64-
65-
in a master configuration which usually is in `/etc/apache2` directory.
66-
67-
If no `OpenTelemetryPath` is specified then spans goes to standard error output which is apache error log.
68-
69-
More detailed information about configuration options can be found in [provided configuration file](./opentelemetry.conf)

0 commit comments

Comments
 (0)