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
Copy file name to clipboardExpand all lines: grpc/README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,22 @@
1
-
# GRPC Example
1
+
# gRPC Example
2
2
3
3
**Note:** This is an advanced scenario useful for people who want to *manually* instrument their own code.
4
-
(If you're using the [java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation), you get this instrumentation "out-of-the-box" and this isn't necessary.)
4
+
(If you're using the [Java agent](https://github.com/open-telemetry/opentelemetry-java-instrumentation), you get this instrumentation "out-of-the-box" and this isn't necessary.)
5
5
6
6
This is a simple example that demonstrates how to use the OpenTelemetry SDK
7
-
to *manually* instrument a simple GRPC based Client/Server application.
7
+
to *manually* instrument a simple gRPC-based client/server application.
8
8
This example utilizes the [opentelemetry-grpc-1.6](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/grpc-1.6/library/README.md#library-instrumentation-for-grpc-160)
9
-
to instrument both the GRPC client and server.
9
+
library to instrument both the gRPC client and server.
10
10
11
-
# How to run
11
+
# How to Run
12
12
13
13
## Prerequisites
14
-
* Be on the grpc project root folder
14
+
15
+
* Java 17 or higher is required to run Gradle and build this example
16
+
* Java 8 or higher may be used to run the example once it has been built
Copy file name to clipboardExpand all lines: javaagent/README.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,58 +3,58 @@
3
3
This example demonstrates simple usage of the OpenTelemetry Java Agent published
4
4
by [opentelemetry-java-instrumentation](https://github.com/open-telemetry/opentelemetry-java-instrumentation).
5
5
6
-
It consists of a spring boot application with:
6
+
It consists of a Spring Boot application with:
7
7
8
-
- A gradle task for downloading the OpenTelemetry Java Agent.
8
+
- A Gradle task for downloading the OpenTelemetry Java Agent
9
9
- A simple web API available at `GET http://localhost:8080/ping`. When called,
10
-
autoinstrumentation from the OpenTelemetry Java Agent records spans and
10
+
auto-instrumentation from the OpenTelemetry Java Agent records spans and
11
11
metrics. Additionally, there is manual trace and metric instrumentation, as
12
-
well as application logging performed in the context of traces using the log4j
13
-
API.
14
-
- A docker compose setup configured to run the application and export to
15
-
the [collector](https://opentelemetry.io/docs/collector/) via OTLP.
16
-
- The collector is configured with
12
+
well as application logging performed in the context of traces using the Log4j
13
+
API
14
+
- A Docker Compose setup configured to run the application and export to
15
+
the [Collector](https://opentelemetry.io/docs/collector/) via OTLP
16
+
- The Collector is configured with
17
17
the [OTLP receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver)
18
-
and export it to standard out with
18
+
and exports to standard out with
19
19
the [logging exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter)
20
20
21
21
## Prerequisites
22
22
23
-
* Java 1.8
24
-
* Docker compose
23
+
* Java 17 or higher is required to build and run this example
24
+
* Docker Compose
25
25
26
-
# How to run
26
+
# How to Run
27
27
28
-
Build the application jar
28
+
Build the application jar:
29
29
30
30
```shell
31
31
../gradlew bootJar
32
32
```
33
33
34
-
Run the application and the collector with docker compose
34
+
Run the application and the Collector with Docker Compose:
35
35
36
36
```shell
37
-
docker-compose up --build
37
+
dockercompose up --build
38
38
```
39
39
40
-
In a separate shell, exercise the application by calling its endpoint
40
+
In a separate shell, exercise the application by calling its endpoint:
41
41
42
42
```shell
43
43
curl http://localhost:8080/ping
44
44
```
45
45
46
-
Watch for spans, metrics, and logs in the collector log output
46
+
Watch for spans, metrics, and logs in the Collector log output.
47
47
48
48
## Declarative Configuration
49
49
50
-
By default, this example uses the [environment variable configuration schema](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md) to configure the SDK. However, it also includes [sdk-config.yaml](./sdk-config.yaml) which demonstrates how the [declarative configuration](https://opentelemetry.io/docs/specs/otel/configuration/#declarative-configuration) scheme can be used to configure the SDK based on a YAML configuration file instead.
50
+
By default, this example uses the [environment variable configuration schema](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md) to configure the SDK. However, it also includes [sdk-config.yaml](./sdk-config.yaml) which demonstrates how the [declarative configuration](https://opentelemetry.io/docs/specs/otel/configuration/#declarative-configuration) scheme can be used to configure the SDK based on a YAML configuration file instead.
51
51
52
52
`sdk-config.yaml` extends the [opentelemetry-configuration sdk-config.yaml](https://github.com/open-telemetry/opentelemetry-configuration/blob/v0.3.0/examples/sdk-config.yaml) template, demonstrating:
53
53
54
-
- Configuration of instrumentation (see `.instrumentation.java`)
55
-
- Configuration of [rulebased routing sampler](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/samplers) (see `.tracer_provider.sampler.parent_based.root`)
54
+
- Configuration of instrumentation (see `.instrumentation.java`)
55
+
- Configuration of [rule-based routing sampler](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/samplers) (see `.tracer_provider.sampler.parent_based.root`)
56
56
57
-
To use declarative configuration instead of the environment variable scheme, add the following before starting the application and collector:
57
+
To use declarative configuration instead of the environment variable scheme, add the following before starting the application and Collector:
0 commit comments