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

otelfiber: Add custom attributes support #700

Merged
merged 3 commits into from
Aug 6, 2023
Merged

otelfiber: Add custom attributes support #700

merged 3 commits into from
Aug 6, 2023

Conversation

kaptinlin
Copy link
Contributor

We can add some custom attributes to span, if we need to customize

app := fiber.New()
app.Use(
	otelfiber.Middleware(
		otelfiber.WithTracerProvider(provider),
		otelfiber.WithCustomAttributes(func(ctx *fiber.Ctx) []attribute.KeyValue {
			return []attribute.KeyValue{
				attribute.Key("http.query_params").String(ctx.Request().URI().QueryArgs().String()),
			}
		}),
	),
)

@github-actions github-actions bot added the ✏️ Feature New feature or request label Jul 28, 2023
@gaby
Copy link
Member

gaby commented Aug 4, 2023

@kaptinlin Can you take a look at the merge conflict

Copy link
Member

@gaby gaby left a comment

Choose a reason for hiding this comment

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

Lgtm

@kaptinlin
Copy link
Contributor Author

@kaptinlin Can you take a look at the merge conflict

updated

@gaby gaby changed the title add custom attributes support to otelfiber otelfiber: Add custom attributes support Aug 5, 2023
@ReneWerner87 ReneWerner87 merged commit 22cff18 into gofiber:main Aug 6, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants