Skip to content

Commit b2ddae0

Browse files
mdbirnstiehlmergify[bot]
authored andcommitted
[Observability Docs] Replace placeholder URLs (#4926)
(cherry picked from commit 5b5a5c9) # Conflicts: # docs/en/apm-server/legacy/copied-from-beats/docs/https.asciidoc # docs/en/apm-server/legacy/copied-from-beats/outputs/elasticsearch/docs/elasticsearch.asciidoc # docs/en/observability/apm/collect-application-data/open-telemetry/otel-direct.asciidoc # docs/en/observability/apm/configure/advanced-setup/command-reference.asciidoc # docs/en/observability/apm/tab-widgets/install-agents.asciidoc # docs/en/observability/logs-ecs-application.asciidoc # docs/en/observability/logs-plaintext.asciidoc # docs/en/observability/logs-stream.asciidoc # docs/en/observability/logs-troubleshooting.asciidoc # docs/en/observability/profiling-self-managed-ops.asciidoc # docs/en/observability/synthetics-configuration.asciidoc
1 parent 47eb9d1 commit b2ddae0

15 files changed

Lines changed: 2712 additions & 18 deletions

docs/en/apm-server/legacy/copied-from-beats/docs/https.asciidoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ For example:
3232
["source","yaml",subs="attributes,callouts"]
3333
----------------------------------------------------------------------
3434
output.elasticsearch:
35+
<<<<<<< HEAD:docs/en/apm-server/legacy/copied-from-beats/docs/https.asciidoc
3536
hosts: ["https://myEShost:9200"]
3637
username: "{beat_default_index_prefix}_writer" <1>
3738
password: "{pwd}" <2>
39+
=======
40+
hosts: ["<YOUR_ES_HOST_URL>:9200"]
41+
username: "apm_writer" <1>
42+
password: "{pwd}"
43+
>>>>>>> 5b5a5c9a ([Observability Docs] Replace placeholder URLs (#4926)):docs/en/observability/apm/https.asciidoc
3844
----------------------------------------------------------------------
3945
<1> This user needs the privileges required to publish events to {es}.
4046
To create a user like this, see <<privileges-to-publish-events>>.
@@ -55,7 +61,7 @@ For example:
5561
["source","yaml",subs="attributes,callouts"]
5662
----------------------------------------------------------------------
5763
output.elasticsearch:
58-
hosts: ["https://myEShost:9200"]
64+
hosts: ["<YOUR_ES_HOST_URL>:9200"]
5965
api_key: "KnR6yE41RrSowb0kQ0HWoA" <1>
6066
----------------------------------------------------------------------
6167
<1> This API key must have the privileges required to publish events to {es}.
@@ -71,7 +77,7 @@ For example:
7177
["source","yaml",subs="attributes,callouts"]
7278
----------------------------------------------------------------------
7379
output.elasticsearch:
74-
hosts: ["https://myEShost:9200"]
80+
hosts: ["<YOUR_ES_HOST_URL>:9200"]
7581
ssl.certificate: "/etc/pki/client/cert.pem" <1>
7682
ssl.key: "/etc/pki/client/cert.key" <2>
7783
----------------------------------------------------------------------
@@ -98,7 +104,7 @@ Here is an example configuration:
98104
["source","yaml",subs="attributes,callouts"]
99105
----------------------------------------------------------------------
100106
output.elasticsearch:
101-
hosts: ["https://myEShost:9200"]
107+
hosts: ["<YOUR_ES_HOST_URL>:9200"]
102108
ssl.certificate_authorities: <1>
103109
- /etc/pki/my_root_ca.pem
104110
- /etc/pki/my_other_ca.pem

docs/en/apm-server/legacy/copied-from-beats/docs/monitoring/monitoring-internal-collection.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ monitoring:
7979
enabled: true
8080
cluster_uuid: PRODUCTION_ES_CLUSTER_UUID <1>
8181
elasticsearch:
82-
hosts: ["https://example.com:9200", "https://example2.com:9200"] <2>
82+
hosts: ["<HOST_URL>:9200", "<HOST_URL>:9200"] <2>
8383
api_key: id:api_key <3>
8484
username: {beat_monitoring_user}
8585
password: somepassword
@@ -102,7 +102,7 @@ monitoring:
102102
enabled: true
103103
cluster_uuid: PRODUCTION_ES_CLUSTER_UUID
104104
elasticsearch:
105-
hosts: ["https://example.com:9200", "https://example2.com:9200"]
105+
hosts: ["<HOST_URL>:9200", "<HOST_URL>:9200"]
106106
username: ""
107107
ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]
108108
ssl.certificate: "/etc/pki/client/cert.pem"

docs/en/apm-server/legacy/copied-from-beats/docs/shared-ssl-logstash-config.asciidoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,26 @@ Before running {beatname_uc}, you should validate the {ls} server's certificate.
8686

8787
[source,shell]
8888
------------------------------------------------------------------------------
89-
curl -v --cacert ca.crt https://logs.mycompany.com:5044
89+
curl -v --cacert ca.crt <YOUR_URL>:5044
9090
------------------------------------------------------------------------------
9191

9292
If the test is successful, you'll receive an empty response error:
9393

9494
[source,shell]
9595
------------------------------------------------------------------------------
96-
* Rebuilt URL to: https://logs.mycompany.com:5044/
96+
* Rebuilt URL to: <YOUR_URL>:5044/
9797
* Trying 192.168.99.100...
98-
* Connected to logs.mycompany.com (192.168.99.100) port 5044 (#0)
98+
* Connected to <YOUR_URL> (192.168.99.100) port 5044 (#0)
9999
* TLS 1.2 connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
100-
* Server certificate: logs.mycompany.com
101-
* Server certificate: mycompany.com
100+
* Server certificate: <YOUR_URL>
101+
* Server certificate: <YOUR_URL>
102102
> GET / HTTP/1.1
103-
> Host: logs.mycompany.com:5044
103+
> Host: <YOUR_URL>:5044
104104
> User-Agent: curl/7.43.0
105105
> Accept: */*
106106
>
107107
* Empty reply from server
108-
* Connection #0 to host logs.mycompany.com left intact
108+
* Connection #0 to host <YOUR_URL> left intact
109109
curl: (52) Empty reply from server
110110
------------------------------------------------------------------------------
111111

docs/en/apm-server/legacy/copied-from-beats/outputs/elasticsearch/docs/elasticsearch.asciidoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Example configuration:
1414
["source","yaml",subs="attributes"]
1515
----
1616
output.elasticsearch:
17-
hosts: ["https://myEShost:9200"] <1>
17+
hosts: ["<YOUR_ES_HOST_URL>:9200"] <1>
1818
----
1919
<1> To enable SSL, add `https` to all URLs defined under __hosts__.
2020

@@ -30,8 +30,13 @@ output, {beatname_uc} can use any of the following authentication methods:
3030
["source","yaml",subs="attributes,callouts"]
3131
----
3232
output.elasticsearch:
33+
<<<<<<< HEAD:docs/en/apm-server/legacy/copied-from-beats/outputs/elasticsearch/docs/elasticsearch.asciidoc
3334
hosts: ["https://myEShost:9200"]
3435
username: "{beat_default_index_prefix}_writer"
36+
=======
37+
hosts: ["<YOUR_ES_HOST_URL>:9200"]
38+
username: "apm_writer"
39+
>>>>>>> 5b5a5c9a ([Observability Docs] Replace placeholder URLs (#4926)):docs/en/observability/apm/configure/outputs/elasticsearch.asciidoc
3540
password: "{pwd}"
3641
----
3742

@@ -40,16 +45,21 @@ output.elasticsearch:
4045
["source","yaml",subs="attributes,callouts"]
4146
----
4247
output.elasticsearch:
48+
<<<<<<< HEAD:docs/en/apm-server/legacy/copied-from-beats/outputs/elasticsearch/docs/elasticsearch.asciidoc
4349
hosts: ["https://myEShost:9200"]
4450
api_key: "KnR6yE41RrSowb0kQ0HWoA"
51+
=======
52+
hosts: ["<YOUR_ES_HOST_URL>:9200"]
53+
api_key: "ZCV7VnwBgnX0T19fN8Qe:KnR6yE41RrSowb0kQ0HWoA" <1>
54+
>>>>>>> 5b5a5c9a ([Observability Docs] Replace placeholder URLs (#4926)):docs/en/observability/apm/configure/outputs/elasticsearch.asciidoc
4555
----
4656

4757
*PKI certificate authentication:*
4858

4959
["source","yaml",subs="attributes,callouts"]
5060
----
5161
output.elasticsearch:
52-
hosts: ["https://myEShost:9200"]
62+
hosts: ["<YOUR_ES_HOST_URL>:9200"]
5363
ssl.certificate: "/etc/pki/client/cert.pem"
5464
ssl.key: "/etc/pki/client/cert.key"
5565
----
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
[[apm-open-telemetry-direct]]
2+
= Upstream OpenTelemetry Collectors and language SDKs
3+
4+
[NOTE]
5+
====
6+
This is one of <<apm-open-telemetry,several approaches>> you can use to integrate Elastic with OpenTelemetry.
7+
8+
*To compare approaches and choose the best approach for your use case, refer to <<apm-open-telemetry,Use OpenTelemetry with APM>>.*
9+
====
10+
11+
The {stack} natively supports the OpenTelemetry protocol (OTLP).
12+
This means trace data and metrics collected from your applications and infrastructure can
13+
be sent directly to the {stack}.
14+
15+
* Send data to the {stack} from an upstream <<apm-connect-open-telemetry-collector,OpenTelemetry Collector>>
16+
* Send data to the {stack} from an upstream <<apm-instrument-apps-otel,OpenTelemetry language SDK>>
17+
18+
[discrete]
19+
[[apm-connect-open-telemetry-collector]]
20+
== Send data from an upstream OpenTelemetry Collector
21+
22+
Connect your OpenTelemetry Collector instances to Elastic {observability} using the OTLP exporter:
23+
24+
[source,yaml]
25+
----
26+
receivers: <1>
27+
# ...
28+
otlp:
29+
protocols:
30+
grpc:
31+
endpoint: 0.0.0.0:4317
32+
http:
33+
endpoint: 0.0.0.0:4318
34+
processors: <2>
35+
# ...
36+
memory_limiter:
37+
check_interval: 1s
38+
limit_mib: 2000
39+
batch:
40+
41+
exporters:
42+
debug:
43+
verbosity: detailed <3>
44+
otlp: <4>
45+
# Elastic APM server https endpoint without the "https://" prefix
46+
endpoint: "${env:ELASTIC_APM_SERVER_ENDPOINT}" <5> <7>
47+
headers:
48+
# Elastic APM Server secret token
49+
Authorization: "Bearer ${env:ELASTIC_APM_SECRET_TOKEN}" <6> <7>
50+
51+
service:
52+
pipelines:
53+
traces:
54+
receivers: [otlp]
55+
processors: [..., memory_limiter, batch]
56+
exporters: [debug, otlp]
57+
metrics:
58+
receivers: [otlp]
59+
processors: [..., memory_limiter, batch]
60+
exporters: [debug, otlp]
61+
logs: <8>
62+
receivers: [otlp]
63+
processors: [..., memory_limiter, batch]
64+
exporters: [debug, otlp]
65+
----
66+
<1> The receivers, like the
67+
https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver[OTLP receiver], that forward data emitted by APM agents, or the https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver[host metrics receiver].
68+
<2> We recommend using the https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md[Batch processor] and the https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/memorylimiterprocessor/README.md[memory limiter processor]. For more information, see https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/README.md#recommended-processors[recommended processors].
69+
<3> The https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/debugexporter[debug exporter] is helpful for troubleshooting, and supports configurable verbosity levels: `basic` (default), `normal`, and `detailed`.
70+
<4> Elastic {observability} endpoint configuration.
71+
APM Server supports a ProtoBuf payload via both the OTLP protocol over gRPC transport https://opentelemetry.io/docs/specs/otlp/#otlpgrpc[(OTLP/gRPC)]
72+
and the OTLP protocol over HTTP transport https://opentelemetry.io/docs/specs/otlp/#otlphttp[(OTLP/HTTP)].
73+
To learn more about these exporters, see the OpenTelemetry Collector documentation:
74+
https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter[OTLP/HTTP Exporter] or
75+
https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter[OTLP/gRPC exporter].
76+
When adding an endpoint to an existing configuration an optional name component can be added, like `otlp/elastic`, to distinguish endpoints as described in the https://opentelemetry.io/docs/collector/configuration/#basics[OpenTelemetry Collector Configuration Basics].
77+
<5> Hostname and port of the APM Server endpoint. For example, `elastic-apm-server:8200`.
78+
<6> Credential for Elastic APM <<apm-secret-token,secret token authorization>> (`Authorization: "Bearer a_secret_token"`) or <<apm-api-key,API key authorization>> (`Authorization: "ApiKey an_api_key"`).
79+
<7> Environment-specific configuration parameters can be conveniently passed in as environment variables documented https://opentelemetry.io/docs/collector/configuration/#environment-variables[here] (e.g. `ELASTIC_APM_SERVER_ENDPOINT` and `ELASTIC_APM_SECRET_TOKEN`).
80+
<8> preview:[] To send OpenTelemetry logs to {stack} version 8.0+, declare a `logs` pipeline.
81+
82+
You're now ready to export traces and metrics from your services and applications.
83+
84+
TIP: When using the OpenTelemetry Collector, you should always prefer sending data via the https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlphttpexporter[`OTLP` exporter] to an Elastic APM Server.
85+
Other methods, like using the https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/elasticsearchexporter[`elasticsearch` exporter] to send data directly to {es} will send data to the {stack},
86+
but will bypass all of the validation and data processing that the APM Server performs.
87+
In addition, your data will not be viewable in the {kib} {observability} apps if you use the `elasticsearch` exporter.
88+
89+
[discrete]
90+
[[apm-instrument-apps-otel]]
91+
== Send data from an upstream OpenTelemetry SDK
92+
93+
[NOTE]
94+
====
95+
This document outlines how to send data directly from an upstream OpenTelemetry SDK to APM Server, which is appropriate when getting started. However, in many cases you should use the OpenTelemetry SDK to send data to an OpenTelemetry Collector that processes and exports data to APM Server. Read more about when and how to use a collector in the https://opentelemetry.io/docs/collector/#when-to-use-a-collector[OpenTelemetry documentation].
96+
====
97+
98+
To export traces and metrics to APM Server, instrument your services and applications
99+
with the OpenTelemetry API, SDK, or both. For example, if you are a Java developer, you need to instrument your Java app with the
100+
https://github.com/open-telemetry/opentelemetry-java-instrumentation[OpenTelemetry agent for Java].
101+
See the https://opentelemetry.io/docs/instrumentation/[OpenTelemetry Instrumentation guides] to download the
102+
OpenTelemetry agent or SDK for your language.
103+
104+
Define environment variables to configure the OpenTelemetry agent or SDK and enable communication with Elastic APM.
105+
For example, if you are instrumenting a Java app, define the following environment variables:
106+
107+
[source,bash]
108+
----
109+
export OTEL_RESOURCE_ATTRIBUTES=service.name=checkoutService,service.version=1.1,deployment.environment=production
110+
export OTEL_EXPORTER_OTLP_ENDPOINT=<YOUR_APM_SERVER_URL>:8200
111+
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer an_apm_secret_token"
112+
export OTEL_METRICS_EXPORTER="otlp" \
113+
export OTEL_LOGS_EXPORTER="otlp" \ <1>
114+
java -javaagent:/path/to/opentelemetry-javaagent-all.jar \
115+
-classpath lib/*:classes/ \
116+
com.mycompany.checkout.CheckoutServiceServer
117+
----
118+
<1> preview:[] The OpenTelemetry logs intake via APM Server is currently in technical preview.
119+
120+
|===
121+
122+
| `OTEL_RESOURCE_ATTRIBUTES` | Fields that describe the service and the environment that the service runs in. See
123+
<<apm-open-telemetry-resource-attributes,resource attributes>> for more information.
124+
125+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | APM Server URL. The host and port that APM Server listens for events on.
126+
127+
| `OTEL_EXPORTER_OTLP_HEADERS` a| Authorization header that includes the Elastic APM Secret token or API key: `"Authorization=Bearer an_apm_secret_token"` or `"Authorization=ApiKey an_api_key"`.
128+
129+
For information on how to format an API key, see
130+
{observability-guide}/apm-api-key.html[API keys].
131+
132+
Please note the required space between `Bearer` and `an_apm_secret_token`, and `ApiKey` and `an_api_key`.
133+
134+
NOTE: If you are using a version of the Python OpenTelemetry agent _before_ 1.27.0, the content of the header _must_ be URL-encoded. You can use the Python standard library's `urllib.parse.quote` function to encode the content of the header.
135+
136+
| `OTEL_METRICS_EXPORTER` | Metrics exporter to use. See https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#exporter-selection[exporter selection] for more information.
137+
138+
| `OTEL_LOGS_EXPORTER` | Logs exporter to use. See https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#exporter-selection[exporter selection] for more information.
139+
140+
|===
141+
142+
You are now ready to collect traces and <<apm-open-telemetry-collect-metrics,metrics>> before <<apm-open-telemetry-verify-metrics,verifying metrics>>
143+
and <<apm-open-telemetry-visualize,visualizing metrics>> in {kib}.
144+
145+
[discrete]
146+
[[apm-open-telemetry-proxy-apm]]
147+
== Proxy requests to APM Server
148+
149+
APM Server supports both the https://opentelemetry.io/docs/specs/otlp/#otlpgrpc[OTLP/gRPC] and https://opentelemetry.io/docs/specs/otlp/#otlphttp[OTLP/HTTP] protocol on the same port as Elastic APM agent requests. For ease of setup, we recommend using OTLP/HTTP when proxying or load balancing requests to the APM Server.
150+
151+
If you use the OTLP/gRPC protocol, requests to the APM Server must use either HTTP/2 over TLS or HTTP/2 Cleartext (H2C). No matter which protocol is used, OTLP/gRPC requests will have the header: `"Content-Type: application/grpc"`.
152+
153+
When using a layer 7 (L7) proxy like AWS ALB, requests must be proxied in a way that ensures requests to the APM Server follow the rules outlined above. For example, with ALB you can create rules to select an alternative backend protocol based on the headers of requests coming into ALB. In this example, you'd select the gRPC protocol when the `"Content-Type: application/grpc"` header exists on a request.
154+
155+
For more information on how to configure an AWS ALB to support gRPC, see this AWS blog post:
156+
https://aws.amazon.com/blogs/aws/new-application-load-balancer-support-for-end-to-end-http-2-and-grpc/[Application Load Balancer Support for End-to-End HTTP/2 and gRPC].
157+
158+
For more information on how APM Server services gRPC requests, see
159+
https://github.com/elastic/apm-server/blob/main/dev_docs/otel.md#muxing-grpc-and-http11[Muxing gRPC and HTTP/1.1].
160+
161+
[discrete]
162+
[[apm-open-telemetry-direct-next]]
163+
== Next steps
164+
165+
* <<apm-open-telemetry-collect-metrics>>
166+
* Learn about the <<apm-open-telemetry-known-limitations,limitations of this integration>>

0 commit comments

Comments
 (0)