Skip to content

Commit 94b83c9

Browse files
zeitlingerchalinsvrnm
authored
re-organize agent config (#4811)
Co-authored-by: Patrice Chalin <[email protected]> Co-authored-by: Patrice Chalin <[email protected]> Co-authored-by: Severin Neumann <[email protected]>
1 parent ec1824d commit 94b83c9

File tree

15 files changed

+640
-614
lines changed

15 files changed

+640
-614
lines changed

content/en/blog/2022/debug-otel-with-otel/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,5 +260,5 @@ COPY opentelemetry_module.conf /etc/nginx/conf.d
260260
[v1.0.1 release of the otel-webserver-module]:
261261
https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.1
262262
[java]:
263-
/docs/zero-code/java/agent/configuration/#capturing-http-request-and-response-headers
263+
/docs/zero-code/java/agent/instrumentation/http/#capturing-http-request-and-response-headers
264264
[python]: /docs/zero-code/python/

content/en/docs/faas/lambda-auto-instrument.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ variables:
5656
instrumentations, see [Suppressing specific agent instrumentation][1].
5757

5858
[1]:
59-
/docs/zero-code/java/agent/configuration/#suppressing-specific-agent-instrumentation
59+
/docs/zero-code/java/agent/disable/#suppressing-specific-agent-instrumentation
6060

6161
For example, to only enable auto-instrumentation for Lambda and the AWS SDK, you
6262
would set the following environment variables:

content/en/docs/kubernetes/operator/automatic.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Therefore, the example uses `http://demo-collector:4318`, which connects to the
212212
#### Excluding auto-instrumentation {#java-excluding-auto-instrumentation}
213213

214214
By default, the Java auto-instrumentation ships with
215-
[many instrumentation libraries](/docs/zero-code/java/agent/#supported-libraries-frameworks-application-services-and-jvms).
215+
[many instrumentation libraries](/docs/zero-code/java/agent/getting-started/#supported-libraries-frameworks-application-services-and-jvms).
216216
This makes instrumentation easy, but could result in too much or unwanted data.
217217
If there are any libraries you do not want to use you can set the
218218
`OTEL_INSTRUMENTATION_[NAME]_ENABLED=false` where `[NAME]` is the name of the
@@ -221,7 +221,7 @@ the default libraries by setting
221221
`OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED=false` and then use
222222
`OTEL_INSTRUMENTATION_[NAME]_ENABLED=true` where `[NAME]` is the name of the
223223
library. For more details, see
224-
[Suppressing specific instrumentation](/docs/zero-code/java/agent/configuration/#suppressing-specific-instrumentation).
224+
[Suppressing specific instrumentation](/docs/zero-code/java/agent/disable/).
225225

226226
```yaml
227227
apiVersion: opentelemetry.io/v1alpha1

content/en/docs/languages/java/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ For more:
248248
[metrics]: /docs/concepts/signals/metrics/
249249
[logs]: /docs/concepts/signals/logs/
250250
[annotations]: /docs/zero-code/java/agent/annotations/
251-
[configure the java agent]: /docs/zero-code/java/agent/#configuring-the-agent
251+
[configure the java agent]: /docs/zero-code/java/agent/configuration/
252252
[console exporter]:
253253
https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#logging-exporter
254254
[exporter]:

content/en/docs/languages/java/libraries.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ in order to generate telemetry data for a library or framework.
1616
The Java agent for automatic instrumentation includes instrumentation libraries
1717
for many common Java frameworks. Most are turned on by default. If you need to
1818
turn off certain instrumentation libraries, you can
19-
[suppress them](/docs/zero-code/java/agent/configuration/#suppressing-specific-instrumentation).
19+
[suppress them](/docs/zero-code/java/agent/disable/).
2020

2121
If you use [code-based instrumentation](../instrumentation), you can leverage
2222
some instrumentation libraries for your dependencies standalone. To find out

content/en/docs/zero-code/java/agent/_index.md

-95
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ aliases:
55
- /docs/java/automatic_instrumentation
66
- /docs/languages/java/automatic_instrumentation
77
redirects: [{ from: /docs/languages/java/automatic/*, to: ':splat' }]
8-
cSpell:ignore: Dotel myapp
98
---
109

1110
Zero-code instrumentation with Java uses a Java agent JAR attached to any Java
@@ -14,97 +13,3 @@ popular libraries and frameworks. It can be used to capture telemetry data at
1413
the "edges" of an app or service, such as inbound requests, outbound HTTP calls,
1514
database calls, and so on. To learn how to manually instrument your service or
1615
app code, see [Manual instrumentation](/docs/languages/java/instrumentation/).
17-
18-
## Setup
19-
20-
1. Download [opentelemetry-javaagent.jar][] from [Releases][] of the
21-
`opentelemetry-java-instrumentation` repository and place the JAR in your
22-
preferred directory. The JAR file contains the agent and instrumentation
23-
libraries.
24-
2. Add `-javaagent:path/to/opentelemetry-javaagent.jar` and other config to
25-
your JVM startup arguments and launch your app:
26-
27-
- Directly on the startup command:
28-
29-
```shell
30-
java -javaagent:path/to/opentelemetry-javaagent.jar -Dotel.service.name=your-service-name -jar myapp.jar
31-
```
32-
33-
- Via the `JAVA_TOOL_OPTIONS` and other environment variables:
34-
35-
```shell
36-
export JAVA_TOOL_OPTIONS="-javaagent:path/to/opentelemetry-javaagent.jar"
37-
export OTEL_SERVICE_NAME="your-service-name"
38-
java -jar myapp.jar
39-
```
40-
41-
## Configuring the agent
42-
43-
The agent is highly configurable.
44-
45-
One option is to pass configuration properties via the `-D` flag. In this
46-
example, a service name and Zipkin exporter for traces are configured:
47-
48-
```sh
49-
java -javaagent:path/to/opentelemetry-javaagent.jar \
50-
-Dotel.service.name=your-service-name \
51-
-Dotel.traces.exporter=zipkin \
52-
-jar myapp.jar
53-
```
54-
55-
You can also use environment variables to configure the agent:
56-
57-
```sh
58-
OTEL_SERVICE_NAME=your-service-name \
59-
OTEL_TRACES_EXPORTER=zipkin \
60-
java -javaagent:path/to/opentelemetry-javaagent.jar \
61-
-jar myapp.jar
62-
```
63-
64-
You can also supply a Java properties file and load configuration values from
65-
there:
66-
67-
```sh
68-
java -javaagent:path/to/opentelemetry-javaagent.jar \
69-
-Dotel.javaagent.configuration-file=path/to/properties/file.properties \
70-
-jar myapp.jar
71-
```
72-
73-
or
74-
75-
```sh
76-
OTEL_JAVAAGENT_CONFIGURATION_FILE=path/to/properties/file.properties \
77-
java -javaagent:path/to/opentelemetry-javaagent.jar \
78-
-jar myapp.jar
79-
```
80-
81-
To see the full range of configuration options, see
82-
[Agent Configuration](configuration).
83-
84-
## Supported libraries, frameworks, application services, and JVMs
85-
86-
The Java agent ships with instrumentation libraries for many popular components.
87-
For the full list, see [Supported libraries, frameworks, application services,
88-
and JVMs][support].
89-
90-
## Troubleshooting
91-
92-
{{% config_option name="otel.javaagent.debug" %}}
93-
94-
Set to `true` to see debug logs. Note that these are quite verbose.
95-
96-
{{% /config_option %}}
97-
98-
## Next steps
99-
100-
After you have automatic instrumentation configured for your app or service, you
101-
might want to [annotate](annotations) selected methods or add
102-
[manual instrumentation](/docs/languages/java/instrumentation/) to collect
103-
custom telemetry data.
104-
105-
[opentelemetry-javaagent.jar]:
106-
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
107-
[releases]:
108-
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases
109-
[support]:
110-
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md

0 commit comments

Comments
 (0)