Skip to content

feat(melt): integrate salome trace and metric#25

Merged
raf555 merged 2 commits into
mainfrom
add-trace-metrics
Feb 17, 2026
Merged

feat(melt): integrate salome trace and metric#25
raf555 merged 2 commits into
mainfrom
add-trace-metrics

Conversation

@raf555

@raf555 raf555 commented Feb 17, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates OpenTelemetry tracing and metrics into the application using the salome/melt library. The changes enable comprehensive observability by adding trace and metric instrumentation throughout the HTTP server and request handling pipeline.

Changes:

  • Added OpenTelemetry module with trace and metric providers using the salome/melt library
  • Integrated otelgin middleware to automatically instrument HTTP requests with OpenTelemetry tracing
  • Created ServerConfig to manage service name configuration required for telemetry

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/cmdfx/otel.go New OpenTelemetry module that sets up trace and metric providers, integrates with context decorators
cmd/cmdfx/kitchensink.go Integrated OtelModule into the application's common dependencies
internal/http/httpsrv/server.go Added otelgin middleware for HTTP request tracing, excludes health check endpoint
internal/dictionary/http_handler.go Added temporary test metric code to demonstrate metrics usage (marked for removal)
internal/config/config.go New ServerConfig struct to hold service name for telemetry
internal/config/configfx/fx.go Aliased salome config imports and added ServerConfig provider
go.mod Added direct dependencies for otelgin and OpenTelemetry packages, upgraded gin to v1.11.0
go.sum Updated checksums for new and upgraded dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/http/httpsrv/server.go Outdated
Comment on lines +59 to +63
return c.FullPath() != ""
},
func(c *gin.Context) bool {
return c.FullPath() != "/healthzzz"
},

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first filter in WithGinFilter checks if FullPath is not empty, which would exclude requests that don't match any route. However, this may not be the intended behavior. The otelgin.WithGinFilter expects filters that return true to EXCLUDE the request from instrumentation. So this filter will exclude all unmatched routes (404s), which might not be desirable for observability. Consider whether you want to track 404 errors in your traces.

Suggested change
return c.FullPath() != ""
},
func(c *gin.Context) bool {
return c.FullPath() != "/healthzzz"
},
// Exclude the health check route from tracing; trace all other routes, including 404s.
return c.FullPath() == "/healthzzz"
},

Copilot uses AI. Check for mistakes.
Comment on lines +140 to +141
mt := metric.FromContext(ctx) // TODO: for metrics test, remove later
mt.Count(ctx, "kbbi_random", 1)

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment indicates this metric test code should be removed later. Since this is test/temporary code that's being committed to the codebase, consider either removing it before merging or creating a tracking issue to ensure it's cleaned up. Temporary debugging code in production can lead to technical debt.

Copilot uses AI. Check for mistakes.
@raf555 raf555 merged commit 1642823 into main Feb 17, 2026
4 checks passed
@raf555 raf555 deleted the add-trace-metrics branch February 17, 2026 04:42
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.

2 participants