Skip to content

Commit

Permalink
Merge branch 'main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
nicacioliveira authored Mar 11, 2024
2 parents 6fc9037 + dee10fa commit 8bbad17
Show file tree
Hide file tree
Showing 28 changed files with 221 additions and 286 deletions.
2 changes: 1 addition & 1 deletion content/en/blog/2023/any-metric-receiver.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ HOST=${1}
PORT=${2:-443}

now=$(date +%s)
str=$(echo q | openssl s_client -servername "${HOST}" "${HOST}:${PORT}" 2>/dev/null | openssl x509 -noout -enddate | awk -F"=" '{ print $2; }')
notAfterString=$(echo q | openssl s_client -servername "${HOST}" "${HOST}:${PORT}" 2>/dev/null | openssl x509 -noout -enddate | awk -F"=" '{ print $2; }')
if [[ "$(uname)" == "Darwin" ]] ; then
notAfter=$(date -j -f "%b %d %H:%M:%S %Y %Z" "${notAfterString}" +%s)
else
Expand Down
81 changes: 61 additions & 20 deletions content/en/docs/collector/custom-collector.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,67 @@ builder][ocb] (or `ocb` for short) to assist people in assembling their own
distribution, making it easy to build a distribution that includes their custom
components along with components that are publicly available.

As part of the process the `builder` will generate the Collector's source code,
As part of the process the `ocb` will generate the Collector's source code,
which you can use to help build and debug your own custom components, so let's
get started.

## Step 1 - Install the builder

The `ocb` binary is available as a downloadable asset from [OpenTelemetry
Collector releases][releases]. You will find the list of assets at the bottom of
the page. Assets are named based on OS and chipset, so download the one that
fits your configuration.
Collector releases][releases]. You will find a list of assets named based on OS
and chipset, so download the one that fits your configuration:

The binary has a pretty long name, so you can simply rename it to `ocb`; and if
you are running Linux or macOS, you will also need to provide execution
permissions for the binary.
{{< tabpane text=true >}}

Open your terminal and type the following commands to accomplish both
operations:
{{% tab "Linux (AMD 64)" %}}

```cmd
mv ocb_{{% param vers %}}_darwin_amd64 ocb
chmod 777 ocb
```sh
curl --proto '=https' --tlsv1.2 -fL -o ocb \
https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2F{{% version-from-registry collector-builder %}}/ocb_{{% version-from-registry collector-builder noPrefix %}}_linux_amd64
chmod +x ocb
```

{{% /tab %}} {{% tab "Linux (ARM 64)" %}}

```sh
curl --proto '=https' --tlsv1.2 -fL -o ocb \
https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2F{{% version-from-registry collector-builder %}}/ocb_{{% version-from-registry collector-builder noPrefix %}}_linux_arm64
chmod +x ocb
```

{{% /tab %}} {{% tab "Linux (ppc64le) "%}}

```sh
curl --proto '=https' --tlsv1.2 -fL -o ocb \
https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2F{{% version-from-registry collector-builder %}}/ocb_{{% version-from-registry collector-builder noPrefix %}}_linux_ppc64le
chmod +x ocb
```

{{% /tab %}} {{% tab "MacOS (AMD 64)" %}}

```sh
curl --proto '=https' --tlsv1.2 -fL -o ocb \
https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2F{{% version-from-registry collector-builder %}}/ocb_{{% version-from-registry collector-builder noPrefix %}}_darwin_amd64
chmod +x ocb
```

{{% /tab %}} {{% tab "MacOS (ARM 64)" %}}

```sh
curl --proto '=https' --tlsv1.2 -fL -o ocb \
https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2F{{% version-from-registry collector-builder %}}/ocb_{{% version-from-registry collector-builder noPrefix %}}_darwin_arm64
chmod +x ocb
```

{{% /tab %}} {{% tab "Windows (AMD 64)" %}}

```sh
Invoke-WebRequest -Uri "https://github.com/open-telemetry/opentelemetry-collector/releases/download/cmd%2Fbuilder%2F{{% version-from-registry collector-builder %}}/ocb_{{% version-from-registry collector-builder noPrefix %}}_windows_amd64.exe" -OutFile "ocb.exe"
Unblock-File -Path "ocb.exe"
```

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

To make sure the `ocb` is ready to be used, go to your terminal and type
`./ocb help`, and once you hit enter you should have the output of the `help`
command showing up in your console.
Expand All @@ -64,7 +102,7 @@ Here are the tags for the `dist` map:
| module: | The module name for the new distribution, following Go mod conventions. Optional, but recommended. | Yes | `go.opentelemetry.io/collector/cmd/builder` |
| name: | The binary name for your distribution | Yes | `otelcol-custom` |
| description: | A long name for the application. | Yes | `Custom OpenTelemetry Collector distribution` |
| otelcol_version: | The OpenTelemetry Collector version to use as base for the distribution. | Yes | `{{% param vers %}}` |
| otelcol_version: | The OpenTelemetry Collector version to use as base for the distribution. | Yes | `{{% version-from-registry collector-builder noPrefix %}}` |
| output_path: | The path to write the output (sources and binary). | Yes | `/var/folders/86/s7l1czb16g124tng0d7wyrtw0000gn/T/otelcol-distribution3618633831` |
| version: | The version for your custom OpenTelemetry Collector. | Yes | `1.0.0` |
| go: | Which Go binary to use to compile the generated sources. | Yes | go from the PATH |
Expand Down Expand Up @@ -113,22 +151,22 @@ dist:
name: otelcol-dev
description: Basic OTel Collector distribution for Developers
output_path: ./otelcol-dev
otelcol_version: {{% param vers %}}
otelcol_version: {{% version-from-registry collector-builder noPrefix %}}
exporters:
- gomod:
# NOTE: Prior to v0.86.0 use the `loggingexporter` instead of `debugexporter`.
go.opentelemetry.io/collector/exporter/debugexporter v{{% param vers %}}
go.opentelemetry.io/collector/exporter/debugexporter {{% version-from-registry collector-exporter-debug %}}
- gomod:
go.opentelemetry.io/collector/exporter/otlpexporter v{{% param vers %}}
go.opentelemetry.io/collector/exporter/otlpexporter {{% version-from-registry collector-exporter-otlp %}}

processors:
- gomod:
go.opentelemetry.io/collector/processor/batchprocessor v{{% param vers %}}
go.opentelemetry.io/collector/processor/batchprocessor {{% version-from-registry collector-processor-batch %}}

receivers:
- gomod:
go.opentelemetry.io/collector/receiver/otlpreceiver v{{% param vers %}}
go.opentelemetry.io/collector/receiver/otlpreceiver {{% version-from-registry collector-receiver-otlp %}}
```
## Step 3 - Generating the Code and Building your Collector's distribution
Expand All @@ -144,7 +182,7 @@ If everything went well, here is what the output of the command should look
like:

```nocode
2022-06-13T14:25:03.037-0500 INFO internal/command.go:85 OpenTelemetry Collector distribution builder {"version": "{{% param vers %}}", "date": "2023-01-03T15:05:37Z"}
2022-06-13T14:25:03.037-0500 INFO internal/command.go:85 OpenTelemetry Collector distribution builder {"version": "{{% version-from-registry collector-builder noPrefix %}}", "date": "2023-01-03T15:05:37Z"}
2022-06-13T14:25:03.039-0500 INFO internal/command.go:108 Using config file {"path": "builder-config.yaml"}
2022-06-13T14:25:03.040-0500 INFO builder/config.go:99 Using go {"go-executable": "/usr/local/go/bin/go"}
2022-06-13T14:25:03.041-0500 INFO builder/main.go:76 Sources created {"path": "./otelcol-dev"}
Expand Down Expand Up @@ -185,6 +223,9 @@ Further reading:

[ocb]:
https://github.com/open-telemetry/opentelemetry-collector/tree/main/cmd/builder
[releases]: https://github.com/open-telemetry/opentelemetry-collector/releases
[releases]:
https://github.com/open-telemetry/opentelemetry-collector/releases/tag/cmd%2Fbuilder%2F{{%

version-from-registry collector-builder %}}

[^1]: Prior to v0.86.0 use the `loggingexporter` instead of `debugexporter`.
26 changes: 12 additions & 14 deletions content/en/docs/demo/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ Want to deploy the demo and see it in action? Start here.
Want to understand how a particular language's instrumentation works? Start
here.

| Language | Automatic Instrumentation | Instrumentation Libraries | Manual Instrumentation |
| ------------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| .NET | | [Cart Service](services/cart/) | [Cart Service](services/cart/) |
| C++ | | | [Currency Service](services/currency/) |
| Erlang/Elixir | | [Feature Flag Service](services/feature-flag/) | [Feature Flag Service](services/feature-flag/) |
| Go | | [Accounting Service](services/accounting/), [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) | [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) |
| Java | [Ad Service](services/ad/) | | [Ad Service](services/ad/) |
| JavaScript | | [Frontend](services/frontend/) | [Frontend](services/frontend/), [Payment Service](services/payment/) |
| Kotlin | | [Fraud Detection Service](services/fraud-detection/) | |
| PHP | | [Quote Service](services/quote/) | [Quote Service](services/quote/) |
| Python | [Recommendation Service](services/recommendation/) | | [Recommendation Service](services/recommendation/) |
| Ruby | | [Email Service](services/email/) | [Email Service](services/email/) |
| Rust | | [Shipping Service](services/shipping/) | [Shipping Service](services/shipping/) |
| Language | Automatic Instrumentation | Instrumentation Libraries | Manual Instrumentation |
| ---------- | -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| .NET | | [Cart Service](services/cart/) | [Cart Service](services/cart/) |
| C++ | | | [Currency Service](services/currency/) |
| Go | | [Accounting Service](services/accounting/), [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) | [Checkout Service](services/checkout/), [Product Catalog Service](services/product-catalog/) |
| Java | [Ad Service](services/ad/) | | [Ad Service](services/ad/) |
| JavaScript | | [Frontend](services/frontend/) | [Frontend](services/frontend/), [Payment Service](services/payment/) |
| Kotlin | | [Fraud Detection Service](services/fraud-detection/) | |
| PHP | | [Quote Service](services/quote/) | [Quote Service](services/quote/) |
| Python | [Recommendation Service](services/recommendation/) | | [Recommendation Service](services/recommendation/) |
| Ruby | | [Email Service](services/email/) | [Email Service](services/email/) |
| Rust | | [Shipping Service](services/shipping/) | [Shipping Service](services/shipping/) |

## Service Documentation

Expand All @@ -46,7 +45,6 @@ found here:
- [Cart Service](services/cart/)
- [Checkout Service](services/checkout/)
- [Email Service](services/email/)
- [Feature Flag Service](services/feature-flag/)
- [Frontend](services/frontend/)
- [Load Generator](services/load-generator/)
- [Payment Service](services/payment/)
Expand Down
15 changes: 0 additions & 15 deletions content/en/docs/demo/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,14 @@ productcatalogservice(Product Catalog Service):::golang
quoteservice(Quote Service):::php
recommendationservice(Recommendation Service):::python
shippingservice(Shipping Service):::rust
featureflagservice(Feature Flag Service):::erlang
featureflagstore[(Feature Flag Store<br/>&#40PostgreSQL DB&#41)]
queue[(queue<br/>&#40Kafka&#41)]
Internet -->|HTTP| frontendproxy
frontendproxy -->|HTTP| frontend
frontendproxy -->|HTTP| featureflagservice
loadgenerator -->|HTTP| frontendproxy
accountingservice -->|TCP| queue
cartservice --->|gRPC| featureflagservice
checkoutservice --->|gRPC| cartservice --> cache
checkoutservice --->|gRPC| productcatalogservice
checkoutservice --->|gRPC| currencyservice
Expand All @@ -59,16 +54,6 @@ frontend -->|gRPC| shippingservice -->|HTTP| quoteservice
frauddetectionservice -->|TCP| queue
adservice --->|gRPC| featureflagservice
productcatalogservice -->|gRPC| featureflagservice
recommendationservice -->|gRPC| featureflagservice
shippingservice -->|gRPC| featureflagservice
featureflagservice --> featureflagstore
end
classDef dotnet fill:#178600,color:white;
Expand Down
6 changes: 0 additions & 6 deletions content/en/docs/demo/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ receive hints from IDEs such as IntelliJ or VS Code. It may be necessary to run
- pkg-config
- protobuf-compiler

### Elixir

- Erlang/OTP 23+
- Elixir 1.13+
- Rebar3 3.20+

### Go

- Go 1.19+
Expand Down
1 change: 0 additions & 1 deletion content/en/docs/demo/docker-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ Once the images are built and containers are started you can access:

- Web store: <http://localhost:8080/>
- Grafana: <http://localhost:8080/grafana/>
- Feature Flags UI: <http://localhost:8080/feature/>
- Load Generator UI: <http://localhost:8080/loadgen/>
- Jaeger UI: <http://localhost:8080/jaeger/ui/>
- Tracetest UI: <http://localhost:11633/>, only when using `make start-odd`
Expand Down
18 changes: 13 additions & 5 deletions content/en/docs/demo/feature-flags.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
---
title: Feature Flags
aliases: [feature_flags]
cSpell:ignore: OLJCESPC7Z
cSpell:ignore: flagd OLJCESPC7Z
---

This demo comes with several feature flags which can control failure conditions
in specific services. By default the flags are disabled. Using the Feature Flags
UI <http://localhost:8080/feature> you will be able to control the status of
these feature flags.
The demo provides several feature flags that you can use to simulate different
scenarios. These flags are managed by [`flagd`](https://flagd.dev), a simple
feature flag service that supports [OpenFeature](https://openfeature.dev). Flag
values are stored in the `demo.flagd.json` file. To enable a flag, change the
`defaultVariant` value in the config file for a given flag to "on".

| Feature Flag | Service(s) | Description |
| ----------------------- | --------------- | -------------------------------------------------------------------------------------------------------- |
| `adServiceFailure` | Ad Service | Generate an error for `GetAds` 1/10th of the time |
| `cartServiceFailure` | Cart Service | Generate an error for `EmptyCart` 1/10th of the time |
| `productCatalogFailure` | Product Catalog | Generate an error for `GetProduct` requests with product id: `OLJCESPC7Z` |
| `recommendationCache` | Recommendation | Create a memory leak due to an exponentially growing cache. 1.4x growth, 50% of requests trigger growth. |

## Feature Flag Architecture

Please see the [flagd documentation](https://flagd.dev) for more information on
how flagd works, and the [OpenFeature](https://openfeature.dev) website for more
information on how OpenFeature works, along with documentation for the
OpenFeature API.
Loading

0 comments on commit 8bbad17

Please sign in to comment.