Skip to content

Commit

Permalink
Tidy and document honeycomb configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewi committed Apr 11, 2024
1 parent ddf210f commit 2b8ce1e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package agent

import (
"context"
"strings"

"github.com/go-logr/logr"
"go.opentelemetry.io/otel/trace"
"strings"

"github.com/go-logr/zapr"
"go.uber.org/zap"
Expand Down
14 changes: 9 additions & 5 deletions app/pkg/application/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ package application
import (
"context"
"fmt"
"io"
"net/http"
"os"
"strings"

"github.com/honeycombio/honeycomb-opentelemetry-go"
"github.com/honeycombio/otel-config-go/otelconfig"
"github.com/jlewi/hydros/pkg/files"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/sdk/trace"
"io"
"net/http"
"os"
"strings"

"github.com/go-logr/zapr"
"github.com/jlewi/foyle/app/pkg/config"
Expand Down Expand Up @@ -74,7 +75,10 @@ func (a *App) SetupOTEL() error {
tracerProvider := trace.NewTracerProvider()
otel.SetTracerProvider(tracerProvider)
a.otelShutdownFn = func() {
tracerProvider.Shutdown(context.Background())
if err := tracerProvider.Shutdown(context.Background()); err != nil {
log := zapr.NewLogger(zap.L())
log.Error(err, "Error shutting down tracer provider")
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/pkg/docs/ids_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package docs

import (
"github.com/jlewi/foyle/protos/go/foyle/v1alpha1"
"testing"

"github.com/jlewi/foyle/protos/go/foyle/v1alpha1"
)

func Test_SetBlockIds(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions app/pkg/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package executor
import (
"context"
"fmt"
"github.com/go-logr/logr"
"go.opentelemetry.io/otel/trace"
"strings"
"time"

"github.com/go-logr/logr"
"go.opentelemetry.io/otel/trace"

"github.com/go-cmd/cmd"
"github.com/jlewi/foyle/app/pkg/logs"
"github.com/jlewi/foyle/protos/go/foyle/v1alpha1"
Expand Down
18 changes: 18 additions & 0 deletions docs/content/en/docs/observability/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: "Observability"
description: "Observability for Foyle"
weight: 7
---

## What You'll Learn

How to use OpenTelemetry to monitor Foyle.

## Configure Honeycomb

To configure Foyle to use Honeycomb as a backend you just need to set the `telemetry.honeycomb.apiKeyFile`
configuration option to the path of a file containing your Honeycomb API key.

```
foyle config set telemetry.honeycomb.apiKeyFile = /path/to/apikey
```

0 comments on commit 2b8ce1e

Please sign in to comment.