Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Default newrelic-tracing instance doesn't work with Istio 1.4.3 #14

Closed
cmanzi opened this issue Feb 12, 2020 · 1 comment · Fixed by #19
Closed

Default newrelic-tracing instance doesn't work with Istio 1.4.3 #14

cmanzi opened this issue Feb 12, 2020 · 1 comment · Fixed by #19
Assignees

Comments

@cmanzi
Copy link

cmanzi commented Feb 12, 2020

Describe the bug
Using the default install of the istio adapter with Istio 1.4.3 produces the following error in Mixer:

rule='newrelic-tracing.rule.istio-system'.Match: OR(INDEX($request.headers, "x-b3-sampled"), "0") arg 2 ("0") typeError got DURATION, expected STRING

Thus preventing the adapter from receiving trace spans from Mixer.

Changing the "0" in the 'newrelic-tracing' rule to "" in the following location resolves this issue:

...((request.headers["x-b3-sampled"] | "") == "1")

With this change to the rules I can see trace spans populating in New Relic One now.

This seems to be an issue with the second argument to the OR function - "0" - being interpreted as a 'Duration' rather than a 'String' (which is the type of the first argument in this case) in Mixer's rule parsing code: https://github.com/istio/istio/blob/master/mixer/pkg/lang/ast/expr.go#L232-L251

To Reproduce
Steps to reproduce the behavior:

  1. Install Istio 1.4.3
  2. Install newrelic-istio-adapter with default rules and tracing enabled
  3. generate trace spans, look in error logs for Mixer (telemetry)

Expected behavior
Istio can send trace spans to the adapter with the default rules

Version information (please complete the following information):

  • newrelic-istio-adapter: 2.0.1
  • Kubernetes: 1.15.7
  • Istio: 1.4.3

Additional context
Add any other context about the problem here.

@MrAlias
Copy link
Contributor

MrAlias commented Feb 21, 2020

Thanks for the heads up, and fix suggestion. It looks like the way to go.

I should be able to have a PR ready in a bit to address this.

@MrAlias MrAlias self-assigned this Feb 21, 2020
MrAlias pushed a commit to MrAlias/newrelic-istio-adapter that referenced this issue Feb 21, 2020
The evaluation of the expression checking the B3 header interpreted the
integer string as a duration instead of a string. Instead evaluate
against an empty string as this will equivalently result in false if
the header is not present.

Resolves newrelic#14
@MrAlias MrAlias mentioned this issue Jul 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants