diff --git a/.htmltest.yml b/.htmltest.yml index 8e64377a99d9..53e80a8d75fb 100644 --- a/.htmltest.yml +++ b/.htmltest.yml @@ -72,5 +72,3 @@ IgnoreURLs: # list of regexs of paths or URLs to be ignored - ^https://wikipedia.org/wiki/(S.M.A.R.T|Hop_) # TODO move into content/en/blog/2023/contributing-to-otel/index.md once https://github.com/open-telemetry/opentelemetry.io/issues/3889 is implemented - ^https://shorturl.at/vLYZ0$ - # TODO remove while or after fixing https://github.com/open-telemetry/opentelemetry.io/issues/4656 - - ^/docs/specs/otel/versioning-and-stability/#experimental diff --git a/content/en/docs/concepts/instrumentation/libraries.md b/content/en/docs/concepts/instrumentation/libraries.md index a2bd6b7cd3a6..8077817eb8f9 100644 --- a/content/en/docs/concepts/instrumentation/libraries.md +++ b/content/en/docs/concepts/instrumentation/libraries.md @@ -115,7 +115,7 @@ You may be rightfully concerned about adding new dependencies, here are some considerations to help you decide how to minimize dependency hell: - OpenTelemetry Trace API reached stability in early 2021, it follows - [Semantic Versioning 2.0](/docs/specs/otel/versioning-and-stability) and we + [Semantic Versioning 2.0](/docs/specs/otel/versioning-and-stability/) and we take API stability seriously. - When taking dependency, use the earliest stable OpenTelemetry API (1.0.\*) and avoid updating it unless you have to use new features. diff --git a/content/en/docs/languages/java/instrumentation.md b/content/en/docs/languages/java/instrumentation.md index 146f5e474c7e..686f7d2cc15d 100644 --- a/content/en/docs/languages/java/instrumentation.md +++ b/content/en/docs/languages/java/instrumentation.md @@ -571,7 +571,7 @@ If you followed the instructions to [initialize the SDK](#initialize-the-sdk) above, you have a `TracerProvider` setup for you already. You can continue with [acquiring a tracer](#acquiring-a-tracer). -### Acquiring a Tracer +### Acquiring a tracer To do [Tracing](/docs/concepts/signals/traces/) you'll need to acquire a [`Tracer`](/docs/concepts/signals/traces/#tracer). @@ -676,6 +676,36 @@ Tracer tracer = GlobalOpenTelemetry.getTracer("instrumentation-scope-name", "ins Note that you can't force end users to configure the global, so this is the most brittle option for library instrumentation. +### Acquiring a tracer in Java agent + +If you are using the [Java agent], you can acquire a `Tracer` from the global OpenTelemetry +instance: + +```java +import io.opentelemetry.api.GlobalOpenTelemetry; + +Tracer tracer = GlobalOpenTelemetry.getTracer("application"); +``` + +### Acquiring a tracer in Spring Boot starter + +If you are using the [Spring Boot starter], you can acquire a `Tracer` from the +autowired OpenTelemetry instance: + +```java +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.trace.Tracer; + +@Controller +public class MyController { + private final Tracer tracer; + + public MyController(OpenTelemetry openTelemetry) { + this.tracer = openTelemetry.getTracer("application"); + } +} +``` + ### Create Spans Now that you have [tracers](/docs/concepts/signals/traces/#tracer) initialized, @@ -1194,7 +1224,7 @@ OpenTelemetry openTelemetry = OpenTelemetrySdk.builder() .build(); ``` -### Acquiring a Meter +### Acquiring a meter Anywhere in your application where you have manually instrumented code you can call `opentelemetry.meterBuilder(instrumentationScopeName)` to get or create a @@ -1216,6 +1246,38 @@ Now that you have [meters](/docs/concepts/signals/metrics/#meter) initialized. you can create [metric instruments](/docs/concepts/signals/metrics/#metric-instruments). +### Acquiring a meter in Java agent + +If you are using the [Java agent], you can acquire a `Meter` from the global OpenTelemetry +instance: + +```java +import io.opentelemetry.api.GlobalOpenTelemetry; + +Meter meter = GlobalOpenTelemetry.getMeter("application"); +``` + +### Acquiring a meter in Spring Boot starter + +If you are using the [Spring Boot starter], you can acquire a `Meter` from the +autowired OpenTelemetry instance: + +```java +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.metrics.Meter; + +@Controller +public class MyController { + private final Meter meter; + + public MyController(OpenTelemetry openTelemetry) { + this.meter = openTelemetry.getMeter("application"); + } +} +``` + +a + ### Using Counters Counters can be used to measure non-negative, increasing values. @@ -1857,3 +1919,5 @@ io.opentelemetry.sdk.trace.export.BatchSpanProcessor = io.opentelemetry.extensio https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/ParentBasedSampler.java [traceidratiobased]: https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/samplers/TraceIdRatioBasedSampler.java +[Java agent]: /docs/zero-code/java/agent/ +[Spring Boot starter]: /docs/zero-code/java/spring-boot-starter/ diff --git a/content/en/docs/zero-code/java/_index.md b/content/en/docs/zero-code/java/_index.md index aa82346ebeed..c1d0290b3072 100644 --- a/content/en/docs/zero-code/java/_index.md +++ b/content/en/docs/zero-code/java/_index.md @@ -7,7 +7,7 @@ aliases: cascade: vers: instrumentation: 2.4.0 - otel: 1.38.0 + otel: 1.39.0 --- Zero-code instrumentation with Java uses a Java agent JAR or Spring Boot diff --git a/data/registry/instrumentation-js-cerbos.yml b/data/registry/instrumentation-js-cerbos.yml index c16a310b167a..edd52bcbbdbe 100644 --- a/data/registry/instrumentation-js-cerbos.yml +++ b/data/registry/instrumentation-js-cerbos.yml @@ -18,5 +18,5 @@ createdAt: 2023-09-13 package: name: '@cerbos/opentelemetry' registry: npm - version: 0.5.0 + version: 0.5.1 isFirstParty: true diff --git a/data/registry/instrumentation-ruby-all.yml b/data/registry/instrumentation-ruby-all.yml index 425025db8ef2..010d96ceefaf 100644 --- a/data/registry/instrumentation-ruby-all.yml +++ b/data/registry/instrumentation-ruby-all.yml @@ -14,4 +14,4 @@ createdAt: 2020-11-09 package: registry: gems name: opentelemetry-instrumentation-all - version: 0.60.0 + version: 0.61.0 diff --git a/data/registry/instrumentation-ruby-ethon.yml b/data/registry/instrumentation-ruby-ethon.yml index 5e10c103b83c..b15b7b1898ca 100644 --- a/data/registry/instrumentation-ruby-ethon.yml +++ b/data/registry/instrumentation-ruby-ethon.yml @@ -15,4 +15,4 @@ createdAt: 2020-11-09 package: registry: gems name: opentelemetry-instrumentation-ethon - version: 0.21.5 + version: 0.21.6 diff --git a/data/registry/instrumentation-ruby-rails.yml b/data/registry/instrumentation-ruby-rails.yml index e6cbd3b5ac37..e0171514ef31 100644 --- a/data/registry/instrumentation-ruby-rails.yml +++ b/data/registry/instrumentation-ruby-rails.yml @@ -14,4 +14,4 @@ createdAt: 2020-11-09 package: registry: gems name: opentelemetry-instrumentation-rails - version: 0.30.1 + version: 0.30.2 diff --git a/layouts/partials/docs/get-signal-status.html b/layouts/partials/docs/get-signal-status.html new file mode 100644 index 000000000000..a1964fa143de --- /dev/null +++ b/layouts/partials/docs/get-signal-status.html @@ -0,0 +1,31 @@ +{{/* + + Returns the maturity status of the given signal for the given language. + + Arguments: + + .lang the instrumentation language + .signal the signal name; must be a legal field of the Instrumentation data file. + + */ -}} + +{{ $status := "-" -}} +{{ $signal := .signal -}} + +{{ with index site.Data.instrumentation .lang -}} + {{ with index .status $signal -}} + {{ $statusWeCanLinkTo := "stable development" -}} + {{ $status = cond (or (eq "experimental" .) (eq "in development" .)) "development" . -}} + {{ $humanizedStatus := humanize $status -}} + {{ $status = cond (in $statusWeCanLinkTo $status) + (printf "[%s](/docs/specs/otel/versioning-and-stability/#%s)" $humanizedStatus $status) + (cond (in "alpha beta" $status) + (printf "[%s](https://github.com/open-telemetry/oteps/blob/main/text/0232-maturity-of-otel.md#%s)" $humanizedStatus $status) + $humanizedStatus) + -}} + {{ end -}} +{{ else -}} + {{ errorf "The site.Data.instrumentation map has no language key '%s'." .lang -}} +{{ end -}} + +{{ return $status -}} diff --git a/layouts/shortcodes/docs/languages/index-intro.md b/layouts/shortcodes/docs/languages/index-intro.md index a84562afa822..986398689d71 100644 --- a/layouts/shortcodes/docs/languages/index-intro.md +++ b/layouts/shortcodes/docs/languages/index-intro.md @@ -5,18 +5,10 @@ {{ $lang := .Get 0 -}} {{ $data := index $.Site.Data.instrumentation $lang }} {{ $name := $data.name -}} -{{ $tracesStatus := $data.status.traces | humanize -}} -{{ $metricsStatus := $data.status.metrics | humanize -}} -{{ $logsStatus := $data.status.logs | humanize -}} -{{ if in "Stable Experimental" $tracesStatus -}} - {{ $tracesStatus = printf "[%s](/docs/specs/otel/versioning-and-stability/#%s)" $tracesStatus $data.status.traces -}} -{{ end -}} -{{ if in "Stable Experimental" $metricsStatus -}} - {{ $metricsStatus = printf "[%s](/docs/specs/otel/versioning-and-stability/#%s)" $metricsStatus $data.status.metrics -}} -{{ end -}} -{{ if in "Stable Experimental" $logsStatus -}} - {{ $logsStatus = printf "[%s](/docs/specs/otel/versioning-and-stability/#%s)" $logsStatus $data.status.logs -}} -{{ end -}} + +{{ $tracesStatus := partial "docs/get-signal-status.html" (dict "lang" $lang "signal" "traces") -}} +{{ $metricsStatus := partial "docs/get-signal-status.html" (dict "lang" $lang "signal" "metrics") -}} +{{ $logsStatus := partial "docs/get-signal-status.html" (dict "lang" $lang "signal" "logs") -}} This is the OpenTelemetry {{ $name }} documentation. OpenTelemetry is an observability framework -- an API, SDK, and tools that are designed to aid in