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

Httptrace #1087

Open
wants to merge 3 commits into
base: dev-3.0.0
Choose a base branch
from
Open

Httptrace #1087

wants to merge 3 commits into from

Conversation

yesoreyeram
Copy link
Collaborator

@yesoreyeram yesoreyeram commented Dec 9, 2024

This is nice to have PR and allow us investigate any connection issues. More details about HTTP trace can be found in https://pkg.go.dev/net/http/httptrace

To debug connection issues such as DNS lookup, adding the HTTPTrace event debug logging.

How to test

  • git checkout httptrace
  • yarn && yarn build && mage -v && docker compose -f ./docker-compose-debug.yaml up
  • Open localhost which will open both a infinity query and loki query as seen in the screenshot. ( you may need to run both the queries and adjust the timerange to see the results )
image image

@yesoreyeram yesoreyeram self-assigned this Dec 9, 2024
@yesoreyeram yesoreyeram added this to the Version 3.0 milestone Dec 9, 2024
@yesoreyeram yesoreyeram marked this pull request as ready for review January 16, 2025 09:24
@yesoreyeram yesoreyeram requested a review from a team as a code owner January 16, 2025 09:24
@ivanahuckova ivanahuckova self-assigned this Jan 17, 2025
logger := backend.Logger.FromContext(ctx)
trace := &httptrace.ClientTrace{
GetConn: func(hostPort string) {
logger.Debug("HTTPTrace event", "event_name", "GetConn")
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if all of these should be level trace because for data source services, we have debug level logging turned on. This would produce a lot of logs that are only sometimes needed. So we could turn it on in that case.

We have trace log level: https://github.com/grafana/grafana-plugin-sdk-go/blob/main/backend/log/log.go#L14, but we are missing logger.Trace() method - all other levels have it.

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

Successfully merging this pull request may close these issues.

2 participants