istio.io icon indicating copy to clipboard operation
istio.io copied to clipboard

Add OpenTelemetry tracing example

Open joaopgrassi opened this issue 1 year ago • 14 comments

Description

Closes #12612

This PR adds a sample on how to configure Istio to generate/export OpenTelemetry traces to a collector. It contains examples on how to export via gRPC and the newly added HTTP exporter (https://github.com/istio/istio/pull/49052)

Reviewers

  • [ ] Ambient
  • [ ] Docs
  • [ ] Installation
  • [ ] Networking
  • [ ] Performance and Scalability
  • [x] Extensions and Telemetry
  • [ ] Security
  • [ ] Test and Release
  • [ ] User Experience
  • [ ] Developer Infrastructure
  • [ ] Localization/Translation

CC @zirain @hanxiaop

joaopgrassi avatar Jan 30 '24 16:01 joaopgrassi

😊 Welcome! This is either your first contribution to the Istio documentation repo, or it's been a while since you've been here. A few things you should know:

  • You can learn about how we write and maintain documentation, our style guidelines, and the available web site features by visiting Contributing to the Docs.

  • In the next few minutes, an automatic preview of your change will be built with a full copy of the istio.io website. You can find this preview by clicking on the Details link next to the deploy/netlify entry in the status section of this page.

  • We care about quality, so we've put in place a number of checks to ensure our documentation is top-notch. We do spell checking, sanitize the Markdown, ensure all hyperlinks point to a valid location, and more. If your PR doesn't pass one of these checks, you'll see a red X in the lint_istio.io entry in the status section. Click on the Details link to get a list of the problems with your PR. Fix those problems and push an update; this will automatically re-run the tests. Hopefully this time everything will be perfect!

  • Once your changes are accepted and merged into the repository, they will initially show up on https://preliminary.istio.io. The changes will be published to https://istio.io the next time we do a major release (which typically happens every 3 months or so). To publish them sooner, add a cherrypick/release-x.xx label, where x.xx is the current release of Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

istio-policy-bot avatar Jan 30 '24 16:01 istio-policy-bot

Sorry, this was meant to be a draft first. Fixing all the lint issues 🙈

joaopgrassi avatar Jan 30 '24 17:01 joaopgrassi

Is this example appropriate for release 1.21.0? I notice mention of a required PR that is for istio/istio master, which would not be in 1.21. If this is not appropriate for 1.21, we do not want this merged yet. Currently, the master istio.io branch is solely for prepping for the 1.21 release. Once 1.21.0 is released and the istio.io team has made the release-1.21 branch cut, release 1.22 items can be merged in the master branch.

ericvn avatar Jan 30 '24 19:01 ericvn

Is this example appropriate for release 1.21.0? I notice mention of a required PR that is for istio/istio master, which would not be in 1.21. If this is not appropriate for 1.21, we do not want this merged yet. Currently, the master istio.io branch is solely for prepping for the 1.21 release. Once 1.21.0 is released and the istio.io team has made the release-1.21 branch cut, release 1.22 items can be merged in the master branch.

In that PR, there's talks about getting it into 1.21 so I think it will be given what was said in there.

dhawton avatar Jan 30 '24 19:01 dhawton

DNM pending the reliance PR and to see if it goes in to 1.21, otherwise we'll wait until after the 1.21 docs branch cut to merge.

dhawton avatar Jan 30 '24 19:01 dhawton

Is this example appropriate for release 1.21.0? I notice mention of a required PR that is for istio/istio master, which would not be in 1.21. If this is not appropriate for 1.21, we do not want this merged yet. Currently, the master istio.io branch is solely for prepping for the 1.21 release. Once 1.21.0 is released and the istio.io team has made the release-1.21 branch cut, release 1.22 items can be merged in the master branch.

I would like see this in 1.21, but I think it need a permission after brunch cut.

zirain avatar Jan 31 '24 02:01 zirain

Is this example appropriate for release 1.21.0? I notice mention of a required PR that is for istio/istio master, which would not be in 1.21. If this is not appropriate for 1.21, we do not want this merged yet. Currently, the master istio.io branch is solely for prepping for the 1.21 release. Once 1.21.0 is released and the istio.io team has made the release-1.21 branch cut, release 1.22 items can be merged in the master branch.

I would like see this in 1.21, but I think it need a permission after brunch cut.

The content looks good; I would like to see this in 1.21 as well. @zirain BTW I think it only depends on the RM whether they want to cherry-pick the feature to the release branch or not, between the period of the branch cut and the release candidate build.

hanxiaop avatar Jan 31 '24 02:01 hanxiaop

sorry about this, @joaopgrassi let's focus on grpc endpoint example first, then update http endpoint example later?

zirain avatar Feb 01 '24 02:02 zirain

See preview here.

windsonsea avatar Feb 01 '24 02:02 windsonsea

sorry about this, @joaopgrassi let's focus on grpc endpoint example first, then update http endpoint example later?

No problem, sounds good! I will remove the HTTP parts and rollback the go.mod change :)

joaopgrassi avatar Feb 01 '24 09:02 joaopgrassi

The tests are failing because the demo profile expects the collector to be deployed in the otel-collector namespace https://github.com/istio/istio/blob/master/manifests/charts/default/files/profile-demo.yaml#L19, but the boilerplate start-otel-collector-service.sh deploys it on istio-system.

Not sure what is the best way to go now.

  • Create another boilerplate that deploys on the namespace otel-collector?
  • Not use the demo profile for the test?
  • Add a new entry on addons.sh hardcoded to deploy in the otel-collector namespace?
  • ?

Edit: For now I went with the first option - I added a new boilerplate file.

joaopgrassi avatar Feb 01 '24 11:02 joaopgrassi

The tests are failing because the demo profile expects the collector to be deployed in the otel-collector namespace https://github.com/istio/istio/blob/master/manifests/charts/default/files/profile-demo.yaml#L19, but the boilerplate start-otel-collector-service.sh deploys it on istio-system.

Not sure what is the best way to go now.

  • Create another boilerplate that deploys on the namespace otel-collector?
  • Not use the demo profile for the test?
  • Add a new entry on addons.sh hardcoded to deploy in the otel-collector namespace?
  • ?

Edit: For now I went with the first option - I added a new boilerplate file.

I think it's better to keep it in istio-system, same as what we did in other addons.

xref: https://github.com/istio/istio/pull/49143

zirain avatar Feb 01 '24 12:02 zirain

I think it's better to keep it in istio-system, same as what we did in other addons.

xref: https://github.com/istio/istio/pull/49143

~What we do with the demo profile then? That looks for the collector in its own namespace and not in istio-system. Or I just not use the demo profile for this test?~ I left a comment on the linked PR.

joaopgrassi avatar Feb 01 '24 12:02 joaopgrassi

@zirain I updated this PR after you changed the profiles in https://github.com/istio/istio/pull/49143. I'm hoping the build will pass now 🤞

Edit: I miserably failed to get the build to pass.. so many problems. Sorry I'm working on it 😓

joaopgrassi avatar Mar 21 '24 13:03 joaopgrassi

/retest

joaopgrassi avatar Mar 23 '24 10:03 joaopgrassi

Hi all, I managed to make the build now pass. This is an initial version, and later I can add the example for HTTP as well as things about all the ways to configure sampling.

joaopgrassi avatar Mar 25 '24 08:03 joaopgrassi

/retest

joaopgrassi avatar Mar 25 '24 17:03 joaopgrassi

Hey all! Anything else to do in this PR? Would be good to get it merged, so I can progress in adding other pages (For HTTP exporter and Sampling). Thank you!

joaopgrassi avatar Mar 27 '24 09:03 joaopgrassi

/retest

joaopgrassi avatar Mar 27 '24 15:03 joaopgrassi

/retest

joaopgrassi avatar Mar 28 '24 12:03 joaopgrassi