You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #371 from aws-otel/raphasil-update-java-metrics
* Fix minor inconsistencies in the documentation.
* Add examples for Manually adding metrics to an application.
* Reference existing SparkJava sample app that makes use of Traces and metrics.
Copy file name to clipboardExpand all lines: src/docs/getting-started/java-sdk.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,8 @@ backend.
17
17
18
18
## Getting Started
19
19
20
-
*[Auto-Instrumentation for Traces with the Java agent](/docs/getting-started/java-sdk/trace-auto-instr)
21
-
*[Manual Instrumentation for Traces with the Java SDK](/docs/getting-started/java-sdk/trace-manual-instr)
20
+
*[Auto-Instrumentation for Traces and Metrics with the Java agent](/docs/getting-started/java-sdk/trace-auto-instr)
21
+
*[Manual Instrumentation for Traces and Metrics with the Java SDK](/docs/getting-started/java-sdk/trace-manual-instr)
22
22
23
23
## Sample Code
24
24
*[Sample Spring App using OpenTelemetry Java Auto-Instrumentation](https://catalog.us-east-1.prod.workshops.aws/v2/workshops/31676d37-bbe9-4992-9cd1-ceae13c5116c/en-US/adot/javawalkthrough)
@@ -50,12 +50,15 @@ automatically. For many cases, this is all you need to use tracing.
50
50
51
51
By default OpenTelemetry Java agent uses the [OTLP exporter](https://github.com/open-telemetry/opentelemetry-java/tree/master/exporters/otlp)
52
52
and is configured to send data to a [OpenTelemetry collector](https://github.com/open-telemetry/opentelemetry-collector/blob/master/receiver/otlpreceiver/README.md)
53
-
at `http://localhost:4317`.
53
+
at `http://localhost:4317` for both metrics and traces.
54
54
55
-
The agent can be configured using [standard OpenTelemetry options for configuration](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/agent-config.md).
55
+
The agent can be configured using [standard OpenTelemetry options for configuration](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md) using either environment variables or system properties.
56
56
For example, to set the random sampling rate for creating traces, you can set the environment variables
57
57
`OTEL_TRACES_SAMPLER=parentbased_traceidratio` and `OTEL_TRACES_SAMPLER_ARG=0.3` to configure a sampling rate of 30%.
58
58
59
+
Another useful configuration that can be used during development is to log traces and metrics. This can be achieved by
60
+
setting `OTEL_TRACES_EXPORTER=logging` and `OTEL_METRICS_EXPORTER=logging`.
61
+
59
62
### Using X-Ray Remote Sampling
60
63
61
64
The ADOT Java Auto-Instrumentation Agent can be configured to use [X-Ray remote sampling](https://docs.aws.amazon.com/xray/latest/devguide/xray-console-sampling.html)
@@ -90,7 +93,7 @@ artifact, any usage of it will be disabled by the agent.
@@ -110,6 +113,7 @@ for more detail on using the OpenTelemetry API.
110
113
111
114
<SectionSeparator />
112
115
113
-
## Sample Application
116
+
## Sample Applications
114
117
115
-
Visit the [Sample Spring App using OpenTelemetry Java Auto-Instrumentation](https://catalog.us-east-1.prod.workshops.aws/v2/workshops/31676d37-bbe9-4992-9cd1-ceae13c5116c/en-US/adot/javawalkthrough).
118
+
* Visit the [Sample Spring App using OpenTelemetry Java Auto-Instrumentation](https://catalog.us-east-1.prod.workshops.aws/v2/workshops/31676d37-bbe9-4992-9cd1-ceae13c5116c/en-US/adot/javawalkthrough).
119
+
*[SparkJava Sample Application Using Traces and Metrics](https://github.com/aws-observability/aws-otel-java-instrumentation/tree/main/sample-apps/spark).
0 commit comments