-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/net/trace: add Trace.String() #12864
Comments
CC @dsymonds |
It's not obvious that this is useful. Traces are a sizable object; note that |
An alternate way of looking at this issue: the x/net/trace package is designed for observing a running server. It is not designed as a mechanism for permanent logging. That should be something separate, with its own considerations and trade-offs. I think I've convinced myself that there isn't something useful to do here, so I'm going to close this feature request. I'm open to counter-arguments. |
Perhaps I'm misremembering, but I thought the traces displayed on requestz were the same traces written to BINARY_TRACE logs and consumed by dapper for analysis. Maybe a I could have sworn that C++ traces (at Google) allowed outputting the trace to a string. My mind might be playing tricks on me. It's been years. I'm mildly surprised that you jumped to the conclusion so quickly that there is nothing useful to do here as right now the trace info seems entirely locked up within the |
No, requestz and the binary logs contained substantial overlap, but they're different code paths and have different purposes. It's also different across languages. A Proto method to generate a proto might be okay, though that should be decided across languages too. There might be something suitable for gRPC traces, but note that x/net/trace isn't RPC-specific either. I didn't jump to a quick conclusion. I've been thinking about this code for several years. I just revised my previous thinking on the matter. I don't think there's much in the way of trace-specific information in the trace; all its content comes from outside the package, so those places can simply record the information in a different place too. |
Yes, all of the trace content comes from outside of the trace package, but How do I (as a user of grpc and x/net/trace) get access to the trace content that grpc has stored in a trace? Punting the problem to grpc feels like a non-starter to me so I didn't even consider it. Do you think the Go grpc folks would be open to adding instrumentation points for gathering trace content? |
Like I said, x/net/trace is not RPC-specific, so if you're after RPC-specific information then you're already looking at the wrong part of the puzzle. grpc-go is indeed weighing up hooks for per-RPC monitoring and instrumentation. See grpc/grpc-go#240 or grpc/grpc-go#335. |
I get that I'll read the issues you pointed to in more detail tomorrow. |
grpc/grpc-go#240 is asking for instrumentation hooks in gRPC for metrics monitoring. That's not what I'm after. grpc/grpc-go#335 is asking for something akin to BINARY_INFO logs. Again, not what I'm after. I'm looking for something like BINARY_TRACE logs (though perhaps not binary). That is, output of RPC trace info and application-level annotations added to traces (created via Btw, in case it isn't clear, I'm willing to implement this if you give guidance on what you find palatable. |
Even though We are after binary logging as well so we can collect and analyze traces. Our first naive approach was:
However this approach wouldn't work as all the interesting data is within the private |
Currently, the only way to view a trace is to visit the
/debug/requests
endpoint. This is nice, though impermanent. An application might want to log a trace for a slow request for a more permanent record. I'd like to addTrace.String()
as a mechanism for doing this along withTrace.SensitiveString()
. Alternately, a singleTrace.LogString(sensitive bool)
could suffice.The text was updated successfully, but these errors were encountered: