Skip to content

Conversation

@uudashr
Copy link

@uudashr uudashr commented May 7, 2020

  • Use path as pattern if found, fallback to url.
  • Test added

@uudashr
Copy link
Author

uudashr commented May 7, 2020

Also... it would be great if we can run the test on Github Action

@lucacome
Copy link
Member

@uudashr are you still interested in updating this PR? I've added an Action to run tests.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 28, 2025
@uudashr
Copy link
Author

uudashr commented Jan 28, 2025

@lucacome conflict resolved

@lucacome lucacome requested a review from Copilot March 1, 2025 21:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR refactors the middleware to use the request path as the operation name pattern if available, with a fallback to the URL, and adds tests to validate the behavior of the middleware options.

  • Updates middleware implementation to support OperationNameFunc, SpanFilter, SpanObserver, URLTagFunc, and ComponentName options.
  • Updates examples and README to use the new middleware signature with GlobalTracer and ComponentName.
  • Introduces additional tests in middleware_test.go to validate operation naming, URL tagging, span filtering, error handling, and performance.

Reviewed Changes

File Description
middleware_test.go Adds tests covering operation naming, span observation, filtering, URL tagging, error handling, and panic recovery.
examples/server.go Updates middleware initialization to use opentracing.GlobalTracer and ComponentName option.
README.md Updates usage instructions to match the updated middleware signature.
middleware.go Refactors middleware implementation to leverage new options and fallback logic for operation name and URL tags.
examples/tracer/init.go Improves error logging in tracer initialization by switching from fmt.Println to fmt.Printf.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants