Skip to content

Commit

Permalink
[IA] More shortcodes for exporter pages (#3931)
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm authored Feb 7, 2024
1 parent 89f1b60 commit fb40e74
Show file tree
Hide file tree
Showing 29 changed files with 242 additions and 507 deletions.
1 change: 1 addition & 0 deletions .cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ words:
- otep
- otlp
- overridable
- outro
- packagist
- Paixão
- parentbased
Expand Down
2 changes: 1 addition & 1 deletion content/en/blog/2022/debug-otel-with-otel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,5 @@ COPY opentelemetry_module.conf /etc/nginx/conf.d
[v1.0.1 release of the otel-webserver-module]:
https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.1
[java]:
/docs/languages/java/automatic/agent-config/#capturing-http-request-and-response-headers
/docs/languages/java/automatic/configuration/#capturing-http-request-and-response-headers
[python]: /docs/languages/python/automatic/
2 changes: 1 addition & 1 deletion content/en/docs/concepts/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ For more information, see

### Exporters

{{% docs/languages/exporters-intro all %}}
{{% docs/languages/exporters/intro all %}}

### Automatic Instrumentation

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/faas/lambda-auto-instrument.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ variables:
instrumentations, see [Suppressing specific agent instrumentation][1].

[1]:
/docs/languages/java/automatic/agent-config/#suppressing-specific-agent-instrumentation
/docs/languages/java/automatic/configuration/#suppressing-specific-agent-instrumentation

For example, to only enable auto-instrumentation for Lambda and the AWS SDK, you
would set the following environment variables:
Expand Down
6 changes: 3 additions & 3 deletions content/en/docs/kubernetes/operator/automatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ the default libraries by setting
`OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED=false` and then use
`OTEL_INSTRUMENTATION_[NAME]_ENABLED=true` where `[NAME]` is the name of the
library. For more details, see
[Suppressing specific auto-instrumentation](/docs/languages/java/automatic/agent-config/#suppressing-specific-auto-instrumentation).
[Suppressing specific auto-instrumentation](/docs/languages/java/automatic/configuration/#suppressing-specific-auto-instrumentation).

```yaml
apiVersion: opentelemetry.io/v1alpha1
Expand All @@ -249,7 +249,7 @@ spec:
#### Learn more {#java-learn-more}
For more details, see
[Java agent Configuration](/docs/languages/java/automatic/agent-config/).
[Java agent Configuration](/docs/languages/java/automatic/configuration/).
### Node.js
Expand Down Expand Up @@ -393,7 +393,7 @@ spec:

#### Learn more {#python-learn-more}

[See the Python agent Configuration docs for more details.](/docs/languages/python/automatic/agent-config/#disabling-specific-instrumentations)
[See the Python agent Configuration docs for more details.](/docs/languages/python/automatic/configuration/#disabling-specific-instrumentations)

### Go

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/languages/cpp/exporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cSpell:ignore: chrono millis ostream

<!-- markdownlint-disable no-duplicate-heading -->

{{% docs/languages/exporters-intro cpp %}}
{{% docs/languages/exporters/intro cpp %}}

## Trace exporters

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/languages/erlang/exporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ weight: 50
cSpell:ignore: chrono millis ostream rebar relx
---

{{% docs/languages/exporters-intro erlang %}}
{{% docs/languages/exporters/intro erlang %}}

## Exporting to the OpenTelemetry Collector

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/languages/go/exporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ weight: 50
cSpell:ignore: otlpmetric otlpmetricgrpc otlpmetrichttp otlptrace otlptracegrpc otlptracehttp promhttp stdouttrace
---

{{% docs/languages/exporters-intro go %}}
{{% docs/languages/exporters/intro go %}}

## Console

Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/languages/java/automatic/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ java -javaagent:path/to/opentelemetry-javaagent.jar \
-jar myapp.jar
```

To see the full range of configuration options, see [Agent Configuration][].
To see the full range of configuration options, see
[Agent Configuration](configuration).

## Supported libraries, frameworks, application services, and JVMs

Expand All @@ -97,7 +98,6 @@ After you have automatic instrumentation configured for your app or service, you
might want to [annotate](annotations) selected methods or add
[manual instrumentation](../instrumentation) to collect custom telemetry data.

[agent configuration]: agent-config
[opentelemetry-javaagent.jar]:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
[releases]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Agent Configuration
linkTitle: Configuration
weight: 10
aliases: [agent-config]
# prettier-ignore
cSpell:ignore: akka armeria classloaders couchbase Customizer datasource dbcp Dotel dropwizard dubbo finatra hikari hikaricp HSET httpasyncclient httpclient hystrix jaxrs jaxws jedis jodd kotlinx logback logmanager mojarra myfaces okhttp oshi pekko rabbitmq ratpack rediscala redisson restlet rocketmq serverlessapis spymemcached twilio vaadin vertx vibur webflux webmvc
---
Expand Down
162 changes: 7 additions & 155 deletions content/en/docs/languages/java/exporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,7 @@ weight: 50
cSpell:ignore: okhttp
---

{{% docs/languages/exporters-intro java %}}

{{% alert title="Note" color="info" %}}

If you use the Java agent for
[automatic instrumentation](/docs/languages/java/automatic) you can learn how to
setup exporters following the
[Agent Configuration Guide](/docs/languages/java/automatic/agent-config)

{{% /alert %}}

## OTLP

### Collector Setup

{{% alert title="Note" color="info" %}}

If you have a OTLP collector or backend already set up, you can skip this
section and [setup the OTLP exporter dependencies](#otlp-dependencies) for your
application.

{{% /alert %}}

To try out and verify your OTLP exporters, you can run the collector in a docker
container that writes telemetry directly to the console.

In an empty directory, create a file called `collector-config.yaml` with the
following content:

```yaml
receivers:
otlp:
protocols:
grpc:
http:
exporters:
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug]
logs:
receivers: [otlp]
exporters: [debug]
```
Now run the collector in a docker container:
```shell
docker run -p 4317:4317 -p 4318:4318 --rm -v $(pwd)/collector-config.yaml:/etc/otelcol/config.yaml otel/opentelemetry-collector
```

This collector is now able to accept telemetry via OTLP. Later you may want to
[configure the collector](/docs/collector/configuration) to send your telemetry
to your observability backend.
{{% docs/languages/exporters/intro java %}}

### Dependencies {#otlp-dependencies}

Expand Down Expand Up @@ -241,72 +182,9 @@ all you need to do is update your environment variables:
env OTEL_TRACES_EXPORTER=logging OTEL_METRICS_EXPORTER=logging OTEL_LOGS_EXPORTER=logging java -jar ./build/libs/java-simple.jar
```

## Jaeger

[Jaeger](https://www.jaegertracing.io/) natively supports OTLP to receive trace
data. You can run Jaeger in a docker container with the UI accessible on port
16686 and OTLP enabled on ports 4137 and 4138:

```shell
docker run --rm \
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 9411:9411 \
jaegertracing/all-in-one:latest
```

Now following the instruction to setup the [OTLP exporters](#otlp-dependencies).

## Prometheus

To send your metric data to [Prometheus](https://prometheus.io/), you can either
[enable Prometheus' OTLP Receiver](https://prometheus.io/docs/prometheus/latest/feature_flags/#otlp-receiver)
and use the [OTLP exporter](#otlp) or you can use the
[`PrometheusHttpServer`](https://javadoc.io/doc/io.opentelemetry/opentelemetry-exporter-prometheus/latest/io/opentelemetry/exporter/prometheus/PrometheusHttpServer.html),
a `MetricReader`, that starts an HTTP server that will collect metrics and
serialize to Prometheus text format on request.

### Backend Setup {#prometheus-setup}

{{% alert title="Note" color="info" %}}

If you have Prometheus or a Prometheus-compatible backend already set up, you
can skip this section and setup the [Prometheus](#prometheus-dependencies) or
[OTLP](#otlp-dependencies) exporter dependencies for your application.

{{% /alert %}}

You can run [Prometheus](https://prometheus.io) in a docker container,
accessible on port `9090` by following these instructions:

Create a file called `prometheus.yml` with the following content:

```yaml
scrape_configs:
- job_name: dice-service
scrape_interval: 5s
static_configs:
- targets: [host.docker.internal:9464]
```
{{% docs/languages/exporters/jaeger %}}

Run Prometheus in a docker container with the UI accessible on port `9090`:

```shell
docker run --rm -v ${PWD}/prometheus.yml:/prometheus/prometheus.yml -p 9090:9090 prom/prometheus --enable-feature=otlp-write-receive
```

{{% alert title="Note" color="info" %}}

When using Prometheus' OTLP Receiver, make sure that you set the OTLP endpoint
for metrics in your application to `http://localhost:9090/api/v1/otlp`.

Not all docker environments support `host.docker.internal`. In some cases you
may need to replace `host.docker.internal` with `localhost` or the IP address of
your machine.

{{% /alert %}}
{{% docs/languages/exporters/prometheus-setup %}}

### Dependencies {#prometheus-dependencies}

Expand Down Expand Up @@ -354,24 +232,7 @@ With the above you can access your metrics at <http://localhost:9464/metrics>.
Prometheus or an OpenTelemetry Collector with the Prometheus receiver can scrape
the metrics from this endpoint.

## Zipkin

### Backend Setup {#zipkin-setup}

{{% alert title="Note" color="info" %}}

If you have Zipkin or a Zipkin-compatible backend already set up, you can skip
this section and setup the [Zipkin exporter dependencies](#zipkin-dependencies)
for your application.

{{% /alert %}}

You can run [Zipkin](https://zipkin.io/) on ina Docker container by executing
the following command:

```shell
docker run --rm -d -p 9411:9411 --name zipkin openzipkin/zipkin
```
{{% docs/languages/exporters/zipkin-setup %}}

### Dependencies {#zipkin-dependencies}

Expand Down Expand Up @@ -417,18 +278,7 @@ SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder()
.build();
```

## Other available exporters

There are many other exporters available. For a list of available exporters, see
the [registry](/ecosystem/registry/?component=exporter&language=java).

Finally, you can also write your own exporter. For more information, see the
[SpanExporter Interface in the API documentation](https://javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-trace/latest/io/opentelemetry/sdk/trace/export/SpanExporter.html).

## Batching spans and log records

For traces the OpenTelemetry SDK provides a set of default span and log record
processors, that allow you to either emit them one-by-one ("simple") or batched:
{{% docs/languages/exporters/outro java "https://javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-trace/latest/io/opentelemetry/sdk/trace/export/SpanExporter.html" %}}

{{< tabpane text=true >}} {{% tab Batch %}}

Expand Down Expand Up @@ -467,3 +317,5 @@ SdkLoggerProvider sdkLoggerProvider = SdkLoggerProvider.builder()
```

{{< /tab >}} {{< /tabpane>}}

{{% /docs/languages/exporters/outro %}}
2 changes: 1 addition & 1 deletion content/en/docs/languages/java/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ telemetry data for a library or framework.
The Java agent for automatic instrumentation includes instrumentation libraries
for many common Java frameworks. Most are turned on by default. If you need to
turn off certain instrumentation libraries, you can
[suppress them](../automatic/agent-config/#suppressing-specific-auto-instrumentation).
[suppress them](../automatic/configuration/#suppressing-specific-auto-instrumentation).

If you use [code-based instrumentation](../instrumentation), you can leverage
some instrumentation libraries for your dependencies standalone. To find out
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/languages/java/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cSpell:ignore: getenv myhost SIGINT uuidgen WORKDIR
If you use the Java agent for
[automatic instrumentation](/docs/languages/java/automatic) you can learn how to
setup resource detection following the
[Agent Configuration Guide](/docs/languages/java/automatic/agent-config).
[Agent Configuration Guide](/docs/languages/java/automatic/configuration).

For manual instrumentation, you will find some introductions on how to set up
resource detection below.
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/languages/js/automatic/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ used. You can use the environment variable `OTEL_NODE_RESOURCE_DETECTORS` to
enable only certain detectors, or to completely disable them.

To see the full range of configuration options, see
[Module Configuration](module-config).
[Module Configuration](configuration).

## Supported libraries and frameworks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Automatic Instrumentation Configuration
linkTitle: Configuration
description: Learn how to configure Automatic Instrumentation for Node.js
aliases: [module-config]
weight: 10
---

Expand Down
Loading

0 comments on commit fb40e74

Please sign in to comment.