Skip to content

Collect data with Elastic Cloud Native OpenTelemetry Endpoint #4854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/en/serverless/images/hosts-ui-otlp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/en/serverless/images/resource-attrs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/en/serverless/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ include::./quickstarts/k8s-logs-metrics.asciidoc[leveloffset=+3]
include::./quickstarts/monitor-hosts-with-otel.asciidoc[leveloffset=+3]
include::./quickstarts/monitor-k8s-otel.asciidoc[leveloffset=+3]
include::./quickstarts/collect-data-with-aws-firehose.asciidoc[leveloffset=+3]
include::./quickstarts/collect-data-with-native-otlp.asciidoc[leveloffset=+3]

// Dashboards
include::./dashboards/dashboards-and-visualizations.asciidoc[leveloffset=+3]
Expand Down Expand Up @@ -78,6 +79,9 @@ include::./synthetics/synthetics-security-encryption.asciidoc[leveloffset=+4]

include::./synthetics/synthetics-troubleshooting.asciidoc[leveloffset=+4]

// OTLP
include::./otlp-visualize.asciidoc[leveloffset=+3]

// Group: Infrastructure and hosts
include::./infrastructure-and-host-monitoring-intro.asciidoc[leveloffset=+2]

Expand Down
51 changes: 51 additions & 0 deletions docs/en/serverless/otlp-visualize.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[[otlp-visualize]]
= Visualize OTLP data

TIP: Want to ingest OpenTelemetry data? See <<collect-data-with-native-otlp>>.

[discrete]
== Get creative with Discover

Discover allows you to quickly search and filter your data, get information about the structure of the fields in your data, and display your findings in a visualization.
Find **Discover** in your {obs-serverless} project's UI under *Analyze / Discover*.

Attributes and resource attributes are prefixed with `attributes.*` and `resource.attributes.*`.
You can correlate all signals with a single `resource.attributes.*`.

[role="screenshot"]
image::images/resource-attrs.png[resource attributes]

See {kibana-ref}/discover.html[Discover] to learn more.

[discrete]
== Monitor application performance

The Applications UI allows you to monitor your software services and applications in real-time. You can visualize detailed performance information on your services, identify and analyze errors, and monitor host-level metrics.

[discrete]
== Check the health of your infrastructure

To access the **Hosts** page, in your {obs-serverless} project, go to
**Infrastructure** → **Hosts**.

On the Hosts page, you can view health and performance metrics to help you quickly:

* Analyze and compare hosts without having to build new dashboards.
* Identify which hosts trigger the most alerts.
* Troubleshoot and resolve issues quickly.

[role="screenshot"]
image::images/hosts-ui-otlp.png[resource attributes]

See {observability-guide}/analyze-hosts.html[Analyze and compare hosts] to learn more.

[discrete]
=== (Optional) Install the OpenTelemetry Assets integration

Install the OpenTelemetry Assets integrations to access the "[OTEL][Metrics Kubernetes] Cluster Overview" dashboard.
This dashboard

In your {obs-serverless} project, go to **Integrations** and toggle **Display beta integrations**.
Search for "OpenTelemetry" and select and install **Kubernetes OpenTelemetry Assets**.

// Does anyone have a cluster with relevant data that we can use to take a screenshot of this dashboard?
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
[[collect-data-with-native-otlp]]
= Quickstart: Send data to the Elastic Cloud Managed OTLP Endpoint

preview::[]

In this quickstart guide, you'll learn how to use the Elastic Cloud Managed OTLP Endpoint to send logs, metrics, and traces to Elastic.

[discrete]
== What is the Elastic Cloud Managed OTLP endpoint?

The Managed OTLP Endpoint is a fully managed offering exclusively for Elastic Cloud users (initially available in Elastic Cloud Serverless only) that simplifies OpenTelemetry data ingestion. It provides an endpoint for OpenTelemetry SDKs and Collectors to send telemetry data, with Elastic handling scaling, data processing, and storage.

This endpoint is designed for the following use cases:

* Logs & Infrastructure Monitoring: Logs forwarded in OTLP format and host and Kubernetes metrics in OTLP format.
* APM: Application telemetry in OTLP format.

[%collapsible]
.Differences from the existing Elastic APM Endpoint
====
The Elastic Cloud Managed OTLP Endpoint ensures that OpenTelemetry data is stored without any schema translation, preserving both OpenTelemetry semantic conventions and resource attributes. It supports ingesting OTLP logs, metrics, and traces in a unified manner, ensuring consistent treatment across all telemetry data. This marks a significant improvement over the {observability-guide}/apm-open-telemetry.html[existing functionality], which primarily focuses on traces and the APM use case.
====

[discrete]
== Prerequisites

* An {obs-serverless} project. To learn more, refer to <<observability-create-an-observability-project>>.
* A system forwarding logs, metrics, or traces in OTLP (any OTel Collector or SDK—EDOT or community).

[discrete]
=== Limitations

* The OTLP endpoint only supports histograms with delta temporality. Cumulative histograms are dropped.
* Latency distributions based on histogram values have limited precision due to the fixed boundaries of explicit bucket histograms.
* Per-project rate limits apply. If you hit this limit, reach out to our https://support.elastic.co[support team].

[discrete]
== Get started

[discrete]
=== Get your native OTLP endpoint credentials

. <<observability-create-an-observability-project,Create a new {obs-serverless} project>>, or open an existing one.

. In your {obs-serverless} project, go to **Add Data**.

. Under **What do you want to monitor?** select **Application**, and then under **Monitor your application using** select **OpenTelemetry**.
+
NOTE: Follow this flow for all use cases, including logs and infrastructure monitoring.

. Copy the `OTEL_EXPORTER_OTLP_ENDPOINT` URL. Replace `.apm` with `.ingest` and save this value for later.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users will no longer have to edit the endpoint, the actual endpoint url will be displayed in the cloud console and also in the application onboarding. I recommend we guide users to obtain the endpoint from cloud console.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: We should recommend users go to the cloud console for both the Endpoint and API key, not the onboarding flow?

Should we doc both?

Copy link
Member Author

@bmorelli25 bmorelli25 Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to: "Managed OTLP endpoint"
Update to use Cloud Console to reduce confusion about what type of data is supported

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mlunadia I'm not able to replicate this page in the cloud console.

When I click on "Manage project API keys" I'm taken to this page
Screenshot 2025-03-26 at 8 03 06 PM


[discrete]
=== Create an API key

. Click "Create an API Key" to generate a new API key. Copy this value for later.
. (Optional) Test your new API key. You can do this by sending an empty JSON object to the `/v1/traces` endpoint. For example:
+
[source,bash]
----
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey <api-key>" \
https://{YOUR_CLUSTER}.ingest.us-east-1.aws.elastic.cloud:443/v1/traces \
-d '{}'
----
+
The response should be similar to:
+
[source,txt]
----
{"partialSuccess":{}}%
----

[discrete]
=== Send data to your Elastic Cloud Managed OTLP endpoint

* <<otel-sdk-running>>
* <<no-sdk-running>>
* <<instrumentation-please>>

[discrete]
[[otel-sdk-running]]
==== I have an OTel Collector/SDK running

If you have an OpenTelemetry Collector or SDK exporting telemetry data,
configure it with the endpoint and API key generated in the previous steps.

**OpenTelemetry Collector configuration**

Configure your OTel Collector as follows:

[source,yaml]
----
exporters:
otlp:
endpoint: "https://my_cluster.ingest.us-east-1.aws.elastic.cloud:443/v1/traces"
headers: "Authorization": "ApiKey <api-key-value-here>"
----

For more information, see
https://opentelemetry.io/docs/collector/configuration/[OTLP Collector configuration]

**Elastic Distributions of OpenTelemetry (EDOT) Collector configuration**

Configure an EDOT Collector using the same method described above in **OpenTelemetry Collector configuration**.
See the https://elastic.github.io/opentelemetry/edot-collector/index.html[EDOT Language SDK documentation] for more information.

**OpenTelemetry SDK configuration**

Configure your OTel SDK with the following environment variables:

* Elastic Cloud Managed OTLP endpoint: `OTEL_EXPORTER_OTLP_ENDPOINT`
* Elastic API key: `OTEL_EXPORTER_OTLP_HEADERS`

For example:

[source,terminal]
----
export OTEL_EXPORTER_OTLP_ENDPOINT="https://my-api-endpoint:443"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=ApiKey <api-key>"
----

For more information, see
https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/[OTLP Exporter configuration].

**Elastic Distributions of OpenTelemetry (EDOT) SDK configuration**

Configure an EDOT SDK using the same method described above in **OpenTelemetry SDK configuration**.
See the https://elastic.github.io/opentelemetry/edot-sdks/index.html[EDOT Language SDK documentation] for more information.

[discrete]
[[no-sdk-running]]
==== I need an OTel Collector/SDK

Don't have a collector or SDK running? No problem. Spin up an EDOT collector in just a few steps:

* https://elastic.github.io/opentelemetry/quickstart/serverless/k8s.html[Kubernetes Quickstart]
* https://elastic.github.io/opentelemetry/quickstart/serverless/hosts_vms.html[Hosts & VMs Quickstart]

// Commenting out Docker until the docs are ready
// * https://elastic.github.io/opentelemetry/quickstart/serverless/docker.html[Docker Quickstart]

[discrete]
[[instrumentation-please]]
==== I just want to use the instrumentation

Docs coming soon to https://elastic.github.io/opentelemetry/use-cases/application/
Just send data to your Elastic Cloud Managed OTLP endpoint. That's it.

[discrete]
== Troubleshoot

**Api Key prefix not found**

The following error is due to an improperly formatted API key:

[source,terminal]
----
Exporting failed. Dropping data.
{"kind": "exporter", "data_type": }
"Unauthenticated desc = ApiKey prefix not found"
----

You must format your API key as `"Authorization": "ApiKey <api-key-value-here>"` or `"Authorization=ApiKey <api-key>"` depending on whether you're using a collector or SDK. See <<otel-sdk-running>> for more information.

[discrete]
== Provide feedback

We love to hear from you!
Help improve the Elastic Cloud Managed OTLP Endpoint by sending us feedback in our https://discuss.elastic.co/c/apm[discussion forum] or https://elasticstack.slack.com/signup#/domain-signup[community Slack].

For EDOT collector feedback, please open an issue in the https://github.com/elastic/elastic-agent/issues[elastic-agent repository].

[discrete]
== What's next?

Visualize your OpenTelemetry data. Learn more in <<otlp-visualize>>.