Skip to content

Add health endpoints, JSON logs and traces to service-go-greeter - #29

Open
Ketharan wants to merge 1 commit into
openchoreo:mainfrom
Ketharan:feat/go-greeter-observability
Open

Ketharan wants to merge 1 commit into
openchoreo:mainfrom
Ketharan:feat/go-greeter-observability

Conversation

@Ketharan

@Ketharan Ketharan commented Oct 17, 2026 •

Copy link
Copy Markdown

Purpose

service-go-greeter had no health endpoint, so a liveness or readiness probe had nothing to
point at, and it logged with the standard logger, so there was nothing to correlate against a
trace.

Approach

  • /healthz for liveness, reporting on the process only
  • /readyz for readiness; the service has no dependencies, so it is ready once it is listening
  • JSON logs carrying trace_id and span_id, the name served, whether it was defaulted, and
    the request duration
  • OpenTelemetry traces over OTLP with context propagation, so a caller that forwards trace
    headers shares one trace with this service
  • PORT and LOG_LEVEL are configurable, defaulting to 9090 and info

The greeting contract is unchanged: GET /greeter/greet?name= still answers Hello, <name>!
and still defaults to Stranger. Tracing is best-effort and disabled when no OTLP endpoint is
set. Go moves to 1.26 in go.mod and the Dockerfile, which the OpenTelemetry modules require.

Checklist

  • Tests added or updated (unit, integration, etc.)
  • Samples updated (if applicable)

The service had no health endpoint, so a liveness or readiness probe had
nothing to point at, and it logged only with the standard logger, so there
was nothing to correlate against a trace.

- /healthz for liveness, reporting on the process only
- /readyz for readiness; this service has no dependencies, so it is ready
  as soon as it is listening
- JSON logs carrying trace_id and span_id, plus the name served, whether it
  was defaulted, and how long the request took
- OpenTelemetry traces over OTLP, with context propagation, so a caller that
  forwards trace headers shares one trace with this service
- PORT and LOG_LEVEL are configurable, defaulting to 9090 and info

The greeting contract is unchanged: GET /greeter/greet?name= still answers
"Hello, <name>!" and still defaults to Stranger.

Tracing is best-effort and disabled when no OTLP endpoint is set. Go moves
to 1.26 in go.mod and the Dockerfile, which the OpenTelemetry modules
require.

Signed-off-by: Ketharan <ketharan.mail@gmail.com>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a8aae98-4008-4c54-9598-990a920676be
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant