Skip to content

Commit f6e7b7b

Browse files
authored
[systemd] remove systemd instructions (#130)
* [systemd] remove systemd instructions * remove examples from package
1 parent 44b2f68 commit f6e7b7b

File tree

4 files changed

+29
-117
lines changed

4 files changed

+29
-117
lines changed

.chloggen/remove_systemd.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: systemd
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Remove systemd instructions
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [68]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
We can remove systemD instructions as the LD_PRELOAD solution works just as well and applies to any software.
20+
21+
# If your change doesn't affect end users or the exported elements of any package,
22+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Include 'api' if there is a change to a library API.
27+
# Default: '[user]'
28+
change_logs: []

README.md

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@ Instrumentation agents:
3131

3232
## Activation and Configuration
3333

34-
The following methods are supported to manually activate and configure Auto Instrumentation after installation of the
35-
`opentelemetry-injector` deb/rpm package (requires `root` privileges):
36-
37-
- [System-wide](#system-wide-or-per-process)
38-
- [`Systemd` services only](#systemd-services-only)
39-
40-
> **Note**: To prevent conflicts and duplicate traces/metrics, only one method should be activated on the target system.
41-
42-
### System-wide or per process
34+
This method requires `root` privileges.
4335

4436
1. Add the path of the provided `/usr/lib/opentelemetry/libotelinject.so` shared object library to the
4537
[`/etc/ld.so.preload`](https://man7.org/linux/man-pages/man8/ld.so.8.html#FILES) file to activate Auto
@@ -121,59 +113,6 @@ Check the following for details about the auto-instrumtation agents and further
121113
- [Node.js](https://opentelemetry.io/docs/zero-code/js/configuration/)
122114
- [.NET](https://opentelemetry.io/docs/zero-code/dotnet/configuration/)
123115

124-
### `Systemd` services only
125-
126-
> **Note**: The following steps utilize a sample `systemd` drop-in file to activate/configure the provided agents for
127-
> all `systemd` services via default environment variables. `Systemd` supports many options, methods, and paths for
128-
> configuring environment variables at the system level or for individual services, and are not limited to the steps
129-
> below. Before making any changes, it is recommended to consult the documentation specific to your Linux distribution
130-
> or service, and check the existing configurations of the system and individual services for potential conflicts or to
131-
> override an environment variable for a particular service. For general details about `systemd`, see the
132-
> [`systemd` man page](https://www.freedesktop.org/software/systemd/man/index.html).
133-
134-
1. Copy the provided sample `systemd` drop-in file
135-
`/usr/lib/opentelemetry/examples/systemd/00-otelinject-instrumentation.conf` to the host's `systemd`
136-
[drop-in configuration directory](https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html) to
137-
activate Auto Instrumentation for ***all*** supported applications running as `systemd` services. For example:
138-
```
139-
mkdir -p /usr/lib/systemd/system.conf.d/ && cp /usr/lib/opentelemetry/examples/systemd/00-otelinject-instrumentation.conf /usr/lib/systemd/system.conf.d/
140-
```
141-
This file includes the required environment variables to activate the respective agents with the default options:
142-
- Java:
143-
```
144-
DefaultEnvironment="JAVA_TOOL_OPTIONS=-javaagent:/usr/lib/opentelemetry/otel-javaagent.jar"
145-
```
146-
- Node.js:
147-
```
148-
DefaultEnvironment="NODE_OPTIONS=-r /usr/lib/opentelemetry/otel-js/node_modules/@opentelemetry/auto-instrumentations-node/register"
149-
```
150-
- .NET
151-
```
152-
DefaultEnvironment="CORECLR_ENABLE_PROFILING=1"
153-
DefaultEnvironment="CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}"
154-
DefaultEnvironment="CORECLR_PROFILER_PATH=/usr/lib/opentelemetry/otel-dotnet/linux-x64/OpenTelemetry.AutoInstrumentation.Native.so"
155-
DefaultEnvironment="DOTNET_ADDITIONAL_DEPS=/usr/lib/opentelemetry/otel-dotnet/AdditionalDeps"
156-
DefaultEnvironment="DOTNET_SHARED_STORE=/usr/lib/opentelemetry/otel-dotnet/store"
157-
DefaultEnvironment="DOTNET_STARTUP_HOOKS=/usr/lib/opentelemetry/otel-dotnet/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll"
158-
DefaultEnvironment="OTEL_DOTNET_AUTO_HOME=/usr/lib/opentelemetry/otel-dotnet"
159-
```
160-
2. To configure the activated agents, add/update [`DefaultEnvironment`](
161-
https://www.freedesktop.org/software/systemd/man/systemd-system.conf.html#DefaultEnvironment=) within the target file
162-
from the previous step for the desired environment variables. For example:
163-
```
164-
cat <<EOH >> /usr/lib/systemd/system.conf.d/00-otelinject-instrumentation.conf
165-
DefaultEnvironment="OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317"
166-
DefaultEnvironment="OTEL_RESOURCE_ATTRIBUTES=deployment.environment=my_deployment_environment"
167-
DefaultEnvironment="OTEL_SERVICE_NAME=my_service_name"
168-
EOH
169-
```
170-
Check the following for all supported environment variables and default values:
171-
- [Java](https://opentelemetry.io/docs/zero-code/java/agent/configuration/)
172-
- [Node.js](https://opentelemetry.io/docs/zero-code/js/configuration/)
173-
- [.NET](https://opentelemetry.io/docs/zero-code/dotnet/configuration/)
174-
3. Reboot the system, or run `systemctl daemon-reload` and then restart the applicable `systemd` services for any
175-
changes to take effect.
176-
177116
## Contributing
178117

179118
See [CONTRIBUTING.md](CONTRIBUTING.md).

packaging/fpm/common.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ libotelinject_INSTALL_PATH="${INSTALL_DIR}/libotelinject.so"
1818
JAVA_AGENT_INSTALL_PATH="${INSTALL_DIR}/javaagent.jar"
1919
CONFIG_DIR_REPO_PATH="${FPM_DIR}/etc/opentelemetry"
2020
CONFIG_DIR_INSTALL_PATH="/etc/opentelemetry"
21-
EXAMPLES_INSTALL_DIR="${INSTALL_DIR}/examples"
22-
EXAMPLES_DIR="${FPM_DIR}/examples"
2321

2422
JAVA_AGENT_RELEASE_PATH="${FPM_DIR}/../java-agent-release.txt"
2523
JAVA_AGENT_RELEASE_URL="https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases"
@@ -145,8 +143,6 @@ setup_files_and_permissions() {
145143
sudo chmod -R 755 "$buildroot/$CONFIG_DIR_INSTALL_PATH"
146144

147145
mkdir -p "$buildroot/$INSTALL_DIR"
148-
cp -rf "$EXAMPLES_DIR" "$buildroot/$INSTALL_DIR/"
149-
sudo chmod -R 755 "$buildroot/$EXAMPLES_INSTALL_DIR"
150146

151147
sudo chown -R root:root "$buildroot"
152148
}

packaging/fpm/examples/systemd/00-opentelemetry-injector.conf

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)