Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

docs(examples): small fixes #21

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 10 additions & 1 deletion examples/clickhouse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ Benthos will read messages from a message log table and send the calculated usag

The example also demonstrates that certain business logic can also be implemented during the transformation (for example: users on the enterprise plan do not get charged for message length).

## Table of Contents <!-- omit from toc -->

- [Prerequisites](#prerequisites)
- [Launch the example](#launch-the-example)
- [Checking events](#checking-events)
- [Cleanup](#cleanup)
- [Advanced configuration](#advanced-configuration)
- [Production use](#production-use)

## Prerequisites

This example uses [Docker](https://docker.com) and [Docker Compose](https://docs.docker.com/compose/), but you are free to run the components in any other way.
Expand All @@ -33,7 +42,7 @@ cp .env.dist .env
Create the following meters in OpenMeter with the following details:

| Description | Event type | Aggregation | Value property | Group by (optional) |
|--------------------------|----------------|-------------|-----------------------------|---------------------|
| ------------------------ | -------------- | ----------- | --------------------------- | ------------------- |
| All message lenghts | `chat-message` | `SUM` | `$.message_length` | - `plan`: `$.plan` |
| Billable message lengths | `chat-message` | `SUM` | `$.message_length_billable` | - `plan`: `$.plan` |
| Message count | `chat-message` | `COUNT` | - | - `plan`: `$.plan` |
Expand Down
7 changes: 4 additions & 3 deletions examples/http-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ The nice thing about this solution is that you can use it as a drop-in replaceme
This means you can use our existing SDKs; the only thing you need to change is the API endpoint.
That is, of course, optional: you can use any client library or payload format you prefer and handle the mapping to the [CloudEvents](https://cloudevents.io/) format in a Benthos [`mapping` processor](https://www.benthos.dev/docs/components/processors/mapping/).

## Table of Contents
tothandras marked this conversation as resolved.
Show resolved Hide resolved
## Table of Contents <!-- omit from toc -->

- [Prerequisites](#prerequisites)
- [Launch the example](#launch-the-example)
- [Checking events](#checking-events)
- [Cleanup](#cleanup)
- [Advanced configuration](#advanced-configuration)
- [Production use](#production-use)
Expand Down Expand Up @@ -67,15 +68,15 @@ docker compose logs -f forwarder
Open another terminal and send a test event:

```shell
curl -vvv http://localhost:4196/api/v1/events -H "Content-Type: application/cloudevents+json" -d @seed/event.json
curl -vvv http://127.0.0.1:4196/api/v1/events -H "Content-Type: application/cloudevents+json" -d @seed/event.json
```

_Inspect the logs in the other terminal._

Send a batch of events:

```shell
curl -vvv http://localhost:4196/api/v1/events -H "Content-Type: application/cloudevents-batch+json" -d @seed/batch.json
curl -vvv http://127.0.0.1:4196/api/v1/events -H "Content-Type: application/cloudevents-batch+json" -d @seed/batch.json
```

_Inspect the logs in the other terminal._
Expand Down
3 changes: 0 additions & 3 deletions examples/http-server/seed/batch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"type": "api-calls",
"source": "api-gateway",
"subject": "customer-1",
"time": "2024-01-09T13:06:04.715Z",
"data": {
"method": "POST",
"path": "/",
Expand All @@ -20,7 +19,6 @@
"type": "api-calls",
"source": "api-gateway",
"subject": "customer-2",
"time": "2024-01-09T13:07:04.715Z",
"data": {
"method": "GET",
"path": "/contact",
Expand All @@ -35,7 +33,6 @@
"type": "api-calls",
"source": "api-gateway",
"subject": "customer-3",
"time": "2024-01-09T13:08:04.715Z",
"data": {
"method": "GET",
"path": "/home",
Expand Down
1 change: 0 additions & 1 deletion examples/http-server/seed/event.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"type": "api-calls",
"source": "api-gateway",
"subject": "customer-1",
"time": "2024-01-09T13:05:04.715Z",
"data": {
"method": "POST",
"path": "/",
Expand Down
3 changes: 2 additions & 1 deletion examples/kubernetes-pod-exec-time/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

This example demonstrates metering execution time of Pods running in Kubernetes.

## Table of Contents
## Table of Contents <!-- omit from toc -->

- [Prerequisites](#prerequisites)
- [Preparations](#preparations)
- [Deploy the example](#deploy-the-example)
- [Checking events](#checking-events)
- [Cleanup](#cleanup)
- [Advanced configuration](#advanced-configuration)
- [Production use](#production-use)
Expand Down