Skip to content

Commit

Permalink
feat(otelecho): Adjust the default span name
Browse files Browse the repository at this point in the history
  • Loading branch information
flc1125 committed Nov 26, 2024
1 parent 27ce430 commit 21235e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Added support for providing `endpoint`, `pollingIntervalMs` and `initialSamplingRate` using environment variable `OTEL_TRACES_SAMPLER_ARG` in `go.opentelemetry.io/contrib/samples/jaegerremote`. (#6310)
- Added support exporting logs via OTLP over gRPC in `go.opentelemetry.io/contrib/config`. (#6340)
- Added support custom span name in `go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho`. (#6365)
- Added support custom span name and refactored the default span name in `go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho`. (#6365)

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestTrace200(t *testing.T) {
spans := sr.Ended()
require.Len(t, spans, 1)
span := spans[0]
assert.Equal(t, "/user/:id", span.Name())
assert.Equal(t, "GET /user/:id", span.Name())
assert.Equal(t, oteltrace.SpanKindServer, span.SpanKind())
attrs := span.Attributes()
assert.Contains(t, attrs, attribute.String("net.host.name", "foobar"))
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestError(t *testing.T) {
spans := sr.Ended()
require.Len(t, spans, 1)
span := spans[0]
assert.Equal(t, "/server_err", span.Name())
assert.Equal(t, "GET /server_err", span.Name())
attrs := span.Attributes()
assert.Contains(t, attrs, attribute.String("net.host.name", "foobar"))
assert.Contains(t, attrs, attribute.Int("http.status_code", http.StatusInternalServerError))
Expand Down Expand Up @@ -175,7 +175,7 @@ func TestStatusError(t *testing.T) {
spans := sr.Ended()
require.Len(t, spans, 1)
span := spans[0]
assert.Equal(t, "/err", span.Name())
assert.Equal(t, "GET /err", span.Name())
assert.Equal(t, tc.spanCode, span.Status().Code)

attrs := span.Attributes()
Expand Down

0 comments on commit 21235e9

Please sign in to comment.