Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermp authored Mar 24, 2023
2 parents f0388c6 + cef971b commit 627ed63
Show file tree
Hide file tree
Showing 15 changed files with 245 additions and 216 deletions.
17 changes: 17 additions & 0 deletions assets/js/navScroll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Check If an Element is Visible in the Viewport
function isInViewport(element) {
const rect = element.getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <=
(window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
);
}

let ele = document.querySelector('#td-section-nav .td-sidebar-nav-active-item');

if (ele && !isInViewport(ele)) {
ele.scrollIntoView({ behavior: 'smooth', block: 'end', inline: 'nearest' });
}
2 changes: 1 addition & 1 deletion content/en/blog/2023/php-auto-instrumentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ you'll need three things:

- PHP 8.0 or higher. The PHP auto-instrumentation uses the Observability API
introduced in PHP 8.0.
- [Composer]((https://getcomposer.org/download/)
- [Composer](https://getcomposer.org/download/)
- A C Compiler must be available on your machine

### Background on the PHP 8.0 Observability API
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/collector/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Vendor-agnostic way to receive, process and export telemetry data.
spelling: cSpell:ignore Otel
aliases: [/docs/collector/about]
cascade:
collectorVersion: 0.73.0
collectorVersion: 0.74.0
weight: 10
---

Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/collector/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To load your custom configuration `config.yaml` from your current working direct

{{< ot-tabs DockerHub ghcr.io >}}
{{< ot-tab lang="sh" >}}
docker run -v $(pwd)/config.yaml:/etc/otelcol/config.yaml otel/opentelemetry-collector:{{% param collectorVersion %}}
docker run -v $(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml otel/opentelemetry-collector:{{% param collectorVersion %}}
{{< /ot-tab >}}

{{< ot-tab lang="sh" >}}
Expand Down
25 changes: 14 additions & 11 deletions content/en/docs/instrumentation/cpp/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: Getting Started
weight: 2
spelling:
cSpell:ignore Bazel libcurl openssl xcode DBUILD DWITH helloworld tracestate
traceparent devel
---

Welcome to the OpenTelemetry C++ getting started guide! This guide will walk you
Expand All @@ -19,32 +22,32 @@ You can build OpenTelemetry C++ on Windows, macOS or Linux. First you need to
install some dependencies:

<!-- prettier-ignore-start -->
{{< ot-tabs "Linux (apt)" "Linux (yum)" "Linux (alpine)" "MacOS (homebrew)">}}
{{< tabpane lang=shell persistLang=false >}}

{{< ot-tab lang="shell">}}
{{< tab "Linux (apt)" >}}
sudo apt-get install git cmake g++ libcurl4-openssl-dev
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab lang="shell">}}
{{< tab "Linux (yum)" >}}
sudo yum install git cmake g++ libcurl-devel
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab lang="shell">}}
{{< tab "Linux (alpine)" >}}
sudo apk add git cmake g++ make curl-dev
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab lang="shell">}}
{{< tab "MacOS (homebrew)" >}}
xcode-select —install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git cmake
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

## Building

Get the `opentelementry-cpp` source:
Get the `opentelemetry-cpp` source:

```shell
git clone --recursive https://github.com/open-telemetry/opentelemetry-cpp
Expand Down
108 changes: 54 additions & 54 deletions content/en/docs/instrumentation/erlang/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,69 +36,69 @@ API.
To get started with this guide, create a new project with `rebar3` or `mix`:

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab lang="sh" >}}
{{< tab Erlang >}}
rebar3 new release otel_getting_started
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab lang="sh" >}}
{{< tab Elixir >}}
mix new --sup otel_getting_started
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

Then, in the project you just created, add both `opentelemetry_api` and
`opentelemetry` as dependencies. We add both because this is a project we will
run as a Release and export spans from.

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
{deps, [{opentelemetry_api, "~> 1.0"},
{opentelemetry, "~> 1.0"}]}.
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
def deps do
[
{:opentelemetry_api, "~> 1.0"},
{:opentelemetry, "~> 1.0"}
]
end
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

In the case of Erlang, the Applications will also need to be added to
`src/otel_getting_started.app.src`. In an Elixir project, a `releases` section
needs to be added to `mix.exs`:

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
...
{applications, [kernel,
stdlib,
opentelemetry_api,
opentelemetry]},
...
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
releases: [
otel_getting_started: [
version: "0.0.1",
applications: [otel_getting_started: :permanent]
]
]
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

## Initialization and Configuration
Expand Down Expand Up @@ -126,25 +126,25 @@ the `exporter` for the span processor `otel_batch_processor`, a type of span
processor that batches up multiple spans over a period of time:

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
%% config/sys.config.src
[
{opentelemetry,
[{span_processor, batch},
{traces_exporter, {otel_exporter_stdout, []}}]}
].
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
# config/runtime.exs
config :opentelemetry,
span_processor: :batch,
traces_exporter: {:otel_exporter_stdout, []}
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

## Working with Spans
Expand All @@ -153,9 +153,9 @@ Now that the dependencies and configuration are set up, we can create a module
with a function `hello/0` that starts some spans:

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
%% apps/otel_getting_started/src/otel_getting_started.erl
-module(otel_getting_started).

Expand All @@ -177,9 +177,9 @@ nice_operation(_SpanCtx) ->
?set_attributes([{lemons_key, <<"five">>}]),
?add_event(<<"Sub span event!">>, [])
end).
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
# lib/otel_getting_started.ex
defmodule OtelGettingStarted do
require OpenTelemetry.Tracer, as: Tracer
Expand All @@ -196,9 +196,9 @@ defmodule OtelGettingStarted do
end
end
end
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

In this example, we're using macros that use the process dictionary for context
Expand All @@ -225,9 +225,9 @@ To test out this project and see the spans created, you can run with
configuration for the release, resulting in the tracer and exporter to started.

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
$ rebar3 shell
===> Compiling otel_getting_started
Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
Expand All @@ -249,9 +249,9 @@ true
[{another_key,<<"yes">>}],
[{event,-576460750077877345,<<"Nice operation!">>,[{<<"bogons">>,100}]}],
[],undefined,1,false,undefined}
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
$ iex -S mix
Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Expand All @@ -273,9 +273,9 @@ iex(2)>
[{another_key,<<"yes">>}],
[{event,-576460741349446725,<<"Nice operation!">>,[{<<"bogons">>,100}]}],
[],undefined,1,false,undefined}
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

## Exporting to the OpenTelemetry Collector
Expand All @@ -300,25 +300,25 @@ To export to the running Collector the `opentelemetry_exporter` package must be
added to the project's dependencies:

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
{deps, [{opentelemetry_api, "~> 1.0"},
{opentelemetry, "~> 1.0"},
{opentelemetry_exporter, "~> 1.0"}]}.
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
def deps do
[
{:opentelemetry_api, "~> 1.0"},
{:opentelemetry, "~> 1.0"},
{:opentelemetry_exporter, "~> 1.0"}
]
end
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

It should then be added to the configuration of the Release, it should be before
Expand All @@ -329,19 +329,19 @@ Example of Release configuration in `rebar.config` and for
[mix's Release task](https://hexdocs.pm/mix/Mix.Tasks.Release.html):

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
%% rebar.config
{relx, [{release, {my_instrumented_release, "0.1.0"},
[opentelemetry_exporter,
{opentelemetry, temporary},
my_instrumented_app]},

...]}.
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
# mix.exs
def project do
[
Expand All @@ -354,9 +354,9 @@ def project do
]
]
end
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->

Finally, the runtime configuration of the `opentelemetry` and
Expand All @@ -367,9 +367,9 @@ for the `otlp_protocol` the endpoint should be changed to
`http://localhost:4317`.

<!-- prettier-ignore-start -->
{{< ot-tabs Erlang Elixir >}}
{{< tabpane langEqualsHeader=true >}}

{{< ot-tab >}}
{{< tab Erlang >}}
%% config/sys.config.src
[
{opentelemetry,
Expand All @@ -380,9 +380,9 @@ for the `otlp_protocol` the endpoint should be changed to
[{otlp_protocol, http_protobuf},
{otlp_endpoint, "http://localhost:4318"}]}]}
].
{{< /ot-tab >}}
{{< /tab >}}

{{< ot-tab >}}
{{< tab Elixir >}}
# config/runtime.exs
config :opentelemetry,
span_processor: :batch,
Expand All @@ -391,7 +391,7 @@ config :opentelemetry,
config :opentelemetry_exporter,
otlp_protocol: :http_protobuf,
otlp_endpoint: "http://localhost:4318"
{{< /ot-tab >}}
{{< /tab >}}

{{< /ot-tabs >}}
{{< /tabpane >}}
<!-- prettier-ignore-end -->
Loading

0 comments on commit 627ed63

Please sign in to comment.