|
1 |
| -# Vaadin observability - OpenTelemetry Extension |
| 1 | +# Vaadin Observability Kit |
2 | 2 |
|
3 |
| -Test project for extending the OpenTelemetry with better data |
| 3 | +Get insight into Flow applications at runtime and in production by monitoring application health, detecting unhandled errors and performance issues, and observing user behavior. |
4 | 4 |
|
5 |
| -To build the project build an embedded extension with: |
| 5 | +Observability Kit provides integrations with industry-leading Application Performance Monitoring (APM) and observability tools. |
6 | 6 |
|
7 |
| -`./gradlew clean build extendedAgent` |
| 7 | +At its core, Observability Kit is a custom Java agent that runs together with a Vaadin Flow application to automatically collect telemetry data, including traces, metrics, and logs. |
8 | 8 |
|
9 |
| -Sample usage would then be for instance: |
10 |
| - |
11 |
| -`java -javaagent:../extension/build/libs/opentelemetry-javaagent.jar -Dotel.traces.exporter=jaeger -Dotel.exporter.jaeger.endpoint=http://localhost:14250 -Dotel.metrics.exporter=none -jar target/myapp-1.0-SNAPSHOT.jar` |
12 |
| - |
13 |
| - The automatic vaadin instrumentation package is disabled so we can handle all the things in a custom way. |
14 |
| - |
15 |
| -Using the project as an extension (instead of embedding): |
16 |
| -`java -javaagent:../opentelemetry-javaagent.jar -Dotel.traces.exporter=jaeger -Dotel.javaagent.extensions=../extension/build/libs/opentelemetry-custom-instrumentation-extension-1.0-all.jar -Dotel.exporter.jaeger.endpoint=http://localhost:14250 -Dotel.metrics.exporter=none -jar target/myapp-1.0-SNAPSHOT.jar` |
17 |
| - |
18 |
| -This has the paths |
19 |
| -`/extension` (this project) |
20 |
| -`/my-app` (the application) |
21 |
| - |
22 |
| -Also running Jaeger `jaeger-all-in-one.exe` with default settings. |
23 |
| - |
24 |
| -## Development |
25 |
| - |
26 |
| -### Linting and Formatting |
27 |
| - |
28 |
| -The project uses [spotless][https://github.com/diffplug/spotless/tree/main/plugin-gradle] for linting and formatting the code. |
29 |
| - |
30 |
| -To lint the code run: |
31 |
| -``` |
32 |
| -./gradlew spotlessCheck |
33 |
| -``` |
34 |
| - |
35 |
| -To format the code run: |
36 |
| -``` |
37 |
| -./gradlew spotlessApply |
38 |
| -``` |
39 |
| - |
40 |
| -### Running TomCat with the agent |
41 |
| - |
42 |
| -Tomcat on windows add the file `{tomcat}\bin\setenv.bat` with the content |
43 |
| - |
44 |
| -```shell |
45 |
| -set CATALINA_OPTS=%CATALINA_OPTS% -javaagent:C:\PATH_TO\opentelemetry-javaagent.jar |
46 |
| -set OTEL_METRICS_EXPORTER=none |
47 |
| -set OTEL_TRACES_EXPORTER=jaeger |
48 |
| -set OTEL.EXPORTER.JAEGER.ENDPOINT=http://localhost:14250 |
49 |
| -``` |
50 |
| - |
51 |
| -for linux/unix the file is `{tomcat}/bin/setenv.sh` with the content |
52 |
| -```shell |
53 |
| -export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/PATH_TO/opentelemetry-javaagent.jar" |
54 |
| -export OTEL_METRICS_EXPORTER=none |
55 |
| -export OTEL_TRACES_EXPORTER=jaeger |
56 |
| -export OTEL.EXPORTER.JAEGER.ENDPOINT=http://localhost:14250 |
57 |
| -``` |
58 |
| - |
59 |
| -### Maven deployment of extendedAgent |
60 |
| - |
61 |
| -To deploy the extended agent to a maven repository you need to supply credentials as properties `mavenUser` and `mavenPwd`, also the repository URL needs to be given as `mavenUrl`. |
62 |
| - |
63 |
| -These can be given on the command line with the `-P` flag or in the `gradle.properties` file. |
64 |
| - |
65 |
| -If targeting a repository behind http then you need to add the `allowInsecureProtocol = true` flag to the `repositories { maven {` block. |
66 |
| - |
67 |
| -With the parameters in place just run |
68 |
| -```shell |
69 |
| -gradle build extendedAgent publish |
70 |
| -``` |
| 9 | +Observability Kit is compatible with [Vaadin Platform](https://vaadin.com/) starting from version [23.2.0](https://github.com/vaadin/platform/releases/tag/23.2.0). |
0 commit comments