Skip to content

Commit 4e7ef74

Browse files
authored
Revert "Clean up OpenTelemetry content" (#1129)
Reverts #985 See elastic/observability-docs#4843 (comment)
1 parent ab79e43 commit 4e7ef74

17 files changed

+825
-27
lines changed

redirects.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,10 @@ redirects:
3030
'solutions/observability/apps/real-user-monitoring-rum.md': 'solutions/observability/apm/real-user-monitoring-rum.md'
3131
'solutions/observability/apps/create-upload-source-maps-rum.md': 'solutions/observability/apm/create-upload-source-maps-rum.md'
3232
'solutions/observability/apps/use-opentelemetry-with-apm.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
33-
'solutions/observability/apps/upstream-opentelemetry-collectors-language-sdks.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
34-
'solutions/observability/apps/collect-metrics.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
35-
'solutions/observability/apps/limitations.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
36-
'solutions/observability/apps/resource-atrributes.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
37-
'solutions/observability/apm/collect-metrics.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
38-
'solutions/observability/apm/limitations.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
39-
'solutions/observability/apm/resource-attributes.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
40-
'solutions/observability/apm/upstream-opentelemetry-collectors-language-sdks.md': 'solutions/observability/apm/use-opentelemetry-with-apm.md'
41-
'solutions/observability/get-started/quickstart-monitor-hosts-with-opentelemetry.md': 'solutions/observability/get-started.md'
42-
'solutions/observability/get-started/quickstart-unified-kubernetes-observability-with-elastic-distributions-of-opentelemetry-edot.md': 'solutions/observability/get-started.md'
33+
'solutions/observability/apps/upstream-opentelemetry-collectors-language-sdks.md': 'solutions/observability/apm/upstream-opentelemetry-collectors-language-sdks.md'
34+
'solutions/observability/apps/collect-metrics.md': 'solutions/observability/apm/collect-metrics.md'
35+
'solutions/observability/apps/limitations.md': 'solutions/observability/apm/limitations.md'
36+
'solutions/observability/apps/resource-atrributes.md': 'solutions/observability/apm/resource-attributes.md'
4337
'solutions/observability/apps/apm-k8s-attacher.md': 'solutions/observability/apm/apm-k8s-attacher.md'
4438
'solutions/observability/apps/monitoring-aws-lambda-functions.md': 'solutions/observability/apm/monitor-aws-lambda-functions.md'
4539
'solutions/observability/apps/integrate-with-jaeger-deprecated.md': 'solutions/observability/apm/jaeger.md'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
mapped_pages:
3+
- https://www.elastic.co/guide/en/observability/current/apm-open-telemetry-collect-metrics.html
4+
- https://www.elastic.co/guide/en/serverless/current/observability-apm-agents-opentelemetry-collect-metrics.html
5+
applies_to:
6+
stack:
7+
serverless:
8+
---
9+
10+
# Collect metrics [apm-open-telemetry-collect-metrics]
11+
12+
::::{important}
13+
When collecting metrics, note that the [`DoubleValueRecorder`](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api/latest/io/opentelemetry/api/metrics/DoubleValueRecorder.md) and [`LongValueRecorder`](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-api/latest/io/opentelemetry/api/metrics/LongValueObserver.md) metrics are not yet supported.
14+
::::
15+
16+
Here’s an example of how to capture business metrics from a Java application.
17+
18+
```java
19+
// initialize metric
20+
Meter meter = GlobalMetricsProvider.getMeter("my-frontend");
21+
DoubleCounter orderValueCounter = meter.doubleCounterBuilder("order_value").build();
22+
23+
public void createOrder(HttpServletRequest request) {
24+
25+
// create order in the database
26+
...
27+
// increment business metrics for monitoring
28+
orderValueCounter.add(orderPrice);
29+
}
30+
```
31+
32+
See the [Open Telemetry Metrics API](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md) for more information.
33+
34+
## Verify OpenTelemetry metrics data [apm-open-telemetry-verify-metrics]
35+
36+
Use **Discover** to validate that metrics are successfully reported to {{kib}}.
37+
38+
1. Open your Observability instance.
39+
2. Find **Discover** in the main menu or use the [global search field](/get-started/the-stack.md#kibana-navigation-search).
40+
3. Click **All logs****Data Views** then select **APM**.
41+
4. Filter the data to only show documents with metrics: `processor.name :"metric"`
42+
5. Narrow your search with a known OpenTelemetry field. For example, if you have an `order_value` field, add `order_value: *` to your search to return only OpenTelemetry metrics documents.
43+
44+
## Visualize your metrics[apm-open-telemetry-visualize]
45+
46+
Use **Lens** to create visualizations for OpenTelemetry metrics. Lens enables you to build visualizations by dragging and dropping data fields. It makes smart visualization suggestions for your data, allowing you to switch between visualization types.
47+
48+
To get started with a new Lens visualization:
49+
50+
1. Go to **Visualizations**.
51+
2. Click **Create new visualization**.
52+
3. Select **Lens**.
53+
54+
For more information on using Lens, refer to the [Lens documentation](/explore-analyze/visualize/lens.md).

solutions/observability/apm/get-started-apm-server-binary.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,9 @@ const apm = initApm({
732732
::::::
733733
734734
::::::{tab-item} OpenTelemetry
735-
Elastic integrates with OpenTelemetry using the Elastic Distribution of OpenTelemetry (EDOT), allowing you to reuse your existing instrumentation to easily send observability data to the {{stack}}.
735+
Elastic integrates with OpenTelemetry, allowing you to reuse your existing instrumentation to easily send observability data to the {{stack}}.
736736
737-
For more information on how to combine Elastic and OpenTelemetry, see the [EDOT documentation](https://elastic.github.io/opentelemetry/).
737+
For more information on how to combine Elastic and OpenTelemetry, see [OpenTelemetry integration](/solutions/observability/apm/use-opentelemetry-with-apm.md).
738738
::::::
739739
740740
:::::::

solutions/observability/apm/get-started-fleet-managed-apm-server.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -773,9 +773,9 @@ const apm = initApm({
773773
::::::
774774
775775
::::::{tab-item} OpenTelemetry
776-
Elastic integrates with OpenTelemetry using the Elastic Distribution of OpenTelemetry (EDOT), allowing you to reuse your existing instrumentation to easily send observability data to the {{stack}}.
776+
Elastic integrates with OpenTelemetry, allowing you to reuse your existing instrumentation to easily send observability data to the {{stack}}.
777777
778-
For more information on how to combine Elastic and OpenTelemetry, see the [EDOT documentation](https://elastic.github.io/opentelemetry/).
778+
For more information on how to combine Elastic and OpenTelemetry, see [OpenTelemetry integration](/solutions/observability/apm/use-opentelemetry-with-apm.md).
779779
::::::
780780
781781
:::::::
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
mapped_pages:
3+
- https://www.elastic.co/guide/en/observability/current/apm-open-telemetry-known-limitations.html
4+
- https://www.elastic.co/guide/en/serverless/current/observability-apm-agents-opentelemetry-limitations.html
5+
applies_to:
6+
stack:
7+
serverless:
8+
---
9+
10+
# Limitations [apm-open-telemetry-known-limitations]
11+
12+
## OpenTelemetry traces [apm-open-telemetry-traces-limitations]
13+
14+
* Traces of applications using `messaging` semantics might be wrongly displayed as `transactions` in the Applications UI, while they should be considered `spans` (see issue [#7001](https://github.com/elastic/apm-server/issues/7001)).
15+
* Inability to see Stack traces in spans.
16+
* Inability in APM views to view the "Time Spent by Span Type" (see issue [#5747](https://github.com/elastic/apm-server/issues/5747)).
17+
18+
## OpenTelemetry logs [apm-open-telemetry-logs-intake]
19+
20+
* [preview] The OpenTelemetry logs intake via Elastic is in technical preview.
21+
* The application logs data stream (`app_logs`) has dynamic mapping disabled. This means the automatic detection and mapping of new fields is disabled (see issue [#9093](https://github.com/elastic/apm-server/issues/9093)).
22+
23+
## OpenTelemetry Line Protocol (OTLP) [apm-open-telemetry-otlp-limitations]
24+
25+
Elastic supports both the [OTLP/gRPC](https://opentelemetry.io/docs/specs/otlp/#otlpgrpc) and [OTLP/HTTP](https://opentelemetry.io/docs/specs/otlp/#otlphttp) protocol with ProtoBuf payload. Elastic does not yet support JSON Encoding for OTLP/HTTP.
26+
27+
## OpenTelemetry Collector exporter for Elastic [apm-open-telemetry-collector-exporter]
28+
29+
The [OpenTelemetry Collector exporter for Elastic](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.57.2/exporter/elasticexporter) has been deprecated and replaced by the native support of the OpenTelemetry Line Protocol in Elastic Observability (OTLP).
30+
31+
The [OpenTelemetry Collector exporter for Elastic](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/elasticsearchexporter) (which is different from the legacy exporter mentioned above) is not intended to be used with Elastic APM and Elastic Observability. Use [Elastic’s native OTLP support](/solutions/observability/apm/upstream-opentelemetry-collectors-language-sdks.md) instead.
32+
33+
% Statefull only for tail-based sampling?
34+
35+
## OpenTelemetry’s tail-based sampling [apm-open-telemetry-tbs]
36+
```{applies_to}
37+
stack: all
38+
```
39+
40+
Tail-based sampling allows to make sampling decisions after all spans of a trace have been completed. This allows for more powerful and informed sampling rules.
41+
42+
When using OpenTelemetry with Elastic APM, there are two different implementations available for tail-based sampling:
43+
44+
* Tail-based sampling using the [tailsamplingprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor) in the OpenTelemetry Collector
45+
* Native [tail-based sampling in the Elastic APM backend](/solutions/observability/apm/transaction-sampling.md#apm-tail-based-sampling)
46+
47+
Using the [tailsamplingprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor) in the OpenTelemetry Collector comes with an important limitation. Elastic’s APM backend calculates span and transaction metrics based on the incoming span events. These metrics are accurate for 100% sampling scenarios. In scenarios with probabilistic sampling, Elastic’s APM backend is being informed about the sampling rate of spans and can extrapolate throughput metrics based on the incoming, partial data. However, with tail-based sampling there’s no clear probability for sampling decisions as the rules can be more complex and the OpenTelemetry Collector does not provide sampling probability information to the Elastic backend that could be used for extrapolation of data. Therefore, there’s no way for Elastic APM to properly extrapolate throughput and count metrics that are derived from span events that have been tail-based sampled in the OpenTelemetry Collector. In these scenarios, derived throughput and count metrics are likely to be inaccurate.
48+
49+
Therefore, we recommend using Elastic’s native tail-based sampling when integrating with OpenTelemetry.

solutions/observability/apm/managed-intake-service-event-api.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -4476,5 +4476,7 @@ The managed intake service supports two OTLP communication protocols on the same
44764476
| OTLP logs intake | `/v1/logs` |
44774477

44784478
::::{tip}
4479-
See our [OpenTelemetry documentation](https://elastic.github.io/opentelemetry/) to learn how to send data to the managed intake service.
4479+
See our [OpenTelemetry docs](/solutions/observability/apm/upstream-opentelemetry-collectors-language-sdks.md) to learn how to send data to the managed intake service from an OpenTelemetry agent OpenTelemetry collector.
4480+
44804481
::::
4482+

solutions/observability/apm/opentelemetry-intake-api.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
mapped_pages:
33
- https://www.elastic.co/guide/en/observability/current/apm-api-otlp.html
4+
applies_to:
5+
stack:
46
---
57

68
# OpenTelemetry intake API [apm-api-otlp]
@@ -29,6 +31,6 @@ APM Server supports two OTLP communication protocols on the same port:
2931
| OTLP logs intake | `/v1/logs` |
3032

3133
::::{tip}
32-
See our [OpenTelemetry documentation](https://elastic.github.io/opentelemetry/) to learn how to send data to the APM Server.
34+
See our OpenTelemetry documentation to learn how to send data to the APM Server from an [OpenTelemetry agent](/solutions/observability/apm/upstream-opentelemetry-collectors-language-sdks.md#apm-instrument-apps-otel) or [OpenTelemetry collector](/solutions/observability/apm/upstream-opentelemetry-collectors-language-sdks.md#apm-connect-open-telemetry-collector).
3335
::::
3436

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
mapped_pages:
3+
- https://www.elastic.co/guide/en/observability/current/apm-open-telemetry-resource-attributes.html
4+
- https://www.elastic.co/guide/en/serverless/current/observability-apm-agents-opentelemetry-resource-attributes.html
5+
applies_to:
6+
stack:
7+
serverless:
8+
---
9+
10+
# Resource attributes [apm-open-telemetry-resource-attributes]
11+
12+
A resource attribute is a key/value pair containing information about the entity producing telemetry. Resource attributes are mapped to Elastic Common Schema (ECS) fields like `service.*`, `cloud.*`, `process.*`, etc. These fields describe the service and the environment that the service runs in.
13+
14+
The examples shown here set the Elastic (ECS) `service.environment` field for the resource, i.e. service, that is producing trace events. Note that Elastic maps the OpenTelemetry `deployment.environment` field to the ECS `service.environment` field on ingestion.
15+
16+
**OpenTelemetry agent**
17+
18+
Use the `OTEL_RESOURCE_ATTRIBUTES` environment variable to pass resource attributes at process invocation.
19+
20+
```bash
21+
export OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production
22+
```
23+
24+
**OpenTelemetry collector**
25+
26+
Use the [resource processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor) to set or apply changes to resource attributes.
27+
28+
```yaml
29+
...
30+
processors:
31+
resource:
32+
attributes:
33+
- key: deployment.environment
34+
action: insert
35+
value: production
36+
...
37+
```
38+
39+
::::{tip}
40+
Need to add event attributes instead? Use attributes—​not to be confused with resource attributes—​to add data to span, log, or metric events. Attributes can be added as a part of the OpenTelemetry instrumentation process or with the [attributes processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/attributesprocessor).
41+
42+
::::
43+
44+
% Stateful only after this?
45+
46+
Elastic integrates with OpenTelemetry, allowing you to reuse your existing instrumentation to easily send observability data to the {{stack}}.
47+
48+
For more information on how to combine Elastic and OpenTelemetry, see [OpenTelemetry integration](/solutions/observability/apm/use-opentelemetry-with-apm.md).

solutions/observability/apm/traces.md

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ In this example, Elastic’s Ruby agent communicates with Elastic’s Java agent
3737
:alt: How traceparent propagation works
3838
:::
3939

40+
In this example, Elastic’s Ruby agent communicates with OpenTelemetry’s Java agent. Both support the `traceparent` header, and trace data is successfully propagated.
41+
42+
:::{image} /solutions/images/observability-dt-trace-ex2.png
43+
:alt: How traceparent propagation works
44+
:::
45+
4046
In this example, the trace meets a piece of middleware that doesn’t propagate the `traceparent` header. The distributed trace ends and any further communication will result in a new trace.
4147

4248
:::{image} /solutions/images/observability-dt-trace-ex3.png

solutions/observability/apm/transaction-sampling.md

+23
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ In the example in *Figure 4*, `Service A` and `Service B` are Elastic-monitored
8484
:title: Using the `restart` trace continuation strategy
8585
:::
8686

87+
### OpenTelemetry [_opentelemetry]
88+
89+
Head-based sampling is implemented directly in the APM agents and SDKs. The sample rate must be propagated between services and the managed intake service in order to produce accurate metrics.
90+
91+
OpenTelemetry offers multiple samplers. However, most samplers do not propagate the sample rate. This results in inaccurate span-based metrics, like APM throughput, latency, and error metrics.
92+
93+
For accurate span-based metrics when using head-based sampling with OpenTelemetry, you must use a [consistent probability sampler](https://opentelemetry.io/docs/specs/otel/trace/tracestate-probability-sampling/). These samplers propagate the sample rate between services and the managed intake service, resulting in accurate metrics.
94+
95+
::::{note}
96+
OpenTelemetry does not offer consistent probability samplers in all languages. OpenTelemetry users should consider using tail-based sampling instead.
97+
98+
Refer to the documentation of your favorite OpenTelemetry agent or SDK for more information on the availability of consistent probability samplers.
99+
100+
::::
101+
102+
% Stateful only for tail-based sampling
103+
87104
## Tail-based sampling [apm-tail-based-sampling]
88105

89106
```{applies_to}
@@ -116,6 +133,12 @@ In this example, `Service A` initiates four transactions. If our sample rate is
116133
:alt: Distributed tracing and tail based sampling example one
117134
:::
118135

136+
### OpenTelemetry with tail-based sampling [_opentelemetry_with_tail_based_sampling]
137+
138+
Tail-based sampling is implemented entirely in APM Server, and will work with traces sent by either Elastic APM agents or OpenTelemetry SDKs.
139+
140+
Due to [OpenTelemetry tail-based sampling limitations](/solutions/observability/apm/limitations.md#apm-open-telemetry-tbs) when using [tailsamplingprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor), we recommend using APM Server tail-based sampling instead.
141+
119142
### Tail-based sampling performance and requirements [_tail_based_sampling_performance_and_requirements]
120143

121144
Tail-based sampling (TBS), by definition, requires storing events locally temporarily, such that they can be retrieved and forwarded when a sampling decision is made.

0 commit comments

Comments
 (0)