Skip to content

Conversation

@owais
Copy link
Contributor

@owais owais commented Sep 5, 2019

Preserve OC resource labels during translation to Jaeger by adding them
to the process tags

Right now we translate OC node to Jaeger process while completely
ignoring OC resource labels resulting in loss of this data. This PR
patches the OC > Jaeger translators by making sure the resource labels
are recorded as Jaegerprocess tags. While this preserves process labels
and prevents loss of such data when translating to Jaeger, it's not a
perfect solution because:

  1. It will replace any tags from OC Node with the same names.

    Current behaviour is to give precedence to resource labels over node
    attributes. We can make it configurable or revisit the decision
    later.

  2. Translation is not reversible

    Translating back from Jaeger to OC will still not re-create the OC
    process object. It'll instead translate all the Jaeger process tags
    to OC node attributes. We could add some semantic convention to
    denote resource labels differently or add an additional tag to
    specify the resource tag names but doing so would add additional
    complexity to backends processing traces in the Jaeger format. Also,
    in practice, it's going to be very rare for people to translate from
    OC to Jaeger and then back from Jaeger to OC in the same data
    pipeline.

While this doesn't solve the cases perfectly, we think it's better than
completely dropping the resource data.

@codecov-io
Copy link

codecov-io commented Sep 5, 2019

Codecov Report

Merging #325 into master will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #325     +/-   ##
=========================================
+ Coverage    74.2%   74.31%   +0.1%     
=========================================
  Files         115      115             
  Lines        6676     6704     +28     
=========================================
+ Hits         4954     4982     +28     
  Misses       1474     1474             
  Partials      248      248
Impacted Files Coverage Δ
...ranslator/trace/jaeger/protospan_to_jaegerproto.go 77.25% <100%> (+1.03%) ⬆️
...anslator/trace/jaeger/protospan_to_jaegerthrift.go 83.03% <100%> (+0.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df62b61...c46ae23. Read the comment docs.

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Also, in practice, it's going to be very rare for people to translate from
OC to Jaeger and then back from Jaeger to OC in the same data
pipeline.

Agree, I would not worry too much about the Jaeger-to-OC case.

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Some minor comments, otherwise LGTM.

@owais
Copy link
Contributor Author

owais commented Sep 5, 2019

Thanks for the review @songy23. Updated the PR.

@owais
Copy link
Contributor Author

owais commented Sep 5, 2019

I still don't have merge rights. Can someone please merge this? :)

})
}
for k, v := range resource.GetLabels() {
if v != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Why are we ignoring empty values?

Copy link
Member

Choose a reason for hiding this comment

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

I don't have a strong opinion on this. I suggest ignoring them because for OTel resources not all labels are required (e.g pod_id is optional in gke_container resource). For labels without a value I don't think they're pretty useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't have a strong opinion either but I think it's probably better to allow it. I don't see a reason why anyone would use an empty string as a value but I don't see much reason in disallowing it either. If something does not have any obvious downsides, I think we should generally try to not limit flexibility for end users. The check for resource type is a different thing as empty string there means it was never set.

Copy link
Member

Choose a reason for hiding this comment

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

@owais so do you plan to remove this if?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed it.

})
}
for k, v := range resource.GetLabels() {
if v != "" {
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Preserve OC resource labels during translation to Jaeger by adding them
to the process tags

Right now we translate OC node to Jaeger process while completely
ignoring OC resource labels resulting in loss of this data. This PR
patches the OC > Jaeger translators by making sure the resource labels
are recorded as Jaegerprocess tags. While this preserves process labels
and prevents loss of such data when translating to Jaeger, it's not a
perfect solution because:

1. It will replace any tags from OC Node with the same names.

    Current behaviour is to give precedence to resource labels over node
    attributes. We can make it configurable or revisit the decision
    later.

2. Translation is not reversible

    Translating back from Jaeger to OC will still not re-create the OC
    process object. It'll instead translate all the Jaeger process tags
    to OC node attributes. We could add some semantic convention to
    denote resource labels differently or add an additional tag to
    specify the resource tag names but doing so would add additional
    complexity to backends processing traces in the Jaeger format. Also,
    in practice, it's going to be very rare for people to translate from
    OC to Jaeger and then back from Jaeger to OC in the same data
    pipeline.

While this doesn't solve the cases perfectly, we think it's better than
completely dropping the resource data.
@owais
Copy link
Contributor Author

owais commented Sep 12, 2019

@tigrannajaryan @songy23 can we merge this please? It's kind of blocking me from working on another feature :)

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

LGTM

@tigrannajaryan tigrannajaryan merged commit 8fa6afe into open-telemetry:master Sep 12, 2019
@tigrannajaryan
Copy link
Member

@owais Nice commit message!

@owais owais deleted the preserve-resource-tags-during-translation branch February 19, 2020 00:43
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
hughesjj pushed a commit to hughesjj/opentelemetry-collector that referenced this pull request Apr 27, 2023
…metry#325)

* Expose initial and effective config for debugging purposes

(Still incomplete, just the initial ideas)

* Add tests

* Remove outdated test comment

* Add 'token' to the redaction list

* Require an env var to be defined before serving config
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants