diff --git a/.gitmodules b/.gitmodules index 1cb9b8063dc8..240369f5b5dc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ [submodule "content-modules/opentelemetry-specification"] path = content-modules/opentelemetry-specification url = https://github.com/open-telemetry/opentelemetry-specification.git - spec-pin = v1.30.0 + spec-pin = v1.31.0 [submodule "content-modules/community"] path = content-modules/community url = https://github.com/open-telemetry/community diff --git a/content-modules/opentelemetry-specification b/content-modules/opentelemetry-specification index 5d9cef817415..3985e212f0ef 160000 --- a/content-modules/opentelemetry-specification +++ b/content-modules/opentelemetry-specification @@ -1 +1 @@ -Subproject commit 5d9cef817415a15aaa4883e184a38adec79096ed +Subproject commit 3985e212f0ef5439daf9b10f0ee490e349c69368 diff --git a/content/en/blog/2024/opentelemetry-announced-support-for-profiling b/content/en/blog/2024/opentelemetry-announced-support-for-profiling new file mode 100644 index 000000000000..06cf4ed956f1 --- /dev/null +++ b/content/en/blog/2024/opentelemetry-announced-support-for-profiling @@ -0,0 +1,41 @@ +--- +title: OpenTelemetry announces support for profiling +linkTitle: OpenTelemetry announces support for profiling +date: 2024-03-19 +# prettier-ignore +cSpell:ignore: stuff probably +author: '[Austin Parker](https://github.com/austinlparker) (Honeycomb)' +--- + +In 2023, OpenTelemetry announced that it achieved stability for [logs, metrics, and traces](https://www.cncf.io/blog/2023/11/07/opentelemetry-at-kubecon-cloudnativecon-north-america-2023-update/). While this was our initial goal at the formation of the project, fulfilling our vision of enabling built-in observability for cloud native applications requires us to continue evolving with the community. This year, we’re proud to announce that exactly two years after the Profiling SIG was created at KubeCon + CloudNativeCon Europe 2022 in Valencia, we’re taking a big step towards this goal by merging a profiling data model into our specification and working towards a stable implementation this year! + +## What is profiling? + +Profiling is a method to dynamically inspect the behavior and performance of application code at run-time. Continuous profiling gives insights into resource utilization at a code-level and allows for this profiling data to be stored, queried, and analyzed over time and across different attributes. It’s an important technique for developers and performance engineers to understand exactly what’s happening in their code. OpenTelemetry’s [profiling signal](https://github.com/open-telemetry/oteps/blob/main/text/profiles/0239-profiles-data-model.md) expands upon the work that has been done in this space and, as a first for the industry, connects profiles with other telemetry signals from applications and infrastructure. This allows developers and operators to correlate resource exhaustion or poor user experience across their services with not just the specific service or pod being impacted, but the function or line of code most responsible for it. + +We’re thrilled to see the embrace of this vision by the industry, with many organizations coming together to help define the profiling signal. More specifically, the following two donations are in play: + +- Elastic has [pledged to donate](https://github.com/open-telemetry/community/issues/1918) their proprietary eBPF-based profiling agent 1 +- Splunk has begun the process of [donating their .NET based profiler](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/3196) + +These are being donated to the project in order to accelerate the delivery and implementation of OpenTelemetry profiling. + +## What does this mean for users? + +Profiles will support bi-directional links between themselves and other signals, such as logs, metrics, and traces. You’ll be able to easily jump from resource telemetry to a corresponding profile. For example: + +- Metrics to profiles: You will be able to go from a spike in CPU usage or memory usage to the specific pieces of the code which are consuming that resource +- Traces to profiles: You will be able to understand not just the location of latency across your services, but when that latency is caused by pieces of the code it will be reflected in a profile attached to a trace or span +- Logs to profiles: Logs often give the context that something is wrong, but profiling will allow you to go from just tracking something (i.e. Out Of Memory errors) to seeing exactly which parts of the code are using up memory resources + +These are just a few and these links work the opposite direction as well, but more generally profiling helps deliver on the promise of observability by making it easier for users to query and understand an entire new dimension about their applications with minimal additional code/effort. + +A community in motion + +This work would not be possible without the dedicated contributors who work on OpenTelemetry each day. We’ve recently passed a new milestone, with over 1000 unique developers contributing to the project each month, representing over 180 companies. Across our most popular repositories, OpenTelemetry sees over 30 million downloads a month2, and new open source projects are adopting our standards at a regular pace, including [Apache Kafka](https://cwiki.apache.org/confluence/display/KAFKA/KIP-714%3A+Client+metrics+and+observability), and [dozens more](https://opentelemetry.io/ecosystem/integrations/). We’re also deepening our integrations with other open source projects in CNCF and out, such as [OpenFeature](https://openfeature.dev) and [OpenSearch](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23611), in addition to our existing integrations with Kubernetes, Thanos, Knative, and many more. + +2024 promises to be another big year for OpenTelemetry as we continue to implement and stabilize our existing tracing, metrics, and log signals while adding support for profiling, client-side RUM, and more. It’s a great time to get involved – check out our [website](https://opentelemetry.io) to learn more! + +1 Pending due diligence and review by the OpenTelemetry maintainers. +2 According to public download statistics of our .NET, Java, and Python APIs + diff --git a/content/en/blog/2024/scaling-opentelemetry-collectors.md b/content/en/blog/2024/scaling-opentelemetry-collectors.md new file mode 100644 index 000000000000..42092b861dfc --- /dev/null +++ b/content/en/blog/2024/scaling-opentelemetry-collectors.md @@ -0,0 +1,229 @@ +--- +title: Manage OpenTelemetry Collectors at Scale with Ansible +linkTitle: OTel Collector with Ansible +date: 2024-03-12 +author: '[Ishan Jain](https://github.com/ishanjainn) (Grafana)' +cSpell:ignore: ansible Ishan Jain +--- + +This guide is focused on scaling the +[OpenTelemetry Collector deployment](/docs/collector/deployment/) across various +Linux hosts by leveraging [Ansible](https://www.ansible.com/), to function both +as [gateways](/docs/collector/deployment/gateway/) and +[agents](/docs/collector/deployment/agent/) within your observability +architecture. Utilizing the OpenTelemetry Collector in this dual capacity +enables a robust collection and forwarding of metrics, traces, and logs to +analysis and visualization platforms. + +Here, we outline a strategy for deploying and managing the OpenTelemetry +Collector's scalable instances throughout your infrastructure with Ansible, +enhancing your overall monitoring strategy and data visualization capabilities +in [Grafana](https://grafana.com/). + +## Before you begin + +To follow this guide, ensure you have: + +- Ansible Installed in your system +- Linux hosts along with SSH access to each of these Linux hosts. +- Prometheus for gathering metrics + +## Install the Grafana Ansible collection + +The +[OpenTelemetry Collector role](https://github.com/grafana/grafana-ansible-collection/tree/main/roles/opentelemetry_collector) +is provided through the +[Grafana Ansible collection](https://docs.ansible.com/ansible/latest/collections/grafana/grafana/) +as of the 3.0.0 release. + +To install the Grafana Ansible collection, run this command: + +```shell +ansible-galaxy collection install grafana.grafana +``` + +## Create an Ansible inventory file + +Next, you will set up your hosts and create an inventory file. + +1. Create your hosts and add public SSH keys to them. + + This example uses eight Linux hosts: two Ubuntu hosts, two CentOS hosts, two + Fedora hosts, and two Debian hosts. + +2. Create an Ansible inventory file. + + The Ansible inventory, which resides in a file named `inventory`, looks + similar to this: + + ```ini + 10.0.0.1 # hostname = ubuntu-01 + 10.0.0.2 # hostname = ubuntu-02 + 10.0.0.3 # hostname = centos-01 + 10.0.0.4 # hostname = centos-02 + 10.0.0.5 # hostname = debian-01 + 10.0.0.6 # hostname = debian-02 + 10.0.0.7 # hostname = fedora-01 + 10.0.0.8 # hostname = fedora-02 + ``` + + > **Note**: If you are copying the above file, remove the comments (#). + +3. Create an `ansible.cfg` file within the same directory as `inventory`, with + the following values: + + ```cfg + [defaults] + inventory = inventory # Path to the inventory file + private_key_file = ~/.ssh/id_rsa # Path to my private SSH Key + remote_user=root + ``` + +## Use the OpenTelemetry Collector Ansible role + +Next, you'll define an Ansible playbook to apply your chosen or created +OpenTelemetry Collector role across your hosts. + +Create a file named `deploy-opentelemetry.yml` in the same directory as your +`ansible.cfg` and `inventory`. + +```yaml +- name: Install OpenTelemetry Collector + hosts: all + become: true + + tasks: + - name: Install OpenTelemetry Collector + ansible.builtin.include_role: + name: opentelemetry_collectorr + vars: + otel_collector_receivers: + hostmetrics: + collection_interval: 60s + scrapers: + cpu: {} + disk: {} + load: {} + filesystem: {} + memory: {} + network: {} + paging: {} + process: + mute_process_name_error: true + mute_process_exe_error: true + mute_process_io_error: true + processes: {} + + otel_collector_processors: + batch: + resourcedetection: + detectors: [env, system] + timeout: 2s + system: + hostname_sources: [os] + transform/add_resource_attributes_as_metric_attributes: + error_mode: ignore + metric_statements: + - context: datapoint + statements: + - set(attributes["deployment.environment"], + resource.attributes["deployment.environment"]) + - set(attributes["service.version"], + resource.attributes["service.version"]) + + otel_collector_exporters: + prometheusremotewrite: + endpoint: https:///api/prom/push + headers: + Authorization: 'Basic ' + + otel_collector_service: + pipelines: + metrics: + receivers: [hostmetrics] + processors: + [ + resourcedetection, + transform/add_resource_attributes_as_metric_attributes, + batch, + ] + exporters: [prometheusremotewrite] +``` + +{{% alert title="Note" %}} + +You'll need to adjust the configuration to match the specific telemetry you +intend to collect and where you plan to forward it. This configuration snippet +is a basic example designed for collecting host metrics and forwarded to +Prometheus. + +{{% /alert %}} + +The previous configuration would provision the OpenTelemetry Collector to +collect host metrics from the Linux host. + +## Running the Ansible playbook + +Deploy the OpenTelemetry Collector across your hosts by executing: + +```sh +ansible-playbook deploy-opentelemetry.yml +``` + +## Visualizing Metrics in Grafana + +Once your OpenTelemetry Collector's start sending metrics to Prometheus, follow +these quick steps to visualize them in [Grafana](https://grafana.com/): + +### Setup Grafana + +1. **Install Docker**: Make sure Docker is installed on your system. If it's + not, you can find the installation guide at the + [official Docker website](https://docs.docker.com/get-docker/). + +2. **Run Grafana Docker Container**: Start a Grafana server with this Docker + command, which fetches the latest Grafana image: + + ```sh + docker run -d -p 3000:3000 --name=grafana grafana/grafana + ``` + +3. **Access Grafana**: Navigate to `http://localhost:3000` in your web browser. + The default login details are `admin` for both the username and password. + +4. **Change Password**: Upon your first login, you will be prompted to set a new + password. Make sure to pick a secure one. + +For other installation methods and more detailed instructions, refer to the +[official Grafana documentation](https://grafana.com/docs/grafana/latest/installation/). + +### Add Prometheus as a Data Source + +1. **Login to Grafana** and navigate to **Connections** > **Data Sources**. +2. Click **Add data source**, and choose **Prometheus**. +3. In the settings, enter your Prometheus URL, for example, + `http://`, along with any other necessary details, and + then click **Save & Test**. + +### Explore metrics + +1. Go to the **Explore** page +2. In the Query editor, select your Prometheus data source and enter the below + query + + ```PromQL + 100 - (avg by (cpu) (irate(system_cpu_time{state="idle"}[5m])) * 100) + ``` + + This query calculates the average percentage of CPU time not spent in the + "idle" state, across each CPU core, over the last 5 minutes. + +3. Play around with different metrics and start putting together your dashboards + to gain insights into your system's performance. + +This guide makes it easier for you to set up the OpenTelemetry Collector on +several Linux machines with the help of Ansible and shows you how to see the +data it collects in Grafana. You can adjust the settings for the OpenTelemetry +Collector and design your Grafana dashboards to meet your own monitoring and +tracking needs. This way, you get exactly the insights you want from your +systems, making your job as a developer a bit easier. diff --git a/content/en/docs/collector/architecture.md b/content/en/docs/collector/architecture.md index 3a0073f95ab5..a7dd432642bb 100644 --- a/content/en/docs/collector/architecture.md +++ b/content/en/docs/collector/architecture.md @@ -211,8 +211,7 @@ processor. Processors can transform the data before forwarding it, such as adding or removing attributes from spans. They can also drop the data by deciding not to forward it (for example, the `probabilisticsampler` processor). Or they can -generate new data, as the `spanmetrics` processor does by producing metrics for -spans processed by the pipeline. +generate new data. The same name of the processor can be referenced in the `processors` key of multiple pipelines. In this case, the same configuration is used for each of diff --git a/content/en/docs/collector/troubleshooting.md b/content/en/docs/collector/troubleshooting.md index ac9c4abba203..d83b7cdb821e 100644 --- a/content/en/docs/collector/troubleshooting.md +++ b/content/en/docs/collector/troubleshooting.md @@ -15,6 +15,105 @@ network issues, it can be helpful to send a small amount of data to a collector configured to output to local logs. For details, see [Local exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/troubleshooting.md#local-exporters). +## Check available components in the Collector + +Use the following sub-command to list the available components in a Collector +distribution, including their stability levels. Please note that the output +format may change across versions. + +```sh +otelcol components +``` + +Sample output + +```yaml +buildinfo: + command: otelcol + description: OpenTelemetry Collector + version: 0.96.0 +receivers: + - name: opencensus + stability: + logs: Undefined + metrics: Beta + traces: Beta + - name: prometheus + stability: + logs: Undefined + metrics: Beta + traces: Undefined + - name: zipkin + stability: + logs: Undefined + metrics: Undefined + traces: Beta + - name: otlp + stability: + logs: Beta + metrics: Stable + traces: Stable +processors: + - name: resource + stability: + logs: Beta + metrics: Beta + traces: Beta + - name: span + stability: + logs: Undefined + metrics: Undefined + traces: Alpha + - name: probabilistic_sampler + stability: + logs: Alpha + metrics: Undefined + traces: Beta +exporters: + - name: otlp + stability: + logs: Beta + metrics: Stable + traces: Stable + - name: otlphttp + stability: + logs: Beta + metrics: Stable + traces: Stable + - name: debug + stability: + logs: Development + metrics: Development + traces: Development + - name: prometheus + stability: + logs: Undefined + metrics: Beta + traces: Undefined +connectors: + - name: forward + stability: + logs-to-logs: Beta + logs-to-metrics: Undefined + logs-to-traces: Undefined + metrics-to-logs: Undefined + metrics-to-metrics: Beta + traces-to-traces: Beta +extensions: + - name: zpages + stability: + extension: Beta + - name: memory_ballast + stability: + extension: Deprecated + - name: health_check + stability: + extension: Beta + - name: pprof + stability: + extension: Beta +``` + ## Checklist for debugging complex pipelines It can be difficult to isolate problems when telemetry flows through multiple diff --git a/content/en/docs/demo/architecture.md b/content/en/docs/demo/architecture.md index 2f679cbd48dc..26c706ff4a37 100644 --- a/content/en/docs/demo/architecture.md +++ b/content/en/docs/demo/architecture.md @@ -34,7 +34,8 @@ Internet -->|HTTP| frontendproxy frontendproxy -->|HTTP| frontend loadgenerator -->|HTTP| frontendproxy -accountingservice -->|TCP| queue +queue -->|TCP| accountingservice +queue -->|TCP| frauddetectionservice checkoutservice --->|gRPC| cartservice --> cache checkoutservice --->|gRPC| productcatalogservice @@ -52,8 +53,6 @@ frontend -->|gRPC| currencyservice frontend -->|gRPC| recommendationservice -->|gRPC| productcatalogservice frontend -->|gRPC| shippingservice -->|HTTP| quoteservice -frauddetectionservice -->|TCP| queue - end classDef dotnet fill:#178600,color:white; diff --git a/content/en/docs/demo/feature-flags.md b/content/en/docs/demo/feature-flags.md index c4cdb176428a..80e2a7d283dc 100644 --- a/content/en/docs/demo/feature-flags.md +++ b/content/en/docs/demo/feature-flags.md @@ -13,12 +13,14 @@ feature flag service that supports [OpenFeature](https://openfeature.dev). Flag values are stored in the `demo.flagd.json` file. To enable a flag, change the `defaultVariant` value in the config file for a given flag to "on". -| Feature Flag | Service(s) | Description | -| ----------------------- | --------------- | -------------------------------------------------------------------------------------------------------- | -| `adServiceFailure` | Ad Service | Generate an error for `GetAds` 1/10th of the time | -| `cartServiceFailure` | Cart Service | Generate an error for `EmptyCart` 1/10th of the time | -| `productCatalogFailure` | Product Catalog | Generate an error for `GetProduct` requests with product id: `OLJCESPC7Z` | -| `recommendationCache` | Recommendation | Create a memory leak due to an exponentially growing cache. 1.4x growth, 50% of requests trigger growth. | +| Feature Flag | Service(s) | Description | +| ----------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------- | +| `adServiceFailure` | Ad Service | Generate an error for `GetAds` 1/10th of the time | +| `cartServiceFailure` | Cart Service | Generate an error for `EmptyCart` 1/10th of the time | +| `productCatalogFailure` | Product Catalog | Generate an error for `GetProduct` requests with product id: `OLJCESPC7Z` | +| `recommendationServiceCacheFailure` | Recommendation | Create a memory leak due to an exponentially growing cache. 1.4x growth, 50% of requests trigger growth. | +| `paymentServiceFailure` | Payment Service | Generate an error when calling the `charge` method | +| `paymentServiceUnreachable` | Checkout Service | Use a bad address when calling the PaymentService to make it seem like the PaymentService is unavailable. | ## Feature Flag Architecture diff --git a/content/en/docs/demo/kubernetes-deployment.md b/content/en/docs/demo/kubernetes-deployment.md index 79207c5fc2d5..0a3b164f62ec 100644 --- a/content/en/docs/demo/kubernetes-deployment.md +++ b/content/en/docs/demo/kubernetes-deployment.md @@ -41,7 +41,6 @@ The following command will install the demo application to your Kubernetes cluster. ```shell -kubectl create namespace otel-demo kubectl apply --namespace otel-demo -f https://raw.githubusercontent.com/open-telemetry/opentelemetry-demo/main/kubernetes/opentelemetry-demo.yaml ``` @@ -158,7 +157,6 @@ following sub-paths: - Web store: `/` (base) - Grafana: `/grafana` -- Feature Flags UI: `/feature` - Load Generator UI: `/loadgen/` (must include trailing slash) - Jaeger UI: `/jaeger/ui` diff --git a/content/en/docs/languages/java/_index.md b/content/en/docs/languages/java/_index.md index e1d956d12cd2..7dd76f09f07e 100644 --- a/content/en/docs/languages/java/_index.md +++ b/content/en/docs/languages/java/_index.md @@ -6,7 +6,7 @@ description: >- aliases: [/java, /java/metrics, /java/tracing] cascade: vers: - instrumentation: 2.1.0 + instrumentation: 2.2.0 otel: 1.36.0 semconv: 1.23.1 weight: 18 diff --git a/content/en/docs/languages/java/automatic/configuration.md b/content/en/docs/languages/java/automatic/configuration.md index 5b64b05eb06d..06c4b9a1867e 100644 --- a/content/en/docs/languages/java/automatic/configuration.md +++ b/content/en/docs/languages/java/automatic/configuration.md @@ -30,6 +30,23 @@ specific portions of the SDK & agent: - [Span limits](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure/README.md#span-limits) - [Using SPI to further configure the SDK](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure/README.md#customizing-the-opentelemetry-sdk) +### Enable Resource Providers that are disabled by default + +In addition to the resource configuration from the SDK autoconfiguration, you +can enable additional resource providers that are disabled by default: + +{{% config_option + name="otel.resource.providers.aws.enabled" + default=false +%}} Enables the [AWS Resource Provider](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/aws-resources). +{{% /config_option %}} + +{{% config_option + name="otel.resource.providers.gcp.enabled" + default=false +%}} Enables the [GCP Resource Provider](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/gcp-resources). +{{% /config_option %}} + ## Configuring the agent The agent can consume configuration from one or more of the following sources diff --git a/content/en/docs/languages/java/automatic/spring-boot.md b/content/en/docs/languages/java/automatic/spring-boot.md index e7f05868295b..d6d712c05d38 100644 --- a/content/en/docs/languages/java/automatic/spring-boot.md +++ b/content/en/docs/languages/java/automatic/spring-boot.md @@ -4,7 +4,7 @@ linkTitle: Spring Boot weight: 30 description: Spring Boot instrumentation for OpenTelemetry Java # prettier-ignore -cSpell:ignore: autoconfigurations autoconfigures datasource logback springboot webflux webmvc +cSpell:ignore: autoconfigurations autoconfigures customizer datasource distro logback springboot webflux webmvc --- ## How to instrument Spring Boot with OpenTelemetry @@ -132,9 +132,6 @@ Add the dependency given below to enable the OpenTelemetry starter. The OpenTelemetry starter uses OpenTelemetry Spring Boot [autoconfiguration](https://docs.spring.io/spring-boot/docs/current/reference/html/using.html#using.auto-configuration). -For details concerning supported libraries and features of the OpenTelemetry -autoconfiguration, see the configuration -[README](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/spring/spring-boot-autoconfigure/README.md#features). {{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}} @@ -164,7 +161,41 @@ This spring starter supports which means that you can see and autocomplete all available properties in your IDE. -#### Disable the OpenTelemetry Starter +#### General configuration + +The OpenTelemetry Starter supports all the +[SDK Autoconfiguration](/docs/languages/java/automatic/configuration/#sdk-autoconfiguration) +(since 2.2.0). You can set properties in the `application.properties` or the +`application.yaml` file, or use environment variables. + +`application.properties` example: + +```properties +otel.propagators=tracecontext,b3 +otel.resource.attributes=environment=dev,xyz=foo +``` + +`application.yaml` example: + +```yaml +otel: + propagators: + - tracecontext + - b3 + resource: + attributes: + environment: dev + xyz: foo +``` + +Environment variables example: + +```shell +export OTEL_PROPAGATORS="tracecontext,b3" +export OTEL_RESOURCE_ATTRIBUTES="environment=dev,xyz=foo" +``` + +Disable the OpenTelemetry Starter: {{% config_option name="otel.sdk.disabled" %}} @@ -172,60 +203,165 @@ Set the value to `true` to disable the starter, e.g. for testing purposes. {{% /config_option %}} -#### OpenTelemetry Data Exporters +#### Programmatic configuration -This package provides autoconfiguration the following exporters: +You can use the `AutoConfigurationCustomizerProvider` for programmatic +configuration. Programmatic configuration is recommended for advanced use cases, +which are not configurable using properties. -- OTLP -- Logging +##### Exclude actuator endpoints from tracing -All available properties are listed in the -[Configuration](/docs/languages/java/automatic/configuration/) page. +As an example, you can customize the sampler to exclude health check endpoints +from tracing: -The only difference is that the OpenTelemetry Spring Boot starter uses -`http/protobuf` as the default protocol for the OTLP exporter (as of 2.0.0+). +{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}} -#### Tracer Properties +```xml + + + io.opentelemetry.contrib + opentelemetry-samplers + 1.33.0-alpha + + +``` -| Feature | Property | Default Value | -| ------- | --------------------------------- | ------------- | -| Tracer | `otel.traces.sampler.probability` | 1.0 | +{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}} -#### Resource Properties +```kotlin +dependencies { + implementation("io.opentelemetry.contrib:opentelemetry-samplers:1.33.0-alpha") +} +``` -| Feature | Property | Default Value | -| -------- | ---------------------------------- | ------------- | -| Resource | `otel.springboot.resource.enabled` | true | -| | `otel.resource.attributes` | empty map | +{{% /tab %}} {{< /tabpane>}} -`otel.resource.attributes` supports a pattern-based resource configuration in -the application.properties like this: +```java +import io.opentelemetry.api.trace.SpanKind; +import io.opentelemetry.contrib.sampler.RuleBasedRoutingSampler; +import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider; +import io.opentelemetry.semconv.SemanticAttributes; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; -```properties -otel.resource.attributes.environment=dev -otel.resource.attributes.xyz=foo +@Configuration +public class Application { + + @Bean + public AutoConfigurationCustomizerProvider otelCustomizer() { + return p -> + p.addSamplerCustomizer( + (fallback, config) -> + RuleBasedRoutingSampler.builder(SpanKind.SERVER, fallback) + .drop(SemanticAttributes.URL_PATH, "^/actuator") + .build()); + } +} ``` -It's also possible to specify the resource attributes in `application.yaml`: +#### Resource Providers -```yaml -otel: - resource: - attributes: - environment: dev - xyz: foo +The OpenTelemetry Starter includes +[common Resource Providers](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/resources/library) +and the following Spring Boot specific Resource Providers: + +##### Distribution Resource Provider + +FQN: +`io.opentelemetry.instrumentation.spring.autoconfigure.resources.DistroVersionResourceProvider` + +| Attribute | Value | +| -------------------------- | ----------------------------------- | +| `telemetry.distro.name` | `opentelemetry-spring-boot-starter` | +| `telemetry.distro.version` | version of the starter | + +##### Spring Resource Provider + +FQN: +`io.opentelemetry.instrumentation.spring.autoconfigure.resources.SpringResourceProvider` + +| Attribute | Value | +| ----------------- | ------------------------------------------------------------------------------------------------------------- | +| `service.name` | `spring.application.name` or `build.version` from `build-info.properties` (see [Service name](#service-name)) | +| `service.version` | `build.name` from `build-info.properties` | + +##### AWS Resource Provider + +The +[AWS Resource Provider](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/aws-resources) +can be added as a dependency: + +{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}} + +```xml + + + io.opentelemetry.contrib + opentelemetry-aws-resources + 1.33.0-alpha + + + com.fasterxml.jackson.core + jackson-core + + + com.squareup.okhttp3 + okhttp + + + + ``` -Finally, the resource attributes can be specified as a comma-separated list, as -described in the -[specification](/docs/languages/sdk-configuration/general/#otel_resource_attributes): +{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}} -```shell -export OTEL_RESOURCE_ATTRIBUTES="key1=value1,key2=value2" +```kotlin +implementation("io.opentelemetry.contrib:opentelemetry-aws-resources:1.33.0-alpha") { + exclude("com.fasterxml.jackson.core", "jackson-core") + exclude("com.squareup.okhttp3", "okhttp") +} +``` + +{{% /tab %}} {{< /tabpane>}} + +##### GCP Resource Provider + +The +[GCP Resource Provider](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/gcp-resources) +can be added as a dependency: + +{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}} + +```xml + + + io.opentelemetry.contrib + opentelemetry-gcp-resources + 1.33.0-alpha + + + com.fasterxml.jackson.core + jackson-core + + + + ``` -The service name is determined by the following precedence rules, in accordance -with the OpenTelemetry +{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}} + +```kotlin +implementation("io.opentelemetry.contrib:opentelemetry-gcp-resources:1.33.0-alpha") { + exclude("com.fasterxml.jackson.core", "jackson-core") +} +``` + +{{% /tab %}} {{< /tabpane>}} + +#### Service name + +Using these resource providers, the service name is determined by the following +precedence rules, in accordance with the OpenTelemetry [specification](/docs/languages/sdk-configuration/general/#otel_service_name): 1. `otel.service.name` spring property or `OTEL_SERVICE_NAME` environment @@ -233,7 +369,45 @@ with the OpenTelemetry 2. `service.name` in `otel.resource.attributes` system/spring property or `OTEL_RESOURCE_ATTRIBUTES` environment variable 3. `spring.application.name` spring property -4. The default value is `unknown_service:java` (lowest precedence) +4. `build-info.properties` +5. `Implementation-Title` from META-INF/MANIFEST.MF +6. The default value is `unknown_service:java` (lowest precedence) + +Use the following snippet in your pom.xml file to generate the +`build-info.properties` file: + +{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}} + +```xml + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + build-info + repackage + + + + + + +``` + +{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}} + +```kotlin +springBoot { + buildInfo { + } +} +``` + +{{% /tab %}} {{< /tabpane>}} ### Automatic instrumentation @@ -420,38 +594,6 @@ span by annotating the method parameters with `@SpanAttribute`. | ----------- | ------------------------------------------ | ------------- | ------------------ | | `@WithSpan` | `otel.instrumentation.annotations.enabled` | true | WithSpan, Aspect | -##### Dependency - -{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}} - -```xml - - - org.springframework - spring-aop - SPRING_VERSION - - - io.opentelemetry - opentelemetry-instrumentation-annotations - {{% param vers.instrumentation %}} - - -``` - -{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}} - -```kotlin -dependencies { - implementation("org.springframework:spring-aop:SPRING_VERSION") - implementation("io.opentelemetry:opentelemetry-extension-annotations:{{% param vers.otel %}}") -} -``` - -{{% /tab %}} {{< /tabpane>}} - -##### Usage - ```java import org.springframework.stereotype.Component; diff --git a/data/ecosystem/vendors.yaml b/data/ecosystem/vendors.yaml index a524df8eb9bf..8f978880e224 100644 --- a/data/ecosystem/vendors.yaml +++ b/data/ecosystem/vendors.yaml @@ -1,4 +1,4 @@ -# cSpell:ignore Coralogix Cribl ITRS Kloud Logz Crowdstrike Humio Lumigo observ Uptrace Greptime KloudMate qryn ClickHouse Tracetest opensource OneUptime +# cSpell:ignore Causely Coralogix Cribl ITRS Kloud Logz Crowdstrike Humio Lumigo observ Uptrace Greptime KloudMate qryn ClickHouse Tracetest opensource OneUptime - name: AppDynamics (Cisco) nativeOTLP: true url: 'https://docs.appdynamics.com/latest/en/application-monitoring/appdynamics-for-opentelemetry' @@ -35,6 +35,20 @@ contact: 'hello@betterstack.com' oss: false commercial: true +- name: Causely + distribution: false + nativeOTLP: true + url: 'https://github.com/Causely/documentation' + contact: 'support@causely.io' + oss: false + commercial: true +- name: Chronosphere + distribution: false + nativeOTLP: true + url: 'https://docs.chronosphere.io/ingest/otel/otel-ingest' + contact: 'support@chronosphere.io' + oss: false + commercial: true - name: Control Plane nativeOTLP: true url: 'https://docs.controlplane.com/reference/org#tracing' diff --git a/data/registry/exporter-dotnet-console.yml b/data/registry/exporter-dotnet-console.yml index 23e035433306..9e32bb6b2fc6 100644 --- a/data/registry/exporter-dotnet-console.yml +++ b/data/registry/exporter-dotnet-console.yml @@ -15,4 +15,4 @@ createdAt: 2022-11-07 package: registry: nuget name: OpenTelemetry.Exporter.Console - version: 1.7.0 + version: 1.8.0-beta.1 diff --git a/data/registry/exporter-dotnet-inmemory.yml b/data/registry/exporter-dotnet-inmemory.yml index 7681cb8c3c45..0e488d731f9d 100644 --- a/data/registry/exporter-dotnet-inmemory.yml +++ b/data/registry/exporter-dotnet-inmemory.yml @@ -17,4 +17,4 @@ createdAt: 2022-11-07 package: registry: nuget name: OpenTelemetry.Exporter.InMemory - version: 1.7.0 + version: 1.8.0-beta.1 diff --git a/data/registry/exporter-dotnet-opentelemetryprotocol.yml b/data/registry/exporter-dotnet-opentelemetryprotocol.yml index 16b78eb1b8d0..11384868a51c 100644 --- a/data/registry/exporter-dotnet-opentelemetryprotocol.yml +++ b/data/registry/exporter-dotnet-opentelemetryprotocol.yml @@ -19,4 +19,4 @@ createdAt: 2020-02-05 package: registry: nuget name: OpenTelemetry.Exporter.OpenTelemetryProtocol - version: 1.7.0 + version: 1.8.0-beta.1 diff --git a/data/registry/exporter-dotnet-prometheus-aspnetcore.yml b/data/registry/exporter-dotnet-prometheus-aspnetcore.yml index 7df7b4668064..2a3574d01035 100644 --- a/data/registry/exporter-dotnet-prometheus-aspnetcore.yml +++ b/data/registry/exporter-dotnet-prometheus-aspnetcore.yml @@ -21,4 +21,4 @@ createdAt: 2022-11-07 package: registry: nuget name: OpenTelemetry.Exporter.Prometheus.AspNetCore - version: 1.7.0-rc.1 + version: 1.8.0-beta.1 diff --git a/data/registry/exporter-dotnet-prometheus-httplistener.yml b/data/registry/exporter-dotnet-prometheus-httplistener.yml index a58109f9bb2b..c7777120ce15 100644 --- a/data/registry/exporter-dotnet-prometheus-httplistener.yml +++ b/data/registry/exporter-dotnet-prometheus-httplistener.yml @@ -18,4 +18,4 @@ createdAt: 2022-11-07 package: registry: nuget name: OpenTelemetry.Exporter.Prometheus.HttpListener - version: 1.7.0-rc.1 + version: 1.8.0-beta.1 diff --git a/data/registry/exporter-dotnet-zipkin.yml b/data/registry/exporter-dotnet-zipkin.yml index 9c493ec1faf6..b13e87a2aa86 100644 --- a/data/registry/exporter-dotnet-zipkin.yml +++ b/data/registry/exporter-dotnet-zipkin.yml @@ -12,7 +12,7 @@ authors: package: name: OpenTelemetry.Exporter.Zipkin registry: nuget - version: 1.7.0 + version: 1.8.0-beta.1 urls: repo: https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Exporter.Zipkin createdAt: 2022-11-07 diff --git a/data/registry/exporter-js-instana.yml b/data/registry/exporter-js-instana.yml index d93e340ecefa..7023dc0fdf8e 100644 --- a/data/registry/exporter-js-instana.yml +++ b/data/registry/exporter-js-instana.yml @@ -15,4 +15,4 @@ createdAt: 2022-04-18 package: registry: npm name: '@instana/opentelemetry-exporter' - version: 3.2.0 + version: 3.2.1 diff --git a/data/registry/instrumentation-dotnet-kafkaflow.yml b/data/registry/instrumentation-dotnet-kafkaflow.yml index 85994f8d0bb2..07539cdfbb2f 100644 --- a/data/registry/instrumentation-dotnet-kafkaflow.yml +++ b/data/registry/instrumentation-dotnet-kafkaflow.yml @@ -20,4 +20,4 @@ isFirstParty: true package: name: KafkaFlow.OpenTelemetry registry: nuget - version: 3.0.4 + version: 3.0.5 diff --git a/data/registry/tools-ruby-sentry.yml b/data/registry/tools-ruby-sentry.yml index 9e1da82476c3..c964b0899fac 100644 --- a/data/registry/tools-ruby-sentry.yml +++ b/data/registry/tools-ruby-sentry.yml @@ -23,4 +23,4 @@ createdAt: 2023-01-31 package: registry: gems name: sentry-opentelemetry - version: 5.17.0 + version: 5.17.1 diff --git a/package.json b/package.json index 29a51eb663b6..df83e047a009 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ }, "dependencies": { "@opentelemetry/api": "^1.3.0", - "@opentelemetry/auto-instrumentations-web": "^0.36.0", + "@opentelemetry/auto-instrumentations-web": "^0.37.0", "@opentelemetry/context-zone": "^1.8.0", "@opentelemetry/core": "^1.8.0", "@opentelemetry/exporter-trace-otlp-http": "^0.49.1", diff --git a/scripts/content-modules/adjust-pages.pl b/scripts/content-modules/adjust-pages.pl index 572521c0fe08..9e5d63367a4e 100755 --- a/scripts/content-modules/adjust-pages.pl +++ b/scripts/content-modules/adjust-pages.pl @@ -18,7 +18,7 @@ my $semConvRef = "$otelSpecRepoUrl/blob/main/semantic_conventions/README.md"; my $specBasePath = '/docs/specs'; my %versions = qw( - spec: 1.30.0 + spec: 1.31.0 otlp: 1.1.0 semconv: 1.24.0 ); diff --git a/static/refcache.json b/static/refcache.json index 4c31aefa3bc4..13e7a09818bf 100644 --- a/static/refcache.json +++ b/static/refcache.json @@ -943,6 +943,10 @@ "StatusCode": 206, "LastSeen": "2024-01-18T08:53:34.715996-05:00" }, + "https://docs.chronosphere.io/ingest/otel/otel-ingest": { + "StatusCode": 200, + "LastSeen": "2024-03-19T05:23:55.741827909Z" + }, "https://docs.controlplane.com/reference/org#tracing": { "StatusCode": 206, "LastSeen": "2024-02-21T13:37:33.456267+02:00" @@ -2051,6 +2055,10 @@ "StatusCode": 200, "LastSeen": "2024-01-30T05:18:56.239248-05:00" }, + "https://github.com/Causely/documentation": { + "StatusCode": 200, + "LastSeen": "2024-03-15T20:34:22.210208944Z" + }, "https://github.com/DataDog/dd-opentelemetry-exporter-ruby": { "StatusCode": 200, "LastSeen": "2024-01-18T19:10:56.414699-05:00" @@ -7443,6 +7451,10 @@ "StatusCode": 200, "LastSeen": "2024-01-18T19:07:23.30351-05:00" }, + "https://tools.ietf.org/html/rfc7230#section-3.2.6": { + "StatusCode": 200, + "LastSeen": "2024-03-15T20:34:57.525355021Z" + }, "https://tools.ietf.org/html/rfc7230#section-5.4": { "StatusCode": 200, "LastSeen": "2024-01-18T19:07:34.10242-05:00" @@ -8583,6 +8595,10 @@ "StatusCode": 206, "LastSeen": "2024-01-30T16:14:34.212872-05:00" }, + "https://www.w3.org/TR/baggage/#key": { + "StatusCode": 206, + "LastSeen": "2024-03-15T20:34:48.124860351Z" + }, "https://www.w3.org/TR/trace-context": { "StatusCode": 206, "LastSeen": "2024-01-30T16:14:34.417619-05:00"