-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Latency metrics contain spurious entries #3150
Comments
The spurious entries come from:
|
Looks like the metric names are the paths fetched by tests like
|
Looks like opencensus is the culprit.
|
Some possible solutions:
@dushyanthsc @srinivashegde86 please provide feedback. |
I dont think metric name length should decide this. We can explore either ignoring names starting with / and/or adding a prefix. Adding a prefix seems unnecessary for most metrics and may depend on the test? |
Your suggestions are conflicting. A prefix tagging metrics is the easiest/quickest solution to this problem. But actually I was hoping for a more clean solution, like having a separate logger for the metrics, so there's no mix-up. But I lack knowledge right now to say if it's feasible or not. |
Sorry, dont think I understand the problem completely here. The problem is the metric name starts with @dushyanthsc If we use a new logger, the zipkin tracing will be broken? |
No. The problem is that these "metrics" are logged by third-party code, and thus appear in our Testgrid tab. But they're unrelated, and thus shouldn't be parsed as (our) metrics. |
Zipkin tracing would only depend on the Trace - ID being attached to the Http Header. It would not have any dependency on the logger. I am trying to understand the advantages of the new logger. Even with the new logger would still need to have some mechanism to parse out spans whose names would be just |
We don't care about names starting with |
For example:
The only real metric for our dashboard is the first line. Lines 2 and 3 are garbage for us. But since we use a single, global trace, the traces on line 2 and 3 are (erroneously) formatted as our metrics and displayed in the dashboard. |
More details about emitting metrics in https://github.com/knative/pkg/tree/master/test#emit-metrics |
is this only related to the ochttp transport plugin? We added the support for this for looking at http headers. This was added to enable support for zipkin tracing nad maybe not needed to others? We can probably add a formatename method that does this filtering or adds a filterable prefix? http://go/gh/census-instrumentation/opencensus-go/blob/master/plugin/ochttp/server.go#L72 |
Got it, for the third trace, it has to be started for zipkin tracing to work. So we would still need that. But you are right that trace need not be logged. I would lean towards adding a prefix - in this way we control what gets logged and the |
@srinivashegde86 that can be used to give the span a ignorable name, but logic to not log that trace has to be somewhere. |
Congrats, you got a bug for yourself. :D /assign @dushyanthsc |
I dont think adding a new logger will help here. Opencensus is logging this information using their logging mechanism and we are looking at STDOUT in the logs, so we will capture their logs as well. Some kind of filtering/prefixing might be a better option. |
Just to make sure we are all the same page, here is the plan of change:
@adrcunha @srinivashegde86 |
This is custom exporter that logs the metric for us - https://github.com/knative/pkg/blob/master/test/logging/logging.go#L71 We can update this log to prefix with something like the |
This is error-prone and implies more boilerplate code. Create a helper, update the documentation.
Won't work, the end result will be the same with just a more complicated way: you're still logging everything as a valid metric. |
Also https://github.com/knative/pkg/blob/master/test/kube_checks.go |
Ok, besides the approach to adding a helper and additional place in kube_checks. Should I make the changes? |
knative/serving#3150 describes the issue that currently exists in our test logging framework. This change fixes the problem by prefixing metrics that needs to be emited by a constant which the logging.ExpoxtSpan method then uses to identify the spans that needs to be emitted as logs Note this only fixes part of the issue: knative/serving#3150 this change needs to be ported to knative serving before the issue can be closed.
* Metrics logging fix in pkg/test: Issue-3150 knative/serving#3150 describes the issue that currently exists in our test logging framework. This change fixes the problem by prefixing metrics that needs to be emited by a constant which the logging.ExpoxtSpan method then uses to identify the spans that needs to be emitted as logs Note this only fixes part of the issue: knative/serving#3150 this change needs to be ported to knative serving before the issue can be closed. * Update test/logging/logging.go Adding required lines. Co-Authored-By: dushyanthsc <[email protected]>
This changeset fixes issue: knative#3150
This changeset fixes issue: #3150
Reopening since this also requires changes in pkg. |
@adrcunha Did I miss something in this PR: knative/pkg#279 |
Sorry, no. It was I who missed your PR in pkg. |
In what area(s)?
What version of Knative?
HEAD
Expected Behavior
No spurious metrics.
Actual Behavior
Metrics "/", "/envvars" and "/filepath" are displayed in Testgrid:
Steps to Reproduce the Problem
Check the Testgrid tab.
The text was updated successfully, but these errors were encountered: