Commit Graph

135 Commits

Author SHA1 Message Date
OpenTelemetry Bot bbb05276be
Update the OpenTelemetry SDK version to 1.27.0 (#8688)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2023-06-13 12:02:11 +03:00
Mateusz Rzeszutek 13fa025de8
Use histogram advice in the Micrometer bridge (#8334) 2023-05-11 12:45:53 -07:00
Lauri Tulmin 45d35b25c5
Remove duplicate license normalization rule (#8327) 2023-04-20 11:35:53 -07:00
Mateusz Rzeszutek 04f2e3e9e5
Bridge agent logs into application's slf4j logger (#7339)
Related discussion #7257
Resolves #3413
Resolves #5059
Resolves #6258
Resolves #7179

Adds a logging implementation that'll collect agent logs in memory until
slf4j is detected in the instrumented application; and when that happens
will dump all the logs into the application slf4j and log directly to
the application logger from that time on.

It's still in a POC state, unfortunately: while it works fine with an
app that uses & initializes slf4j directly, Spring Boot applications
actually reconfigure the logging implementation (e.g. logback) a while
after slf4j is loaded; which causes all the startup agent logs (debug
included) to be dumped with the default logback pattern.

Future work:
* ~~Make sure all logs produces by the agent are sent to loggers named
`io.opentelemetry...`
(https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/7446)~~
DONE
* Make this work on Spring Boot
* Documentation
* Smoke test?
2023-04-04 17:29:43 +02:00
Tyler Benson 831ee5817a
Add `removeJarVersionNumbers` build setting (#8116)
This is handy to enable consistent local version numbers rather than
updating file paths each release.

Add the following to enable locally `~/.gradle/gradle.properties`

```
removeJarVersionNumbers=true
```
2023-03-28 19:40:08 +03:00
Lauri Tulmin 05294de5e6
Disable generateLicenseReport task unless it is explicitly run (#7995)
After gradle 8 update gradle started complaining that other tasks depend
on `generateLicenseReport` output. Hopefully disabling this task during
regular builds fixes this.
2023-03-07 16:02:57 +02:00
Lauri Tulmin 0e15a47e93
Upgrade to gradle 8.0.2 (#7978) 2023-03-07 10:29:26 +02:00
dependabot[bot] 789b66d455
Bump spotless-plugin-gradle from 6.12.0 to 6.12.1 (#7500)
Bumps [spotless-plugin-gradle](https://github.com/diffplug/spotless)
from 6.12.0 to 6.12.1.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="718a504c12"><code>718a504</code></a>
Published gradle/6.12.1</li>
<li><a
href="c13acee213"><code>c13acee</code></a>
Published lib/2.31.1</li>
<li><a
href="552aabf876"><code>552aabf</code></a>
fix(deps): update dependency com.facebook:ktfmt to v0.42 (<a
href="https://github-redirect.dependabot.com/diffplug/spotless/issues/1421">#1421</a>)</li>
<li><a
href="4063e9f6d1"><code>4063e9f</code></a>
Add support for KtLint 0.48.0 (<a
href="https://github-redirect.dependabot.com/diffplug/spotless/issues/1432">#1432</a>
fixes <a
href="https://github-redirect.dependabot.com/diffplug/spotless/issues/1430">#1430</a>)</li>
<li><a
href="062e835846"><code>062e835</code></a>
Bump changelogs.</li>
<li><a
href="8f7e00594d"><code>8f7e005</code></a>
spotlessApply</li>
<li><a
href="9a8ccae9ec"><code>9a8ccae</code></a>
Bump default ktfmt 0.41 -&gt; 0.42</li>
<li><a
href="fb4277d2b1"><code>fb4277d</code></a>
Merge branch 'main-ktlint-0.48.0' into renovate/ver_ktfmt</li>
<li><a
href="b44d70d00a"><code>b44d70d</code></a>
Move changelog entries to the correct release.</li>
<li><a
href="b3d8e89002"><code>b3d8e89</code></a>
spotlessApply for 2023</li>
<li>Additional commits viewable in <a
href="https://github.com/diffplug/spotless/compare/gradle/6.12.0...gradle/6.12.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.diffplug.spotless:spotless-plugin-gradle&package-manager=gradle&previous-version=6.12.0&new-version=6.12.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2023-01-03 09:58:06 +00:00
Trask Stalnaker 597b2a5321
More spotless (#7126) 2022-11-11 05:01:21 +00:00
jack-berg aeac361816
Upgrade to otel java 1.19.0 (#6757)
Working PR to capture all the changes required to update to otel java
1.19.0. The new log API force allows
`:instrumentation-appender-api-internal` and
`:instrumentation-appender-sdk-internal`, but necessitates a decent
amount of refactoring as a result.

The PR points at the `1.19.0-SNAPSHOT`, which I'll update upon
publication.

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <ltulmin@splunk.com>
2022-10-12 09:19:37 -07:00
Mateusz Rzeszutek 8b2b3281fe
Encapsulate logging (#6543)
* Encapsulate actual logging implementation better

* Apply suggestions from code review

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* code review comments

* revert to the old slf4j package name

* spotless

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-09-12 13:22:26 -07:00
Mateusz Rzeszutek f63eae5ad0
Add gradle plugin for SDK extensions (#6558) 2022-09-08 15:06:32 -07:00
Trask Stalnaker 68a9f20eb3
Enable PrivateConstructorForUtilityClass errorprone check (#6427)
* PrivateConstructorForUtilityClass

* Advice

* More advice

* More

* More advice

* More

* Spotless

* Fix

* Fix

* Fix

* A better solution

* Revert

* More

* Fix

* Spotless

* Fix
2022-08-10 11:30:22 +03:00
Trask Stalnaker 0b15109107
Keep licenses up-to-date (#6399)
* Keep licenses in sync

* Oops

* Wording

* Wording

* Update
2022-08-02 12:41:02 -07:00
Trask Stalnaker c3c4fb7101
Finish annotation move (#6386)
* Update tests with new annotation

* more

* Fix build

* More
2022-08-01 09:19:58 -07:00
Mateusz Rzeszutek b23db97a28
Use ConfigProperties in javaagent SPIs (#6285)
* Use ConfigProperties in javaagent SPIs

* remove deprecated

* errorprone

* fix javaagent build

* fix javaagent-tooling tests

* spotless
2022-07-12 08:41:01 +02:00
Trask Stalnaker fb784aa877
Support new annotations (and change of instrumentation name for opentelemetry-annotations) (#6296)
* Support new annotations

* Consistency

* Simplify

* Annotation

* oops
2022-07-11 14:34:26 -07:00
Trask Stalnaker 177f0aec7c
Rename instrumentation-api-annotation-support (#6288) 2022-07-08 17:07:41 -07:00
Trask Stalnaker 701ed54311
Use "class loader" instead of "classloader" consistently in docs and comments (#6236)
* Use "class loader" consistently instead of classloader

* Java comments too

* Fix bad merge
2022-06-30 14:57:07 -07:00
Trask Stalnaker d17a0d7d9a
Instrument SpanKey directly (#5933)
* Instrument SpanKey directly

* feedback

* Make muzzle work

* Revert unrelated change
2022-05-03 14:56:33 -07:00
Mateusz Rzeszutek dfa43d71a4
Exclude duplicate project classes from inst/ (#5957) 2022-04-29 14:13:27 +03:00
Mateusz Rzeszutek d919f84cf8
Merge javaagent-instrumentation-api into javaagent-extension-api (#5936)
* Merge javaagent-instrumentation-api into javaagent-extension-api

* remove some leftover references to javaagent-instrumentation-api

* add missing instrumentation-api to distro example
2022-04-28 20:11:15 -07:00
Mateusz Rzeszutek 5fb2261a82
Split out instrumentation-api-semconv (#5721)
* Split out instrumentation-api-semconv

* fix tests

* Moved LoggingContextConstants to semconv module too
2022-04-01 10:04:52 -07:00
Mateusz Rzeszutek b668e73e13
Convert all logging statements from slf4j to jul (#5674)
* Convert all logging statements from slf4j to jul

* code review comments

* fix tests

* Fix randomly failing test
2022-03-25 10:02:51 -07:00
Anuraag Agrawal 14372adb68
Migrate Guava tests to Java (#5668)
* Migrate Guava tests to Java

* Update instrumentation/guava-10.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/guava/ListenableFutureTest.java

Co-authored-by: Lauri Tulmin <tulmin@gmail.com>

* Workaround inline mock issue

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
Co-authored-by: Lauri Tulmin <tulmin@gmail.com>
2022-03-24 14:14:09 +09:00
Anuraag Agrawal 791083eedf
Remove separate exporter configuration which we always have in distro… (#5331)
* Remove separate exporter configuration which we always have in distro now.

* Actually remove
2022-02-11 12:11:35 +09:00
Anuraag Agrawal 7b38845a47
Avoid having two tasks producing the same file (#5334) 2022-02-11 10:31:12 +09:00
Trask Stalnaker 0510ca6188
Remove slim artifact (#5251)
* Remove slim artifact

* Fix build

* Revert one change
2022-01-27 08:31:46 -08:00
Anuraag Agrawal ec375116be
Fix more lint warnings (#5174)
* Fix more lint warnings

* Redisable lint

* Drift

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-20 12:48:46 +09:00
Trask Stalnaker f9a9dcb769
Fix release failure (#5129)
* Revert "Disable jar task in javaagent module (#4765)"

This reverts commit 63c8b55d68.

* Add comment
2022-01-17 18:32:59 +01:00
Trask Stalnaker f7da97bd9d
Move appender api to internal (#5080)
* rename artifacts and packages

* Library users shouldn't need to use internal

* Update docs

* Rename in order to simplify HelperClassPredicate

* Spotless

* Move AgentLogEmitterProvider to javaagent-instrumentation-api
2022-01-12 08:38:28 -08:00
Anuraag Agrawal c75c01f871
Update to OTel 1.10 (#5035)
* Update to OTel 1.10

* Fix metric smoke test

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2022-01-07 15:45:20 -08:00
Anuraag Agrawal d0c9a4c975
Remove test that doesn't seem to check what is intended (#4961) 2021-12-21 10:09:57 +02:00
Anuraag Agrawal 1176029765
Migrate ShadowPackageRenamingTest to Java to avoid spock workaround (#4960) 2021-12-21 13:10:44 +09:00
Trask Stalnaker e5da618196
Add logs to testing infra (#4927)
* Add logs to testing infra

* Drift
2021-12-17 18:23:42 -08:00
Anuraag Agrawal 5e1e0c2642
Update to OTel 1.10 (#4866)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-12-16 18:46:17 +09:00
Nikita Salnikov-Tarnovski 99e82d70fa
Make gradle cache work when used from different locations (#4794) 2021-12-04 19:55:30 +02:00
Nikita Salnikov-Tarnovski 63c8b55d68
Disable jar task in javaagent module (#4765)
* Disable jar task in javaagent module

* Don't try to publish jar from javaagent

* Fix publishing
2021-12-02 17:18:34 +02:00
Trask Stalnaker 2bbd7365b3
Make testing agent jar more consistent with real agent jar (#4773) 2021-12-01 19:56:59 -08:00
Lauri Tulmin f5142f24e9
Remove internal-proxy instrumentation (#4749) 2021-11-30 07:56:26 -08:00
Nikita Salnikov-Tarnovski 821a4b870b
Drop instrumentation-api-caching module and move weak cache implementation to instrumentation-api (#4667)
* Drop instrumentation-api-caching module and move weak cache implementation to instrumentation-api

* Some test fixes

* Some cleanup

* Temporary workaround for using weak values in FutureListenerWrappers

* Spotless

* Update ClassNames and SpanNames

* Compilation and comment

* Add bounded cache and clean interface

* Polish

* Add comment

* Vendor ConcurrentLinkedHashMap in

* Let errorprone ignore vendored CLHM for now

* Keep license in java files too

* Convert Netty wrapper cache to VirtualField

* Work around lambda instrumentation failure

Ideally we would ignore instrumenting helper classes...

* Revert "Work around lambda instrumentation failure"

This reverts commit 6d63815b44.

* Revert "Convert Netty wrapper cache to VirtualField"

This reverts commit dac1522a3f.

* Handle cleared weak values

* Fix comment

* Delete instrumentation-api-caching

* Copy in weak-lock-free

* Remove caffeine remnants

* Fix checkstyle

* Rename BoundedCache to MapBackedCached

* Remove duplicate LICENSE

* Remove outdated comment

* Sync with SDK copy of weaklockfree

* Enable checkstyle:off comment

* Re-generate license report

* Move NOTICE file to package-info.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-11-24 09:05:12 -08:00
Anuraag Agrawal bcae1b11d3
Remove gRPC dependency for export (#4674) 2021-11-19 11:21:34 -08:00
Nikita Salnikov-Tarnovski 7c038f5c71
Fix running `generateLicenseReport` task (#4614)
* Fix running `generateLicenseReport` task

* Spotless
2021-11-12 22:39:37 +02:00
Lauri Tulmin 3fbacb70fd
Don't include caffeine3 in instrumentation-api (#4466) 2021-10-25 20:37:44 -07:00
Trask Stalnaker d781995d0a
Less surprising behavior (#4349)
* Less surprising behavior
2021-10-13 10:10:03 +03:00
Trask Stalnaker cfdc4ac7e5
Change the default javaagent artifact to have exporters (#4106)
* Change default javaagent to all, introduce slim

* Update release builds

* Update examples build

* Update benchmark-overhead

* Update benchmark-e2e

* Update docs where ok pre-release

* Update misc

* Fix references to fullJavaagentJar

* Fix it

* Delete doc for pre-1.0 releases

* Attach backwards compatible "all" artifact to releases

* Comment

* Comment

* guessing

* fix

* Update version

* Add otlp/grpc exporter to slim artifact

* Fix comment
2021-10-02 11:28:11 -07:00
Mateusz Rzeszutek c11b96e4d0
Make it possible to use InstrumentationContext (now VirtualField) fro… (#4218)
* Make it possible to use InstrumentationContext (now VirtualField) from library instrumentation

* fix tests

* fix javadocs

* fix some more tests

* code review comments

* setIfNull, computeIfNull
2021-10-01 11:13:11 +02:00
Trask Stalnaker 330f66a7bc
Remove problem files from META-INF (#4203) 2021-09-27 10:09:54 -07:00
Lauri Tulmin 559cdcbbee
Transform lambda classes (#4182)
* Transform lambda classes

* improve comment
2021-09-24 09:52:15 -07:00
Lauri Tulmin 436184002c
Bridge trace builder (#4090)
* Bridge tracer builder

* put api 1.4 bridging into separate moulde

* remove duplicate test

* remove testing dependencies

* use static import

* Update instrumentation/opentelemetry-api/opentelemetry-api-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/opentelemetryapi/trace/ApplicationTracerProvider.java

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* rename make -> create

* replace reflection with methodhandle

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2021-09-13 09:30:02 -07:00