Skip to content

Commit

Permalink
Prepare to launch (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopgrassi authored Apr 30, 2024
1 parent 93ebedb commit 164c0cb
Show file tree
Hide file tree
Showing 23 changed files with 115 additions and 67 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/publish-otlp-backend.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release

on:
push:
# run only against version tags
tags:
- 'v*'

jobs:
otlp-backend-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: otel-recipes/otlp-backend

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./internal/otlp_backend
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
site:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: build
run: make site

- name: Release
uses: softprops/action-gh-release@v2
with:
files: src/site/build.zip
draft: true
generate_release_notes: true
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Bundles all recipe files into a single one for the website
.PHONY: recipedb
recipedb:
@command -v jq >/dev/null 2>&1 || { echo >&2 "jq is not installed. Please install jq to continue."; exit 1; }
@find src -name 'recipefile.json' -exec jq -s -c . {} + > ./src/site/src/lib/store/data.json

# Prod build of the website
.PHONY: site
site:
npm --prefix src/site run build
cd src/site && zip -r build.zip build

.PHONY: tidy-modules
tidy-modules:
@find . -type d \( -name build -prune \) -o -name go.mod -print | while read -r gomod_path; do \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![CI](https://github.com/joaopgrassi/otel-recipes/actions/workflows/recipe-samples-tests.yml/badge.svg?branch=main)

[![OTel recipes Logo](./brand/logotype/recipes-horizontal-blue.png)](https://otel.recipes)
[![OTel recipes Logo](./brand/logotype/recipes-horizontal-blue.png)](https://otelrecipes.com)

Welcome to OTel recipes!

Expand All @@ -16,7 +16,7 @@ users can learn OpenTelemetry concepts and apply them on their applications.

In a nutshell, OTel recipes is composed of two parts: the collection of sample
applications that are focused on achieving a specific goal with OpenTelemetry and
[the website](https://otel.recipes), that allows you to browse the samples
[the website](https://otelrecipes.com), that allows you to browse the samples
in a simple and structured way.

## Contributing
Expand Down
6 changes: 4 additions & 2 deletions internal/common/testutils/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func GetTraceWithRetry(t *testing.T, serviceName string) *otlptrace.ResourceSpan
time.Sleep(backoff)
}

if len(rs.ScopeSpans) == 0 {
t.Fatalf("Could not find traces for sample: %s", serviceName)
}

return rs
}

Expand All @@ -85,8 +89,6 @@ func GetTrace(t *testing.T, serviceName string) *otlptrace.ResourceSpans {

t.Log("Received 200 response from OTLP backend")

defer r.Body.Close()

body, err := io.ReadAll(r.Body)
defer r.Body.Close()
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions otel-recipes-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
"tags": {
"type": "array",
"description": "Related tags with the language/technology of the recipe.",
"items": [
{ "enum": ["api", "db", "http", "web", "manual", "automatic"] }
],
"items": {
"type": "string",
"enum": ["console", "api", "db", "http", "web", "manual", "automatic"]
},
"maxItems": 4,
"additionalItems": false
},
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/logs/aspnet-api/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"languageId": "csharp",
"signal": "logs",
"displayName": "ASP.NET Core API",
"tags": [],
"tags": ["api", "manual"],
"description": "An ASP.NET Core API instrumented with OpenTelemetry that generates logs when the /helloworld endpoint is called",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/csharp/logs/aspnet-api",
"steps": [
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/metrics/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"languageId": "csharp",
"signal": "metrics",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A C# console application instrumented with OpenTelemetry that generate metrics.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/csharp/metrics/console",
"steps": [
Expand Down
8 changes: 4 additions & 4 deletions src/csharp/traces/aspnet-api/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"languageId": "csharp",
"signal": "traces",
"displayName": "ASP.NET Core API",
"tags": [],
"tags": ["api", "manual"],
"description": "An ASP.NET Core API instrumented with OpenTelemetry that generates a trace when the /helloworld endpoint is called",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/csharp/trace/aspnet-api",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/csharp/traces/aspnet-api",
"steps": [
{
"displayName": "Configure the SDK",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/csharp/trace/aspnet-api/Startup.cs"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/csharp/traces/aspnet-api/Startup.cs"
},
{
"displayName": "Create a span",
"order": 2,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/csharp/trace/aspnet-api/Controllers/HelloWorldController.cs"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/csharp/traces/aspnet-api/Controllers/HelloWorldController.cs"
}
],
"dependencies": [
Expand Down
6 changes: 3 additions & 3 deletions src/csharp/traces/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"languageId": "csharp",
"signal": "traces",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A C# console application instrumented with OpenTelemetry that generates a trace.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/csharp/trace/console",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/csharp/traces/console",
"steps": [
{
"displayName": "Configure the SDK",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/csharp/trace/console/App.cs"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/csharp/traces/console/App.cs"
}
],
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion src/go/metrics/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"languageId": "go",
"signal": "metrics",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A go console application instrumented with OpenTelemetry that generate metrics.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/go/metrics/console",
"steps": [
Expand Down
6 changes: 3 additions & 3 deletions src/go/traces/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"languageId": "go",
"signal": "traces",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A go console application instrumented with OpenTelemetry that generates a trace.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/go/trace/console",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/go/traces/console",
"steps": [
{
"displayName": "Configure the SDK",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/go/trace/console/app.go"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/go/traces/console/app.go"
}
],
"dependencies": [
Expand Down
8 changes: 4 additions & 4 deletions src/go/traces/gin-api/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"languageId": "go",
"signal": "traces",
"displayName": "Gin API",
"tags": [],
"tags": ["api", "manual"],
"description": "A Gin API instrumented with OpenTelemetry that generates a trace when the /helloworld endpoint is called",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/go/trace/gin-api",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/go/traces/gin-api",
"steps": [
{
"displayName": "Configure the SDK",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/go/trace/gin-api/app.go"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/go/traces/gin-api/app.go"
},
{
"displayName": "Create a span",
"order": 2,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/go/trace/gin-api/handlers.go"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/go/traces/gin-api/handlers.go"
}
],
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion src/java/logs/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"languageId": "java",
"signal": "logs",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A Java console application instrumented with OpenTelemetry that generate logs.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/java/logs/console",
"steps": [
Expand Down
2 changes: 1 addition & 1 deletion src/java/metrics/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"languageId": "java",
"signal": "metrics",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A Java console application instrumented with OpenTelemetry that generate metrics.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/java/metrics/console",
"steps": [
Expand Down
6 changes: 3 additions & 3 deletions src/java/traces/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"languageId": "java",
"signal": "traces",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A Java console application instrumented with OpenTelemetry that generates a trace.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/java/trace/console",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/java/traces/console",
"steps": [
{
"displayName": "Configure the SDK",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/java/trace/console/app/src/main/java/otel/recipes/App.java"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/java/traces/console/app/src/main/java/otel/recipes/App.java"
}
],
"dependencies": [
Expand Down
8 changes: 4 additions & 4 deletions src/java/traces/springboot-api/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"languageId": "java",
"signal": "traces",
"displayName": "Spring Boot API",
"tags": [],
"tags": ["api", "manual"],
"description": "A Spring Boot API instrumented with OpenTelemetry Spring Boot starter that generates a trace when the /helloworld endpoint is called.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/java/trace/springboot-api",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/java/traces/springboot-api",
"steps": [
{
"displayName": "Add the Spring Boot Starter dependency",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/java/trace/springboot-api/build.gradle#L23-L27"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/java/traces/springboot-api/build.gradle"
},
{
"displayName": "Create a span",
"order": 2,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/java/trace/springboot-api/src/main/java/com/otel/recipes/springbootapi/HelloWorldController.java#L26"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/java/traces/springboot-api/src/main/java/com/otel/recipes/springbootapi/HelloWorldController.java"
}
],
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion src/js/metrics/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"languageId": "js",
"signal": "metrics",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A nodejs console application instrumented with OpenTelemetry that generate metrics.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/js/metrics/console",
"steps": [
Expand Down
6 changes: 3 additions & 3 deletions src/js/traces/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"languageId": "js",
"signal": "traces",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A nodejs console application instrumented with OpenTelemetry that generates a trace.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/js/trace/console",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/js/traces/console",
"steps": [
{
"displayName": "Configure the SDK",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/js/trace/console/app.js"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/js/traces/console/app.js"
}
],
"dependencies": [
Expand Down
2 changes: 1 addition & 1 deletion src/python/metrics/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"languageId": "python",
"signal": "metrics",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A python console application instrumented with OpenTelemetry that generate metrics.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/python/metrics/console",
"steps": [
Expand Down
6 changes: 3 additions & 3 deletions src/python/traces/console/recipefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"languageId": "python",
"signal": "traces",
"displayName": "Console App",
"tags": [],
"tags": ["console", "manual"],
"description": "A python console application instrumented with OpenTelemetry that generates a trace.",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/python/trace/console",
"sourceRoot": "https://github.com/joaopgrassi/otel-recipes/tree/main/src/python/traces/console",
"steps": [
{
"displayName": "Configure the SDK",
"order": 1,
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/python/trace/console/app.py"
"source": "https://raw.githubusercontent.com/joaopgrassi/otel-recipes/main/src/python/traces/console/app.py"
}
],
"dependencies": [
Expand Down
10 changes: 10 additions & 0 deletions src/site/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
<link rel="apple-touch-icon" href="%sveltekit.assets%/apple-touch-icon.png" />
<link rel="manifest" href="%sveltekit.assets%/site.webmanifest" />
<meta name="viewport" content="width=device-width" />
<meta name="description" content="Learn how to get started with OpenTelemetry with the help of our collection of sample applications">
<meta property="og:title" content="OTel Recipes">
<meta property="og:description" content="Learn how to get started with OpenTelemetry with the help of our collection of sample applications">
<meta property="og:type" content="website">
<meta property="og:url" content="https://otelrecipes.com">
<meta property="og:image" content="%sveltekit.assets%/social-header.png">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="OTel Recipes">
<meta name="twitter:description" content="Learn how to get started with OpenTelemetry with the help of our collection of sample applications">
<meta name="twitter:image" content="%sveltekit.assets%/social-header.png">
<script data-goatcounter="https://otelrecipes.goatcounter.com/count" src="count.js"></script>
%sveltekit.head%
</head>
Expand Down
Binary file added src/site/static/social-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 164c0cb

Please sign in to comment.