Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract and fix middlewares #158

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NthPortal
Copy link
Contributor

Add abstraction to middlewares to support full customisation of span names and attributes while keeping default use case as simple as possible.

Fix default attributes to align with otel semantic conventions.

Add tests for all attribute creation.

@NthPortal NthPortal force-pushed the attribute-provider/PR branch from cd9b3e4 to f515c75 Compare December 5, 2024 18:04
@NthPortal
Copy link
Contributor Author

@ioleo can you have a look and let me know if this meets your needs?

Add abstraction to middlewares to support full customisation of
span names and attributes while keeping default use case as simple
as possible.

Fix default attributes to align with otel semantic conventions.

Add tests for all attribute creation.
Use `MeterProvider` for `MetricsOps` rather than `Meter` and use
`TracerProvider for middlewares rather than `Tracer`.
@NthPortal NthPortal force-pushed the attribute-provider/PR branch from 4db2487 to 3b029ea Compare December 12, 2024 07:00
@NthPortal NthPortal force-pushed the attribute-provider/PR branch from d675146 to 6a3994b Compare December 12, 2024 07:22
Comment on lines 96 to 108
val middlewareVersion: AttributeProvider =
new AttributeProvider {
def requestAttributes[F[_]](
request: Request[F],
urlTemplateClassifier: UriTemplateClassifier,
urlRedactor: UriRedactor,
headersAllowedAsAttributes: Set[AuthScheme],
): Attributes = Attributes(TypedAttributes.middlewareVersion)
def responseAttributes[F[_]](
response: Response[F],
headersAllowedAsAttributes: Set[AuthScheme],
): Attributes = Attributes.empty
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if this is a reasonable thing to do or not, but it's a separate commit so it will be easy to remove if we decide not

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