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

feat!(datadogexporter): added peer.service priority instead service.name #2817

Merged

Conversation

angeliski
Copy link
Contributor

Description:
peer.service is a user-defined name for a service, which is conceptually the same as a service name.
We should use it when defined and not service.name

That behavior is because datadog need to "separate" the service:
Before:
Screenshot from 2021-03-22 12-40-09
After:
Screenshot from 2021-03-22 12-41-18

You can see, when we don't prioritize the peer.service, the whole operation is showed in the main service (GET request and SETEX operation). After we change, the exporter could create the separation between operations and give the correct attribution

The spec says:

peer.service - The service.name of the remote service. SHOULD be equal to the actual service.name resource attribute of the remote service if any.

So I think makes sense to change that behavior.

I created a really simple implementation, so any feedback would be useful

Link to tracking Issue:

Testing: Unit Test

@angeliski angeliski requested a review from a team March 22, 2021 15:48
@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #2817 (9f72d3c) into main (359d6e4) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2817      +/-   ##
==========================================
- Coverage   91.60%   91.59%   -0.01%     
==========================================
  Files         450      450              
  Lines       22191    22193       +2     
==========================================
  Hits        20327    20327              
- Misses       1394     1395       +1     
- Partials      470      471       +1     
Flag Coverage Δ
integration 69.09% <ø> (-0.07%) ⬇️
unit 90.53% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
exporter/datadogexporter/translate_traces.go 89.30% <100.00%> (+0.08%) ⬆️
receiver/k8sclusterreceiver/watcher.go 95.29% <0.00%> (-2.36%) ⬇️

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 359d6e4...9f72d3c. Read the comment docs.

@angeliski angeliski force-pushed the datadog-add-peer-service branch from 672b1e6 to d0ecf61 Compare March 22, 2021 16:57
peer.service is a user-defined name for a service,
which is conceptually the same as a service name.
We should use it when defined and not service.name
@angeliski angeliski force-pushed the datadog-add-peer-service branch from d0ecf61 to 9f72d3c Compare March 24, 2021 20:31
@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2021

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 1, 2021
@angeliski
Copy link
Contributor Author

Hey @bogdandrutu @ericmustin could you help me here? Do I need to do something?

@ericmustin
Copy link
Contributor

@angeliski sorry for delay here, i didn't get any notifications on this. I think this change makes sense and fits the spec, lgtm

@github-actions github-actions bot removed the Stale label Apr 2, 2021
@ericmustin
Copy link
Contributor

@bogdandrutu could we merge this when there's a chance before next release is cut?

@tigrannajaryan tigrannajaryan merged commit be89675 into open-telemetry:main Apr 9, 2021
@angeliski angeliski deleted the datadog-add-peer-service branch April 9, 2021 20:33
pmatyjasek-sumo referenced this pull request in pmatyjasek-sumo/opentelemetry-collector-contrib Apr 28, 2021
…ame (#2817)

peer.service is a user-defined name for a service, which is conceptually the same as a service name.
We should use it when defined and not service.name

That behavior is because datadog need to "separate" the service:
Before:
![Screenshot from 2021-03-22 12-40-09](https://user-images.githubusercontent.com/1574240/112017047-03875000-8b0c-11eb-9265-c8f3763f48f0.png)
After:
![Screenshot from 2021-03-22 12-41-18](https://user-images.githubusercontent.com/1574240/112017065-06824080-8b0c-11eb-8dce-6e8b048688bf.png)

You can see, when we don't prioritize the `peer.service`, the whole operation is showed in the **main** service (GET request and SETEX operation). After we change, the exporter could create the separation between operations and give the correct attribution 

The [spec](https://github.com/open-telemetry/opentelemetry-specification/blob/a44d863edcdef63b0adce7b47df001933b7a158a/specification/trace/semantic_conventions/span-general.md#general-remote-service-attributes) says:

>  peer.service - The service.name of the remote service. SHOULD be equal to the actual service.name resource attribute of the remote service if any.


So I think makes sense to change that behavior.

I created a really simple implementation, so any feedback would be useful
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