Commit Graph

53 Commits

Author SHA1 Message Date
John Watson a5f7286e5c
Update the examples for v0.10.0 (#2030)
* Update the examples for v0.10.0

* make sure to install the propagator for the client/server examples

* rename method to be more consistent
2020-11-05 16:32:58 -08:00
Bogdan Drutu 6e05d059ba
Add github action to build examples when changes are identified in example directory (#1962)
Update grpc version to generate one change in examples.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-02 06:41:31 -08:00
Bogdan Drutu 698e9f4ad6
Use boms for grpc and opentelemetry in the examples (#1953)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-11-01 08:07:47 -08:00
Bogdan Drutu f975dfe616
Update to use google java format 1.9 in the examples (#1954)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-31 13:25:15 -07:00
Bogdan Drutu d00d50c906
Rename all packages to follow the module name definition (#1952)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-31 10:59:11 -07:00
Anuraag Agrawal fc14e3f0c2
Revert package rename in examples. (#1902) 2020-10-27 19:21:18 -07:00
Anuraag Agrawal 7ebbe7979d
Move API packages to .api. package (#1892)
* Move API packages to .api. package

* Cleanup
2020-10-28 08:39:41 +09:00
John Watson f5c1971a96
Make the jaeger example send more spans to make sure that they get properly exported. (#1847) 2020-10-22 10:25:03 +09:00
Anuraag Agrawal 082791503b
Upgrade to Gradle 6.7 and use toolchains feature to build on 11 and t… (#1829)
* Upgrade to Gradle 6.7 and use toolchains feature to build on 11 and test on 11/8.

* Debug (probably first JDK download taking some time)

* Remove now unnecessary java toolchain workarounds

* Remove debug

* Remove windows build for now

* bin

* Raise no_output_timeout since this change seems to eliminate cache and build doesn't finish.
2020-10-21 15:01:50 +09:00
John Watson c01112b973
fix examples broken by an errant script (#1814) 2020-10-16 17:59:16 +02:00
Christian Neumüller 62a96ae1ed
Add .gitattributes. (#1798)
* Add .gitattributes.

This fixes spotlessCheck when checking out on windows with git core.eol=crlf and core.autocrlf=true.

Note that for git itself, the eol=lf next to the text=auto changes nothing, but spotless tries
enforce the core.eol line endings anyway.

* Adjust .gitattributes towards instrumentation's
2020-10-15 16:03:55 -07:00
hengyunabc 572d6abad3
Use the same version of gradle (#1806) 2020-10-15 11:01:52 -07:00
Bogdan Drutu b73a063901
Remove getCurrentContext and withSpan from Tracer (#1809)
* Remove getCurrentContext and withSpan from Tracer

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Remove old java7 example

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-15 10:58:41 -07:00
John Watson 246b402769
update the examples for 0.9.1 (#1779)
* update the examples for 0.9.1

* update the examples for 0.9.1
2020-10-11 20:50:22 -07:00
Anuraag Agrawal ed169645f7
Migrate to spotless (#1748)
* Use spotless for formatting / license check

* Apply formatting

* README

* Apply to example

* google-java-format 1.8 for now

* google-java-format 1.7 for now (last supporting Java 8)
2020-10-05 16:41:21 +09:00
dengliming 71ba8e1b87
Use the concise license header without the year (#1623)
* Use the concise license header without the year

* Use the concise license header without the year
2020-10-02 22:42:53 +09:00
John Watson c0969d4680
Remove an unused import from the examples. (#1708) 2020-09-26 15:04:20 +09:00
Bogdan Drutu 2d146bbbb9
Remove constant labels from instruments and MetricData (#1692)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-24 15:14:04 +09:00
John Watson 909beb0e3d
Fix example code for 0.8.0, non-snapshot dependency (#1681)
* Update the examples for the 0.9.0-SNAPSHOT changes

* revert back to 0.8.0, non-snapshot
2020-09-23 15:12:48 +09:00
Eunice Kim 0ec2914275
Updated sampling result name (#1661)
* Changed all sampling result names

* Changed all sampling result names - spanbuilderSdkTest

* Changed all sampling result names

* Changed all sampling result names - spanbuilderSdkTest

* fixed formatting violations

* fixed formatting violations

* Update sdk/tracing/src/main/java/io/opentelemetry/sdk/trace/Sampler.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-09-18 10:36:56 -07:00
John Watson 721a7cdf2e
Create a simple example of using the OTLP exporters (#1616)
* Create a simple otlp example, with a docker-compose collector setup.

* Add metrics into the example

* formatting

* remove the go metrics load generator

* remove unneeded pieces of the docker config; switch to using the BSP in the example code.

* Update examples/otlp/docker/otel-collector-config-demo.yaml

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-09-02 20:17:24 -07:00
John Watson ef7796a962
Clean up and update the examples for the latest API changes. (#1593) 2020-08-27 11:28:52 -07:00
jarebudev a08dd9fbe4
1503 prometheus example (#1541)
* added prometheus exporter example

* tidying up

* Update examples/prometheus/README.md

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>

* Update examples/prometheus/README.md

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>

* added port arg check as per code review suggestion

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
2020-08-17 14:17:05 -07:00
Sergei Malafeev 86005245a5
Merge pull request #1545
* #1382 instead of waiting use TracerSdkProvider.shutdown() in examples
2020-08-17 09:58:01 -07:00
Carlos Alberto Cortez b002d75212
Start 0.8.0 development cycle (#1497) 2020-08-03 17:07:13 -07:00
John Watson 4680c3a327
Fix examples from the latest updates. (#1495) 2020-08-03 19:31:16 +02:00
ET 78ac35a740
Call initTracer just once at beginning of main in http example (#1407)
* Call initTracer just once at beginning of main.

This fixes a bug where each time a new HttpClient is instantiated, it adds a new SpanExporter to the
global OpenTelemetry SDK instance.

* s/InitTracer/InitTracerSdk/
2020-07-12 08:02:31 -07:00
Carlos Alberto Cortez e976bc955a
Start 0.7.0 development cycle (#1391) 2020-07-02 01:34:33 +02:00
neeraj97 3bd02e896a
Added example module for zipkin trace exporter (#1383)
* Add example module for Zipkin

* Updated to include Zipkin example module

* Changed to use shutdown() on TracerSdkProvider

* Changed zipkin example module to use shutdown() on TracerSdkProvider
2020-06-30 08:21:32 -07:00
John Watson 2074b4d3ce
Clean up examples for the latest attribute changes (#1362) 2020-06-19 21:39:31 +02:00
Bogdan Drutu 32810f04b9
Upgrade deps and fix examples (#1357)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-18 12:00:24 -07:00
John Watson f1f5975d5c
Introduce an ReadableAttributes interface, with 2 implementations (#1336)
* Introduce an Attributes interface and have ImmutableAttributes and the AttributesMap implement it.

* make the attribute limiting a little clearer.

* tiny javadoc fix

* Rework to restore the Attributes class, and introduce a ReadableAttributes interface

* polish the javadoc a bit

* fix some broken javadoc

* revert example change; revert test name change

* javadoc de-escalation

* fix bad merge
2020-06-17 09:29:52 -07:00
John Watson 194f6296a9
Example cleanup/update for latest APIs (#1337) 2020-06-17 16:49:05 +02:00
Uladzislau Kiva 9191175f32
feat: examples for metrics (#1284)
* feat: examples for metrics

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/ObserverMeterExample.java

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>

* feat: metrics examples adding bound() and applying review comments

* feat: example for directory search

* feat: apply review suggestions

* feat: apply review suggestions

* feat: move creation of counter out of try block

* feat: use double counter to count MB

* fix: javadoc

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* feat: apply review suggestions

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/LongCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/LongCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/LongCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/LongValueObserverExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/LongCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* feat: apply review suggestions

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/LongCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/DoubleCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

* Update examples/metrics/src/main/java/io/opentelemetry/example/metrics/LongCounterExample.java

Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
2020-06-11 08:17:49 -07:00
Bogdan Drutu 25c9c2d4ac
Start 0.6.0 development cycle (#1306)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-04 08:31:53 -07:00
Paulo Janotti 7fb0d4da98
Remove SpanID from sampling parameters (#1286)
* Remove SpanID from sampling parameters

* Generate SpanId only for sampled spans

* Revert "Generate SpanId only for sampled spans"

This reverts commit 5b51eaed88.
2020-05-29 08:52:46 -07:00
ET f8c7e0d3c3
Fix examples to use [Batch|Simple]SpanProcessor (#1280)
https://github.com/open-telemetry/opentelemetry-java/pull/1241 changed the names of
[Batch|Simple]SpansProcessor to [Batch|Simple]SpanProcessor but did not change the examples to
match. This fixes the examples so that they now build correctly.
2020-05-27 20:35:30 +02:00
John Watson 586793f405
Update the examples for the latest changes (#1242)
* fix the examples for the latest

* pick up formatting changes
2020-05-18 15:29:28 -07:00
John Watson d3768b24be
Move the span operations inside the scope in the http server example (#1227)
* Move the span operations inside the scope, to show better idiomatic usage of the API.

* rename parameter

* update to start the span before it is added to the scope

* properly parent the newly created span.
2020-05-15 11:29:20 -07:00
John Watson 450d4a8f80
Update the examples to work with 0.5.0-SNAPSHOT (#1206) 2020-05-12 14:01:08 -07:00
Gregor Zeitlinger ebcd508a88
add shortcut methods to get tracers and meters (#1159)
* add shortcut methods to get tracers and meters

* add shortcut methods to get tracers and meters

* add shortcut methods to get tracers and meters

* add shortcut methods to get tracers and meters
2020-05-06 11:30:33 -07:00
John Watson 85afba6e63
Update the example code for the latest changes. (#1158) 2020-04-30 15:12:01 +02:00
Trask Stalnaker 489ef7038d
Make TracerSdk non-public (#1153) 2020-04-28 07:33:29 -07:00
Giovanni Liva 1396200627
Examples share a common gradle build script (#1123)
* Examples in a single separate project. Bump version to 0.4.0-SNAPSHOT

* Formatting

* Gradle 6.3. Remove local wrappers
2020-04-22 07:53:19 -07:00
Bogdan Drutu 63b9b5f505
Update to use gradle 6.3 in all projects (#1103)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-04-11 16:27:37 -07:00
Giovanni Liva 498e101bdf
Add grpc example (#696)
* Add build files for gRPC example
2020-04-01 17:14:46 +02:00
Carlos Alberto Cortez fb59147d96
Update our examples to use 0.3.0 (#1054)
* Update our examples to use 0.3.0

* Version tuning.
2020-03-30 13:36:03 -07:00
Giovanni Liva 03b1751a2e
Sdk usage (#1003)
* Add SDK examples

* README

* Format and Copyright

* Address PR feedback

* Update build to depend on snapshots and apply gjf

* Update examples

* Switch to Logging exporter

* Address feedback

* Remove custom SpanProcessor

* Address feedback on examples

* Delete DemoUtil

* EmptyMap only
2020-03-27 10:27:43 -07:00
Giovanni Liva 2d892444d1
Add http example (#695)
* Add build scripts for HTTP example

Add HTTP example

Improved naming and formatting

Add Semantic Convention to traces

Fix semantic convention

* Add Examples as OpenTelementry project

* Changed the build configuration - Examples are compiled with the main project

* Addressing comment of @carlosalberto

* Addressed the feedback of @bogdandrutu

* Removed InMemory exporter. Example as standalone project.

* Remove examples from main build

* Making the exporter private and static

Change visibility of attributes

* Update HTTP example README

* Apply java format

Co-authored-by: Inseo Kim <sano307@naver.com>
2020-03-24 09:08:52 -07:00
Uladzislau Kiva cefa2ab5d5
feat: update example for OT 0.2.4 (#1039) 2020-03-21 07:55:25 -07:00